GO::Mo...erator(3pm)
π NAME π
okay so bestie, welcome to GO::Model::GraphIterator β literally just Graph iterator. that's the whole name. it's a Perl module hanging out in the User Contributed Perl Documentation corner of section 3pm, and it's here to walk your graph for you π
β¨ SYNOPSIS β¨
here's the vibe, copy-paste ready, no cap:
$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;
}
likeβ¦ you spin up an iterator off your graph, then loop while next_node_instance keeps handing you stuff, and print a cute little indented tree. iconic behavior honestly π
πΈ DESCRIPTION πΈ
bestie. not gonna lie to you. this section is empty in the original. there is literally nothing here. no notes, no lore, no plot. we move. π¦
π¦ SEE ALSO π¦
the family members, the entourage, the mutuals:
GO::Model::GraphGO::Model::GraphNodeInstance
π order
- Usage β
$graphiter->order("breadth"); - Returns β string
- Args β string
gets/sets the traversal order. your two options are breadth or depth. default is depth, always.
π§ direction
- Usage β
$graphiter->direction("up"); - Returns β string
- Args β string
gets/sets the direction. default is "down". you can go "up" instead if that's the energy you're on today β¨
π compact
- Usage β
$graphiter->compact(1); - Returns β bool
- Args β bool
set this if you do not want relationships to get traversed twice. the payoff? a more compact tree representation of the graph. less walking in circles, more slay π
πΈ reltype_filter
- Usage β
$graphiter->reltype_filter(qw(is_a part_of)) - Returns β array
- Args β array
so by default, every relationship type counts as transitive and the iterator will traverse all of them. periodt.
but sometimes you don't want to traverse all relations, even if they are transitive. for example, when you're 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. so you filter, and you filter smart π
for more details, see <http://sourceforge.net/mailarchive/forum.php?thread_id=9448679&forum_id=43082>
π reset_cursor
- Usage β
- - Returns β
- - Args β
-
π next_node
- Usage β
- - Returns β
GO::Model::Term - Args β
-
π next_node_instance
- Usage β
- - Returns β
GO::Model::GraphNodeInstance - Args β
-
β flatten
- Usage β
- - Returns β
- - Args β
-
π _sortby_pos_in_list
okay bestie, listen carefully, this is the important one:
Careful β this sort function works onTermobjects, notGraphNodeInstanceobjects. comparison is done by the name of the term.
that's the whole tea. don't mix them up, i'm begging π
that's the whole page, bestie β every flag, every default, every method, all of it. this came to you courtesy of perl v5.36.0, dated 2023-12-18, and documented under GO::Mo...erator(3pm) π«Ά go forth and iterate, you absolute icon πβ¨
π¦ where this page comes from
- debian trixie: libgo-perl 0.15-10 Β· Perl
- ubuntu noble: libgo-perl 0.15-10 Β· Perl
- ubuntu resolute: libgo-perl 0.15-10 Β· Perl
- ubuntu stonking: libgo-perl 0.15-10 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms