GO::Model::GraphIterator;
$it = $graph->create_iterator; # returns a GO::Model::GraphIterator object while (my $ni = $it->next_node_instance) { $depth = $ni->depth; $term = $ni->term; $reltype = $ni->parent_rel->type; printf "%s %8s Term = %s (%s) // depth=%d\n", "----" x $depth, $reltype, $term->name, $term->public_acc, $depth; }
GO::Model::Graph
GO::Model::GraphNodeInstance
Usage - $graphiter->order("breadth"); Returns - string Args - string
gets/sets traversal order; breadth or depth; default is depth
Usage - $graphiter->direction("up"); Returns - string Args - string
gets/sets direction; default is "down"
Usage - $graphiter->compact(1); Returns - bool Args - bool
set this if you dont want relationships to be traversed twice; this gives a more compact tree representation of the graph
Usage - $graphiter->reltype_filter(qw(is_a part_of)) Returns - array Args - array
by default, all relationship types are treated as transitive, and will be traversed by the iterator
sometimes you dont want to traverse all relations, even if they are transitive. For example, when answering the query "find all genes expressed in the embryo" you way want subtypes of embryo and parts of the embryo but not things that develop_from the embryo.
For more details, see http://sourceforge.net/mailarchive/forum.php?thread_id=9448679&forum_id=43082
Usage - Returns - Args -
Usage - Returns - GO::Model::Term Args -
Usage - Returns - GO::Model::GraphNodeInstance Args -
Careful, this sort function work on Term objects, not GraphNodeInstance objects. Comparison is done by the name of the term.
To install GO::Utils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GO::Utils
CPAN shell
perl -MCPAN -e shell install GO::Utils
For more information on module installation, please visit the detailed CPAN module installation guide.