Bio::Graph::SimpleGraph::Traversal - graph traversal operations for Bio::Graph::SimpleGraph and Bio::Graph::Protein::Graph objects
use Bio::Graph::SimpleGraph::Traversal;use Bio::Graph::SimpleGraph;
## get a graph , $g.
my $traversal = Bio::Graph::SimpleGraph::Traversal->new(-graph=>$g,-start=>$start,-order=>$order,-what =>$what);## cycle through nodes one at a timewhile ($traversal->has_next() ) {my $node = $traversal->get_next();}## reset traversal to start$traversal->reset;
## get all nodesmy @all_nodes = $traversal->get_all();
This is a helper class for performing graph traversal operations for Bio::Graph::SimpleGraph objects and Bio::Graph::Protein::Graph objects. The documentation concerning the use of this class is described in the "Graph algorithms" section of the Bio::Graph::SimpleGraph modules. Only the methods are documented here.
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Reporting Bugs 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:
http://bugzilla.open-bio.org/
Email [email protected], [email protected]
has_next
name : has_nextusage : while (my $traversal->has_next() ) {..purpose : returns true if there are more items in traversal, else undefarguments : nonereturns : true or unde;
get_next
name : get_nextusage : my $node = $traversal->get_next() ;purpose : returns next item in traversal or undef if traversal is exhausted.arguments : nonereturns : a node or undef;
get_all
name : get_allusage : my @nodes = $traversal->get_all() ;purpose : get all remaining items in traversal as ARRAY (in array context)or ARRAY ref.arguments : nonereturns : an array, an array reference or undef.
get_this
name : get_allusage : my @nodes = $traversal->get_all() ;purpose : gets current node in traversalarguments : nonereturns : the current node or undef.
reset
name : resetusage : $traversal->reset() ;purpose : restarts traversal from first nodearguments : nonereturns : void.