Bio::Graph::SimpleGraph::Traversal.3pm

Langue: en

Autres versions - même langue

Version: 2008-06-24 (ubuntu - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Bio::Graph::SimpleGraph::Traversal - graph traversal operations for Bio::Graph::SimpleGraph and Bio::Graph::Protein::Graph objects

SYNOPSIS

   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 time
  while ($traversal->has_next() ) {
         my $node = $traversal->get_next();
       }
  ## reset traversal to start
   $traversal->reset;
 
  ## get all nodes
   my @all_nodes = $traversal->get_all();
 
 

DESCRIPTION

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.

FEEDBACK


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.

   bioperl-l@bioperl.org                  - General discussion
   http://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/
 
 

AUTHOR - Nat Goodman, Richard Adams

Email natg@shore.net, richard.adams@ed.ac.uk

has_next

  name      : has_next
  usage     : while (my $traversal->has_next() ) {..
  purpose   : returns true if there are more items in traversal, else undef
  arguments : none
  returns   : true or unde;
 
 

get_next

  name      : get_next
  usage     : my $node =  $traversal->get_next() ;
  purpose   : returns  next item in traversal or undef if traversal is exhausted. 
  arguments : none
  returns   : a node  or undef;
 
 

get_all

  name      : get_all
  usage     : my @nodes =  $traversal->get_all() ;
  purpose   : get all remaining items in traversal as ARRAY (in array context)
               or ARRAY ref.
  arguments : none
  returns   : an array, an array reference or undef.
 
 

get_this

  name      : get_all
  usage     : my @nodes =  $traversal->get_all() ;
  purpose   : gets current node in traversal 
  arguments : none
  returns   : the current node or undef.
 
 

reset

  name      : reset
  usage     : $traversal->reset() ;
  purpose   : restarts traversal from first node
  arguments : none
  returns   : void.