.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "GO::Model::Graph 3pm" .TH GO::Model::Graph 3pm "2023-12-18" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" GO::Model::Graph \- a collection of relationships over terms .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 10 \& # FETCHING GRAPH FROM FILES \& use GO::Parser; \& my $parser = new GO::Parser({handler=>\*(Aqobj\*(Aq}); \& $parser\->parse("gene_ontology.obo"); # ontology \& $parser\->parse("gene\-associations.sgd"); # gene assocs \& # get L object \& my $graph = $parser\->handler\->graph; \& my $terms = $graph\->term_query("/transmembrane/"); # matching terms \& foreach my $term (@$terms) { \& # find gene products associated to this term \& my $assocs = $graph\->deep_association_list($term\->acc); \& printf "Term: %s %s\en", $term\->acc, $term\->name; \& print " Associations (direct and via transitive closure_\en"; \& foreach my $assoc (@$assocs) { \& next if $assoc\->is_not; \& printf " Assoc evidence: %s to: %s %s\en", \& join(\*(Aq;\*(Aq, map {$_\->code} @{$assoc\->evidence_list}), \& $assoc\->gene_product\->xref\->as_str, \& $assoc\->gene_product\->symbol; \& } \& } \& \& # \-\- alternatively, use this code... \-\- \& \& # FETCHING FROM DATABASE (requires go\-db\-perl library) \& # pretty\-printing a subgraph from "nuclear pore" \& $apph = GO::AppHandle\->connect(\-dbname=>"$dbname"); \& $term = $apph\->get_term({name=>"nuclear pore"}); \& $graph = \& $apph\->get_graph_by_terms([$term], $depth); \& \& $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) // number_of_association=%s // depth=%d\en", \& "\-\-\-\-" x $depth, \& $reltype, \& $term\->name, \& $term\->public_acc, \& $term\->n_associations || 0, \& $depth; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Object containing Nodes (GO::Model::Term objects) and relationships (: objects) .PP this may be either the whole ontology tree, or a subgraph, depending on how the object is instantiated. .SS "\s-1ONTOLOGY GRAPH MODEL\s0" .IX Subsection "ONTOLOGY GRAPH MODEL" relationships can be thought of as \fBstatements\fR or sentences of the form .PP .Vb 1 \& SUBJECT\-TERM PREDICATE OBJECT\-TERM .Ve .PP for example, .PP .Vb 1 \& "dog" IS_A "animal" \& \& "G\-Protein coupled receptor" IS_A "transmembrane receptor" .Ve .PP Statements have a \fBsubject\fR (i.e. the subject of the sentence/statement), a predicate/relationship\-type and an \fBobject\fR (i.e. the object of the sentence/statement) .PP Relationships can also be seen as arcs in a directed graph, with the subject being equivalent to the child, and the object equivalent to the parent. The arc is labeled with the predicate/relationship\-type. .PP perl doesn't handle bidirectional links between objects too well, so rather than having the relationship object know about the terms or the term know about the realtionships, all the graph info is in the Graph object .PP the Relationship object gives you the accessions of the related terms, use the Graph methods to fetch these actual terms. .PP The idea is to keep the Term & Relationship objects lightweight, and keep the Graph logic in the Graph object. The Graph object is responsible for stuff like making sure that a Term object is not instantiated twice if it can be reached by two different paths. .PP Currently all graphs are acyclic, cyclic graphs may be allowed in the future when such relationships are added to \s-1GO/OBOA\s0 .SS "\s-1TRANSITIVE CLOSURES\s0" .IX Subsection "TRANSITIVE CLOSURES" .Vb 2 \& graph object will calculate transitive closures for you \- that is it \&will follow the path in the graph to the root or to all leafs .Ve .SS "\s-1ITERATORS\s0" .IX Subsection "ITERATORS" Using the create_iterator and iterate methods, you can create \&\*(L"visitors\*(R" that will traverse the graph, performing actions along the way. Functional-style programming is encouraged, as the \fBiterature()\fR method allows for the passing of lexical closures: .PP .Vb 4 \& $graph\->iterate(sub {$term=shift\->term; \& printf "%s %s\en", $term\->acc,$term\->name}, \& {direction=>\*(Aqup\*(Aq, \& acc=>"GO:0008045"}) .Ve .SS "\s-1SEE ALSO\s0" .IX Subsection "SEE ALSO" go-perl GO::Model::Term GO::Parser GO::AppHandle .SS "new" .IX Subsection "new" .Vb 3 \& Usage \- $g = GO::Model::Graph\->new; \& Returns \- GO::Model::Graph; \& Args \- .Ve .PP Normally you would not create a graph object yourself \- this is typically done for you by either a GO::Parser object or a GO::AppHandle object .SS "create_iterator" .IX Subsection "create_iterator" .Vb 5 \& Usage \- $it = $graph\->create_iterator("GO:0003677") \& Usage \- $it = $graph\->create_iterator({acc=>"GO:0008045", \& direction=>"up"}); \& Returns \- GO::Model::GraphIterator; \& Args \- accession no [optional] or GO::Model::Term [optional] .Ve .PP makes a GO::Model::GraphIterator, an object which traverses the graph .SS "iterate" .IX Subsection "iterate" .Vb 4 \& Usage \- $graph\->iterate(sub {$ni=shift;printf "%s\en", $ni\->term\->name}); \& Usage \- sub mysub {...}; $graph\->iterate(\e&mysub); \& Returns \- \& Args \- CODE .Ve .PP iterates through the graph executing \s-1CODE\s0 on every GO::Model::GraphNodeInstance object .SS "term_filter" .IX Subsection "term_filter" .Vb 6 \& Alias \- node_filter \& Usage \- $terms = \& $graph\->term_filter(sub {shift\->term\->name =~ /transmembrane/}); \& Usage \- sub mysub {...}; $graph\->iterate(\e&mysub); \& Returns \- ref to an array of GO::Model::Term objects \& Args \- CODE .Ve .PP iterates through the graph executing \s-1CODE\s0 on every GO::Model::GraphNodeInstance object. If \s-1CODE\s0 returns true, that node will be returned .SS "term_query" .IX Subsection "term_query" .Vb 6 \& Usage \- $terms = $graph\->term_query({name=>\*(Aq/transmembrane/\*(Aq}); \& Usage \- $terms = $graph\->term_query({acc=>\*(AqGO:0008045\*(Aq}); \& Usage \- $terms = $graph\->term_query(\*(Aq/transmembrane/\*(Aq); \& Returns \- ref to an array of GO::Model::Term objects \& Args \- hashref of constraints \& OR name constraint as string .Ve .PP returns a set of terms matching query constraints. If the constraint value is enclosed in // a regexp match will be performed .PP constraints are ANDed. For more complex queries, use \fBnode_filter()\fR .SS "subgraph" .IX Subsection "subgraph" .Vb 3 \& Usage \- my $subgraph = $graph\->subgraph({acc=>"GO:0008045"}); \& Returns \- GO::Model::Graph \& Args \- as term_query() .Ve .PP creates a subgraph of the current graph containing the terms returned by a \fBterm_query()\fR call and all paths to the root .SS "subgraph_by_terms" .IX Subsection "subgraph_by_terms" .Vb 4 \& Usage \- my $subgraph = $graph\->subgraph_by_terms($terms); \& Usage \- my $subgraph = $graph\->subgraph_by_terms($terms,{partial=>1}); \& Returns \- GO::Model::Graph \& Args \- GO::Model::Term listref .Ve .PP creates a subgraph of the current graph containing the specified terms .PP The path-to-top will be calculated for all terms and added to the subgraph, \s-1UNLESS\s0 the partial option is set; in this case a relationship between .SS "get_all_nodes" .IX Subsection "get_all_nodes" .Vb 4 \& Usage \- my $node_listref = $graph\->get_all_nodes(); \& Synonyms\- get_all_terms \& Returns \- ref to an array of GO::Model::Term objects \& Args \- none .Ve .PP The returned array is \s-1UNORDERED\s0 .PP If you want the returned list ordered (eg breadth first or depth first) use the \fBcreate_iterator()\fR method to get a GO::Model::GraphIterator .PP See also GO::Model::Term .SS "get_term" .IX Subsection "get_term" .Vb 4 \& Usage \- my $term = $graph\->get_term($acc); \& Synonyms\- get_node \& Returns \- GO::Model::Term \& Args \- id \& \& returns a GO::Model::Term object for an accession no. \& the term must be in the Graph object .Ve .PP See also GO::Model::Term .SS "get_term_by_name" .IX Subsection "get_term_by_name" .Vb 3 \& Usage \- my $term = $graph\->get_term_by_name("blah"); \& Returns \- GO::Model::Term \& Args \- string \& \& returns a GO::Model::Term object for a name \& the term must be in the Graph object .Ve .PP \&\s-1CASE INSENSITIVE\s0 .PP See also GO::Model::Term .SS "get_terms_by_subset" .IX Subsection "get_terms_by_subset" .Vb 3 \& Usage \- my $term = $graph\->get_terms_by_subset("goslim_plant"); \& Returns \- GO::Model::Term \& Args \- string \& \& returns a GO::Model::Term object for a subset \& the term must be in the Graph object .Ve .PP \&\s-1CASE INSENSITIVE\s0 .PP See also GO::Model::Term .SS "get_top_nodes" .IX Subsection "get_top_nodes" .Vb 4 \& Usage \- my $node_listref = $graph\->get_top_nodes(); \& Synonyms\- get_top_terms \& Returns \- ref to an array of GO::Model::Term objects \& Args \- none .Ve .PP usually returns 1 node \- the root term .PP See also GO::Model::Term .SS "get_leaf_nodes" .IX Subsection "get_leaf_nodes" .Vb 4 \& Usage \- my $node_listref = $graph\->get_top_nodes(); \& Synonyms\- get_leaf_terms \& Returns \- ref to an array of GO::Model::Term objects \& Args \- none .Ve .PP See also GO::Model::Term .SS "is_leaf_node" .IX Subsection "is_leaf_node" .Vb 3 \& Usage \- if ($graph\->is_leaf_node($acc)) {...} \& Returns \- bool \& Args \- accession str .Ve .PP See also GO::Model::Term .SS "seed_nodes" .IX Subsection "seed_nodes" .Vb 3 \& Usage \- $nodes = $graph\->seed_nodes; \& Returns \- GO::Model::Term listref \& Args \- GO::Model::Term listref [optional] .Ve .PP gets/sets the \*(L"seed\*(R" nodes/terms \- these are the terms the Graph is started from, e.g. for building a node ancestory graph, the seed term would be the leaf of this graph, but not term that are expanded or collpased from the ancestory graph. .PP This is mostly relevant if you are fetching your graphs from a database via go-db-perl .PP See also GO::Model::Term .SS "focus_nodes" .IX Subsection "focus_nodes" .Vb 4 \& Usage \- $nodes = $graph\->focus_nodes; \& Synonyms\- focus_terms \& Returns \- GO::Model::Term listref \& Args \- GO::Model::Term listref [optional] .Ve .PP gets/sets the \*(L"focus\*(R" nodes/terms \- these are the terms the Graph is centred around; for instance, if the graph was built around a query to \&\*(L"endoplasmic*\*(R" all the terms matching this string would be focused .PP This is mostly relevant if you are fetching your graphs from a database via go-db-perl .PP See also GO::Model::Term .SS "is_focus_node" .IX Subsection "is_focus_node" .Vb 3 \& Usage \- if ($g\->is_focus_node($term)) {..} \& Returns \- bool \& Args \- GO::Model::Term .Ve .SS "add_focus_node" .IX Subsection "add_focus_node" .Vb 3 \& Usage \- $g\->add_focus_node($term) \& Returns \- \& Args \- GO::Model::Term .Ve .PP See also GO::Model::Term .SS "paths_to_top" .IX Subsection "paths_to_top" .Vb 3 \& Usage \- my $paths = $graph\->paths_to_top("GO:0005045"); \& Returns \- arrayref of GO::Model::Path objects \& Args \- .Ve .PP See also GO::Model::Path .SS "node_count" .IX Subsection "node_count" .Vb 4 \& Usage \- my $count = $g\->node_count \& Synonyms\- term_count \& Returns \- int \& Args \- .Ve .PP returns the number of terms/nodes in the graph .PP See also GO::Model::Term .SS "n_associations" .IX Subsection "n_associations" .Vb 3 \& Usage \- my $count = $g\->n_associations($acc); \& Returns \- int \& Args \- .Ve .PP if you parsed an association file into this graph, this will return the number of instances attached directly to acc .PP See also GO::Model::Association See also GO::Model::GeneProduct .SS "n_deep_associations" .IX Subsection "n_deep_associations" .Vb 3 \& Usage \- my $count = $g\->n_deep_associations($acc); \& Returns \- int \& Args \- .Ve .PP if you parsed an association file into this graph, this will return the number of instances attached directly to acc \s-1OR\s0 to a node subsumed by acc .PP See also GO::Model::Association See also GO::Model::GeneProduct .SS "n_children" .IX Subsection "n_children" .Vb 4 \& Usage \- $n = $graph\->n_children(\*(AqGO:0003677\*(Aq); \& Synonyms\- n_sterms, n_subj_terms, n_subject_terms \& Returns \- int \& Args \- .Ve .PP returns the number of \s-1DIRECT\s0 children/subject/subordinate terms beneath this one .SS "n_parents" .IX Subsection "n_parents" .Vb 4 \& Usage \- $n = $graph\->n_parents(3677); \& Synonyms\- n_oterms, n_obj_terms, n_object_terms \& Returns \- int \& Args \- .Ve .PP returns the number of \s-1DIRECT\s0 parent/object/superordinate terms above this one .SS "association_list" .IX Subsection "association_list" .Vb 3 \& Usage \- $assocs = $g\->association_list(\*(AqGO:0003677\*(Aq) \& Returns \- listref of GO::Model::Association \& Args \- acc (string) .Ve .PP returns a list of association objects \fBdirectly\fR attached to the specified term .PP See also GO::Model::Association .SS "get_direct_associations" .IX Subsection "get_direct_associations" .Vb 3 \& Usage \- \& Returns \- \& Args \- .Ve .PP See also GO::Model::Association .SS "deep_association_list" .IX Subsection "deep_association_list" .Vb 3 \& Usage \- $assocs = $g\->association_list(\*(AqGO:0003677\*(Aq) \& Returns \- listref of GO::Model::Association \& Args \- acc (string) .Ve .PP returns a list of association objects \fBdirectly and indirectly\fR attached to the specified term. (ie assocs attached to the term or to terms subsumed by the specified term). .PP See also GO::Model::Association .SS "product_list" .IX Subsection "product_list" .Vb 3 \& Usage \- $prods = $g\->product_list(\*(AqGO:0003677\*(Aq) \& Returns \- listref of GO::Model::GeneProduct \& Args \- acc (string) .Ve .PP returns a list of distinct gene product objects \fBdirectly\fR attached to the specified term. .PP See also GO::Model::GeneProduct .SS "deep_product_list" .IX Subsection "deep_product_list" .Vb 3 \& Usage \- $prods = $g\->deep_product_list(\*(AqGO:0003677\*(Aq) \& Returns \- listref of GO::Model::GeneProduct \& Args \- acc (string) .Ve .PP returns a list of distinct gene product objects \fBdirectly and indirectly\fR attached to the specified term. (ie assocs attached to the term or to terms subsumed by the specified term). .PP See also GO::Model::GeneProduct .SS "deep_product_count" .IX Subsection "deep_product_count" .Vb 3 \& Usage \- $n_prods = $g\->deep_product_count(\*(AqGO:0003677\*(Aq) \& Returns \- int \& Args \- acc (string) .Ve .PP returns a count of distinct gene product objects \fBdirectly and indirectly\fR attached to the specified term. performs transitive closure. will not count gene products twice .PP See also GO::Model::GeneProduct .SS "get_relationships" .IX Subsection "get_relationships" .Vb 3 \& Usage \- my $rel_listref = $graph\->get_relationships(\*(AqGO:0003677\*(Aq); \& Returns \- ref to an array of GO::Model::Relationship objects \& Args \- identifier/acc (string) .Ve .PP returns relationships which concern the specified term; the specified term can be the subject or object term in the relationship (ie child or parent) .PP See also GO::Model::Relationship .SS "get_parent_relationships" .IX Subsection "get_parent_relationships" .Vb 8 \& Usage \- my $rel_listref = $graph\->get_parent_relationships(\*(AqGO:0003677\*(Aq); \& Synonym \- get_relationships_by_child \& Synonym \- get_relationships_by_subj \& Synonym \- get_relationships_by_subject \& Synonym \- get_obj_relationships \& Synonym \- get_object_relationships \& Returns \- ref to an array of GO::Model::Relationship objects \& Args \- identifier/acc (string) .Ve .PP See also GO::Model::Relationship .SS "get_child_relationships" .IX Subsection "get_child_relationships" .Vb 8 \& Usage \- my $rel_listref = $graph\->get_child_relationships(\*(AqGO:0003677\*(Aq); \& Synonym \- get_relationships_by_parent \& Synonym \- get_relationships_by_obj \& Synonym \- get_relationships_by_object \& Synonym \- get_subj_relationships \& Synonym \- get_subject_relationships \& Returns \- ref to an array of GO::Model::Relationship objects \& Args \- identifier/acc (string) .Ve .PP See also GO::Model::Relationship .SS "get_all_relationships" .IX Subsection "get_all_relationships" .Vb 3 \& Usage \- \& Returns \- GO::Model::Relationship list \& Args \- .Ve .PP returns all the relationships/statements in this graph .PP See also GO::Model::Relationship .SS "get_parent_terms" .IX Subsection "get_parent_terms" .Vb 5 \& Usage \- my $term_lref = $graph\->get_parent_terms($parent_term\->acc); \& Synonym \- get_obj_terms \& Synonym \- get_object_terms \& Returns \- ref to array of GO::Model::Term objs \& Args \- the accession of the query term .Ve .PP See also GO::Model::Term .SS "get_parent_terms_by_type" .IX Subsection "get_parent_terms_by_type" .Vb 6 \& Usage \- \& Synonym \- get_obj_terms_by_type \& Synonym \- get_object_terms_by_type \& Returns \- ref to array of GO::Model::Term objs \& Args \- the accession of the query term \& \- the type by which to constrain relationships .Ve .PP See also GO::Model::Term .SS "get_recursive_parent_terms" .IX Subsection "get_recursive_parent_terms" .Vb 8 \& Title : get_recursive_parent_terms \& Usage : \& Synonyms: get_recursive_obj_terms \& Synonyms: get_recursive_object_terms \& Function: \& Example : \& Returns : \& Args : accession of query term .Ve .PP See also GO::Model::Term .SS "get_recursive_parent_terms_by_type" .IX Subsection "get_recursive_parent_terms_by_type" .Vb 8 \& Title : get_recursive_parent_terms_by_type \& Usage : \& Synonyms: get_recursive_obj_terms_by_type \& Synonyms: get_recursive_object_terms_by_type \& Function: \& Example : \& Returns : \& Args : .Ve .PP if type is blank, gets all .PP See also GO::Model::Term .SS "get_reflexive_parent_terms" .IX Subsection "get_reflexive_parent_terms" .Vb 6 \& Title : get_reflexive_parent_terms \& Usage : \& Function: \& Example : \& Returns : \& Args : acc .Ve .PP returns parent terms plus the term (for acc) itself .PP [reflexive transitive closure of relationships in upward direction] .PP See also GO::Model::Term .SS "get_reflexive_parent_terms_by_type" .IX Subsection "get_reflexive_parent_terms_by_type" .Vb 6 \& Title : get_reflexive_parent_terms_by_type \& Usage : \& Function: \& Example : \& Returns : listref of terms \& Args : acc, type .Ve .PP closure of relationship including the term itself .PP See also GO::Model::Term .SS "get_child_terms" .IX Subsection "get_child_terms" .Vb 5 \& Usage \- my $term_lref = $graph\->get_child_terms($parent_term\->acc); \& Synonym \- get_subj_terms \& Synonym \- get_subject_terms \& Returns \- ref to array of GO::Model::Term objs \& Args \- .Ve .PP See also GO::Model::Term .SS "get_child_terms_by_type" .IX Subsection "get_child_terms_by_type" .Vb 5 \& Synonym \- get_subj_terms_by_type \& Synonym \- get_subject_terms_by_type \& Returns \- ref to array of GO::Model::Term objs \& Args \- the accession of the query term \& \- the type by which to constrain relationships .Ve .PP See also GO::Model::Term .SS "get_recursive_child_terms" .IX Subsection "get_recursive_child_terms" .Vb 8 \& Title : get_recursive_child_terms \& Usage : \& Synonyms: get_recursive_subj_terms \& Synonyms: get_recursive_subject_terms \& Function: \& Example : \& Returns : a reference to an array of L objects \& Args : the accession of the query term .Ve .PP See also GO::Model::Term .SS "get_recursive_child_terms_by_type" .IX Subsection "get_recursive_child_terms_by_type" .Vb 8 \& Title : get_recursive_child_terms_by_type \& Usage : \& Synonyms: get_recursive_subj_terms_by_type \& Synonyms: get_recursive_subject_terms_by_type \& Function: \& Example : \& Returns : a reference to an array of L objects \& Args : accession, type .Ve .PP if type is blank, gets all .PP See also GO::Model::Term .SS "_get_recursive_related_terms_by_type" .IX Subsection "_get_recursive_related_terms_by_type" .Vb 6 \& Title : _get_recursive_related_terms_by_type \& Usage : \& Function: Obtain all relationships of the given kind and type for the \& term identified by its accession, and recursively repeat \& this with all parents and children as query for parent and \& child relationships, respectively. \& \& This is an internal method. \& Example : \& Returns : A reference to an array of L objects. \& Args : \- the kind of relationship, either "child" or "parent" \& \- the accession of the term with which to query \& \- the type to which to constrain relationships (optional, \& all types if left undef) \& \- TRUE if reflexive and FALSE otherwise (default FALSE) .Ve .PP See also GO::Model::Term .SS "_get_related_terms_by_type" .IX Subsection "_get_related_terms_by_type" .Vb 2 \& Usage \- my $term_lref = $graph\->_get_related_terms_by_type("child",$acc); \& Returns \- ref to array of GO::Model::Term objs \& \& Args \- the kind of relationship, either "child" or "parent" \& \- the accession of the term for which to obtain rel.ships \& \- the type by which to constrain relationships (optional, \& defaults to all terms if left undef) .Ve .PP This is an internal method. .SS "get_parent_accs_by_type" .IX Subsection "get_parent_accs_by_type" .Vb 3 \& Usage \- \& Returns \- \& Args \- acc, type .Ve .SS "get_reflexive_parent_accs_by_type" .IX Subsection "get_reflexive_parent_accs_by_type" .Vb 6 \& Title : get_reflexive_parent_accs_by_type \& Usage : \& Function: \& Example : \& Returns : listref of terms \& Args : acc, type .Ve .PP closure of relationship including the term itself .PP See also GO::Model::Term .SS "get_relationships_between_terms" .IX Subsection "get_relationships_between_terms" .Vb 6 \& Title : get_relationships_between_terms \& Usage : \& Function: \& Example : \& Returns : [] of relationships \& Args : parent id, child id .Ve .PP See also GO::Model::Relationship .SS "get_parent_closure_hash_by_type" .IX Subsection "get_parent_closure_hash_by_type" .Vb 7 \& Title : get_parent_closure_hash_by_type \& Usage : \& Function: given a term\-acc and relationship type, will give a hash that \& can be used to check if a term X is a parent of term Y \& Example : \& Returns : \& Args : .Ve .PP keys will be lower-cased .SS "add_child_relationship" .IX Subsection "add_child_relationship" See also GO::Model::Relationship .SS "add_parent_relationship" .IX Subsection "add_parent_relationship" .Vb 1 \& parent relationships are as valued as child relationships .Ve .PP See also GO::Model::Relationship .SS "close_below" .IX Subsection "close_below" .Vb 3 \& Usage \- $graph\->close_below(3677); \& Returns \- \& Args \- term (as acc or GO::Model::Term object) .Ve .PP gets rid of everything below a node .PP used by AmiGO for when a user closes a term in the graph .SS "find_roots" .IX Subsection "find_roots" .Vb 3 \& Usage \- my $terms = $graph\->find_roots; \& Returns \- arrayref of GO::Model::Term objects \& Args \- .Ve .PP All terms withOUT a parent .PP See also GO::Model::Term .SS "get_all_products" .IX Subsection "get_all_products" .Vb 3 \& Usage \- \& Returns \- \& Args \- .Ve .PP See also GO::Model::GeneProduct .SS "merge" .IX Subsection "merge" .Vb 3 \& Usage \- $g\->merge($g2); \& Returns \- \& Args \- GO::Model::Graph .Ve .PP merges two graphs .SS "export" .IX Subsection "export" .Vb 3 \& Usage \- $graph\->export({format=>$format}); \& Returns \- \& Args \- opt hash .Ve .PP writes out the graph in any export format, including obo, go_ont, owl, png (graphviz) etc .SS "to_xml" .IX Subsection "to_xml" .Vb 3 \& Usage \- \& Returns \- \& Args \- .Ve .SS "add_term" .IX Subsection "add_term" .Vb 3 \& Usage \- $g\->add_term($term) \& Returns \- \& Args \- GO::Model::Term .Ve .SS "add_node" .IX Subsection "add_node" .Vb 3 \& Usage \- \& Returns \- \& Args \- .Ve .PP synonym for add_term .SS "add_relationship" .IX Subsection "add_relationship" .Vb 5 \& Usage \- $graph\->add_relationship({acc1=>from_id, acc2=>to_id}); \& Usage \- $graph\->add_relationship($from_id, $to_id, $type}); \& Usage \- $graph\->add_relationship($obj, $subj, $type}); \& Returns \- \& Args \- .Ve .PP only one relationship between id1 and id2 is allowed .PP See also GO::Model::Relationship .SS "add_buckets" .IX Subsection "add_buckets" .Vb 3 \& Usage \- \& Returns \- \& Args \- .Ve .PP adds bucket terms to non-leaf nodes .PP this is useful for making \s-1GO\s0 slims .SS "to_text_output" .IX Subsection "to_text_output" .Vb 3 \& Usage \- \& Returns \- \& Args \- fmt, assocs [bool] .Ve .PP hacky text output .PP this method should probably move out of the model code into output adapters