Skip to content

Commit

Permalink
require Graph >= 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Fields committed Mar 13, 2012
1 parent 6176be4 commit 0930270
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
32 changes: 14 additions & 18 deletions Bio/Ontology/SimpleGOEngine/GraphAdaptor.pm
Expand Up @@ -2,7 +2,7 @@
#
# BioPerl Graph adaptor for Bio::Ontology::SimpleGOEngine
#
# Please direct questions and support issues to <bioperl-l@bioperl.org>
# Please direct questions and support issues to <bioperl-l@bioperl.org>
#
# Cared for by Nat Goodman <natg at shore.net>
#
Expand Down Expand Up @@ -86,15 +86,15 @@ Bioperl mailing lists Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
=head2 Support
=head2 Support
Please direct usage questions or support issues to the mailing list:
I<bioperl-l@bioperl.org>
rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
with code and data examples if at all possible.
=head2 Reporting Bugs
Expand Down Expand Up @@ -131,7 +131,6 @@ package Bio::Ontology::SimpleGOEngine::GraphAdaptor;
use Graph::Directed;

use strict;
use Bio::Ontology::SimpleGOEngine::GraphAdaptor02;

use base qw(Bio::Root::Root);

Expand All @@ -140,8 +139,8 @@ use base qw(Bio::Root::Root);
Title : new
Usage : $graph = Bio::Ontology::SimpleGOEngine::GraphAdaptor->new()
Function: Creates a new graph
Returns : Bio::Ontology::SimpleGOEngine::GraphAdaptor02 or
Bio::Ontology::SimpleGOEngine::GraphAdaptor05 object,
Returns : Bio::Ontology::SimpleGOEngine::GraphAdaptor02 or
Bio::Ontology::SimpleGOEngine::GraphAdaptor05 object,
depending on which Graph version is available
Args : none
Expand All @@ -151,11 +150,8 @@ sub new {
my( $class ) = @_;
$class = ref $class || $class;

my $self=
( defined $Graph::VERSION && $Graph::VERSION >= 0.5 ) ?
bless ( {}, $class ) :
bless ( {}, 'Bio::Ontology::SimpleGOEngine::GraphAdaptor02' );
$self->{_graph}=new Graph::Directed;
my $self= bless( {}, $class );
$self->{_graph}=Graph::Directed->new();
$self->{_vertex_attributes}={};
$self->{_edge_attributes}={};
return $self;
Expand Down Expand Up @@ -194,7 +190,7 @@ sub edges_at {
sub predecessors {
my $self=shift;
$self->_graph->predecessors(@_);
}
}
sub successors {
my $self=shift;
$self->_graph->successors(@_);
Expand All @@ -207,7 +203,7 @@ sub sink_vertices {
my $self=shift;
$self->_graph->sink_vertices();
}
# The following methods workaround a performance problem in Graph v0.5x
# The following methods workaround a performance problem in Graph v0.5x
# when attributes are attached to the graph
sub set_vertex_attribute {
my($self,$v,$attribute,$value)=@_;
Expand All @@ -231,7 +227,7 @@ sub get_edge_attribute {
Title : _graph
Usage : $self->_graph();
Function: Internal method to access 'real' graph
Returns : Graph::Directed object
Returns : Graph::Directed object
Args : none
=cut
Expand All @@ -243,7 +239,7 @@ sub _graph {$_[0]->{_graph}; }
Title : _vertex_attributes
Usage : $self->vertex_attributes();
Function: Internal method to access HASH used to store vertex attributes
Returns : Graph::Directed object
Returns : Graph::Directed object
Args : none
=cut
Expand All @@ -255,7 +251,7 @@ sub _vertex_attributes {$_[0]->{_vertex_attributes}; }
Title : _edge_attributes
Usage : $self->edge_attributes();
Function: Internal method to access HASH used to store edge attributes
Returns : Graph::Directed object
Returns : Graph::Directed object
Args : none
=cut
Expand Down
2 changes: 1 addition & 1 deletion Build.PL
Expand Up @@ -76,7 +76,7 @@ my %recommends = (
'GD' => [0,
'Alignment graphic output/Bio::Align::Graphics'],

'Graph' => [0,
'Graph' => [0.50,
'Phylogenetic Networks, ontology engine implementation, contig analysis'.
'/Bio::PhyloNetwork,Bio::Ontology::SimpleGOEngine::GraphAdaptor,'.
'Bio::Assembly::Tools::ContigSpectrum'],
Expand Down

0 comments on commit 0930270

Please sign in to comment.