Bio::Ontology::SimpleGOEngine GraphAdaptor
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::Ontology::SimpleGOEngine::GraphAdaptor - Graph adaptor for
Bio::Ontology::SimpleGOEngine
Package variables
No package variables defined.
Included modules
Graph::Directed
Inherit
Bio::Root::Root
Synopsis
  use Bio::Ontology::SimpleGOEngine::GraphAdaptor;
my $graph = Bio::Ontology::SimpleGOEngine::GraphAdaptor;
Description
This is an adaptor to simplify use of versions of the standard CPAN Graph module
(old is versions 0.2x; new is 0.5x and beyond) within
Bio::Ontology::SimpleGOEngine. Prior versions of this module supported Graph
version older than 0.5, however we are removing support for these older version
post BioPerl 1.6.901. If you absolutely require an old version of Graph, please
use an older version of BioPerl.
This module implements only those Graph methods used by SimpleGOEngine. It is
far from a complete compatibility layer! It also implements workarounds for
certain performance problems in the current versions of Graph v0.5x.
This class provides implementations for the required graph methods using the new
version of Graph. In most cases, these are simple pass-throughs
The methods implemented here or in the subclasses are listed below.
In all cases, we implemented the Graph v0.5x interface. Consult the
Graph v0.5x man page for details.
  add_vertex
has_vertex
add_edge
has_edge
vertices
edges
edges_at
predecessors
successors
set_vertex_attribute
get_vertex_attribute
set_edge_attribute
get_edge_attribute
source_vertices
sink_vertices
Methods
newDescriptionCode
add_vertex
No description
Code
has_vertex
No description
Code
add_edge
No description
Code
has_edge
No description
Code
vertices
No description
Code
edges
No description
Code
edges_at
No description
Code
predecessors
No description
Code
successors
No description
Code
source_vertices
No description
Code
sink_vertices
No description
Code
set_vertex_attribute
No description
Code
get_vertex_attribute
No description
Code
set_edge_attribute
No description
Code
get_edge_attribute
No description
Code
_graphDescriptionCode
_vertex_attributesDescriptionCode
_edge_attributesDescriptionCode
_vertex2attributesDescriptionCode
_edge2attributesDescriptionCode
Methods description
newcode    nextTop
 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,
depending on which Graph version is available
Args : none
_graphcodeprevnextTop
 Title   : _graph
Usage : $self->_graph();
Function: Internal method to access 'real' graph
Returns : Graph::Directed object
Args : none
_vertex_attributescodeprevnextTop
 Title   : _vertex_attributes
Usage : $self->vertex_attributes();
Function: Internal method to access HASH used to store vertex attributes
Returns : Graph::Directed object
Args : none
_edge_attributescodeprevnextTop
 Title   : _edge_attributes
Usage : $self->edge_attributes();
Function: Internal method to access HASH used to store edge attributes
Returns : Graph::Directed object
Args : none
_vertex2attributescodeprevnextTop
 Title   : _vertex2attributes
Usage : $value=$graph->_vertex2attributes($v_->{ATTRIBUTE};
$graph->_vertex2attributes($v)->{ATTRIBUTE}=$value;
Function: Internal method to access attributes for a specific vertex
Returns : HASH
Args : none
_edge2attributescodeprevnextTop
 Title   : _edge2attributes
Usage : $value=$graph->_edge2attributes($u,$v)->{ATTRIBUTE};
$graph->_edge2attributes($u,$v)->{ATTRIBUTE}=$value;
Function: Internal method to access HASH used to store edge attributes
Returns : HASH
Args : none
Methods code
newdescriptionprevnextTop
sub new {
  my( $class ) = @_;
  $class = ref $class || $class;

  my $self= bless( {}, $class );
  $self->{_graph}=Graph::Directed->new();
  $self->{_vertex_attributes}={};
  $self->{_edge_attributes}={};
  return $self;
}

# Here are the main methods
}
add_vertexdescriptionprevnextTop
sub add_vertex {
  my $self=shift;
  $self->_graph->add_vertex(@_);
}
has_vertexdescriptionprevnextTop
sub has_vertex {
  my $self=shift;
  $self->_graph->has_vertex(@_);
}
add_edgedescriptionprevnextTop
sub add_edge {
  my $self=shift;
  $self->_graph->add_edge(@_);
}
has_edgedescriptionprevnextTop
sub has_edge {
  my $self=shift;
  $self->_graph->has_edge(@_);
}
verticesdescriptionprevnextTop
sub vertices {
  my $self=shift;
  $self->_graph->vertices(@_);
}
edgesdescriptionprevnextTop
sub edges {
  my $self=shift;
  $self->_graph->edges(@_);
}
edges_atdescriptionprevnextTop
sub edges_at {
  my $self=shift;
  $self->_graph->edges_at(@_);
}
predecessorsdescriptionprevnextTop
sub predecessors {
  my $self=shift;
  $self->_graph->predecessors(@_);
}
successorsdescriptionprevnextTop
sub successors {
  my $self=shift;
  $self->_graph->successors(@_);
}
source_verticesdescriptionprevnextTop
sub source_vertices {
  my $self=shift;
  $self->_graph->source_vertices();
}
sink_verticesdescriptionprevnextTop
sub sink_vertices {
  my $self=shift;
  $self->_graph->sink_vertices();
}
# The following methods workaround a performance problem in Graph v0.5x
# when attributes are attached to the graph
}
set_vertex_attributedescriptionprevnextTop
sub set_vertex_attribute {
  my($self,$v,$attribute,$value)=@_;
  $self->_vertex2attributes($v)->{$attribute}=$value;
}
get_vertex_attributedescriptionprevnextTop
sub get_vertex_attribute {
  my($self,$v,$attribute)=@_;
  $self->_vertex2attributes($v)->{$attribute};
}
set_edge_attributedescriptionprevnextTop
sub set_edge_attribute {
  my($self,$u,$v,$attribute,$value)=@_;
  $self->_edge2attributes($u,$v)->{$attribute}=$value;
}
get_edge_attributedescriptionprevnextTop
sub get_edge_attribute {
  my($self,$u,$v,$attribute)=@_;
  $self->_edge2attributes($u,$v)->{$attribute};
}
_graphdescriptionprevnextTop
sub _graph {
$_[0]->{_graph};
}
_vertex_attributesdescriptionprevnextTop
sub _vertex_attributes {
$_[0]->{_vertex_attributes};
}
_edge_attributesdescriptionprevnextTop
sub _edge_attributes {
$_[0]->{_edge_attributes};
}
_vertex2attributesdescriptionprevnextTop
sub _vertex2attributes {
  my($self,$vertex)=@_;
  $self->_vertex_attributes->{$vertex} or $self->_vertex_attributes->{$vertex}={};
}
_edge2attributesdescriptionprevnextTop
sub _edge2attributes {
  my($self,$u,$v)=@_;
  $self->_edge_attributes->{$u,$v} or $self->_edge_attributes->{$u,$v}={};
}

1;
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to the
Bioperl mailing lists Your participation is much appreciated.
  bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
SupportTop
Please direct usage questions or support issues to the mailing list:
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
with code and data examples if at all possible.
Reporting BugsTop
report bugs to the Bioperl bug tracking system to help us keep track
the bugs and their resolution. Bug reports can be submitted via the
web:
  https://redmine.open-bio.org/projects/bioperl/
AUTHORTop
Nat Goodman
Email: natg at shore.net
Address:
  Institute for Systems Biology
1441 N 34th St
Seattle, WA 98103-8904
APPENDIXTop
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _