3
3
# BioPerl Graph adaptor for Bio::Ontology::SimpleGOEngine
5
# Please direct questions and support issues to <bioperl-l@bioperl.org>
5
# Please direct questions and support issues to <bioperl-l@bioperl.org>
7
7
# Cared for by Nat Goodman <natg at shore.net>
38
This is a think adaptor to simplify use of the old and new versions of
39
the standard CPAN Graph module (old is versions 0.2x; new is 0.5x and
40
beyond) within Bio::Ontology::SimpleGOEngine.
42
This module implements only those Graph methods used by
43
SimpleGOEngine. It is far from a complete compatibility layer! It
44
also implements workarounds for cerain performance problems in the
45
current versions of Graph v0.5x.
47
This class provides a 'new' method that determines which version of
48
Graph is available. The object returned by 'new' is blessed into this
49
class if the new version of Graph is available, else into the subclass
51
Bio::Ontology::SimpleGOEngine::GraphAdaptor02
53
This class provides implementations for the required graph methods
54
using the new version of Graph. In most cases, these are simple
55
pass-throughs. Methods that differ in v0.2x are implemented in the
38
This is an adaptor to simplify use of versions of the standard CPAN Graph module
39
(old is versions 0.2x; new is 0.5x and beyond) within
40
Bio::Ontology::SimpleGOEngine. Prior versions of this module supported Graph
41
version older than 0.5, however we are removing support for these older version
42
post BioPerl 1.6.901. If you absolutely require an old version of Graph, please
43
use an older version of BioPerl.
45
This module implements only those Graph methods used by SimpleGOEngine. It is
46
far from a complete compatibility layer! It also implements workarounds for
47
certain performance problems in the current versions of Graph v0.5x.
49
This class provides implementations for the required graph methods using the new
50
version of Graph. In most cases, these are simple pass-throughs
58
52
The methods implemented here or in the subclasses are listed below.
59
53
In all cases, we implemented the Graph v0.5x interface. Consult the
86
80
bioperl-l@bioperl.org - General discussion
87
81
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
91
85
Please direct usage questions or support issues to the mailing list:
93
87
I<bioperl-l@bioperl.org>
95
rather than to the module maintainer directly. Many experienced and
96
reponsive experts will be able look at the problem and quickly
97
address it. Please include a thorough description of the problem
89
rather than to the module maintainer directly. Many experienced and
90
reponsive experts will be able look at the problem and quickly
91
address it. Please include a thorough description of the problem
98
92
with code and data examples if at all possible.
100
94
=head2 Reporting Bugs
141
134
Usage : $graph = Bio::Ontology::SimpleGOEngine::GraphAdaptor->new()
142
135
Function: Creates a new graph
143
Returns : Bio::Ontology::SimpleGOEngine::GraphAdaptor02 or
144
Bio::Ontology::SimpleGOEngine::GraphAdaptor05 object,
136
Returns : Bio::Ontology::SimpleGOEngine::GraphAdaptor02 or
137
Bio::Ontology::SimpleGOEngine::GraphAdaptor05 object,
145
138
depending on which Graph version is available
151
144
my( $class ) = @_;
152
145
$class = ref $class || $class;
155
( defined $Graph::VERSION && $Graph::VERSION >= 0.5 ) ?
156
bless ( {}, $class ) :
157
bless ( {}, 'Bio::Ontology::SimpleGOEngine::GraphAdaptor02' );
158
$self->{_graph}=new Graph::Directed;
147
my $self= bless( {}, $class );
148
$self->{_graph}=Graph::Directed->new();
159
149
$self->{_vertex_attributes}={};
160
150
$self->{_edge_attributes}={};
208
198
$self->_graph->sink_vertices();
210
# The following methods workaround a performance problem in Graph v0.5x
200
# The following methods workaround a performance problem in Graph v0.5x
211
201
# when attributes are attached to the graph
212
202
sub set_vertex_attribute {
213
203
my($self,$v,$attribute,$value)=@_;
243
233
Title : _vertex_attributes
244
234
Usage : $self->vertex_attributes();
245
235
Function: Internal method to access HASH used to store vertex attributes
246
Returns : Graph::Directed object
236
Returns : Graph::Directed object