.\" 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::Term 3pm" .TH GO::Model::Term 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::Term \- a term or concept in an ontology .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 7 \& # From a file \& use GO::Parser; \& my $parser = new GO::Parser({handler=>\*(Aqobj\*(Aq}); # create parser object \& $parser\->parse("gene_ontology.obo"); # parse file \-> objects \& my $graph = $parser\->handler\->graph; # get L object \& my $term = $graph\->get_term("GO:0001303"); # fetch a term by ID \& printf "Term %s %s\en", $term\->name, $term\->acc; \& \& # From a GO Database (requires go\-db\-perl) \& my apph = GO::AppHandle\->connect(\-dbname=>$dbname); \& my $term = $apph\->get_term({acc=>00003677}); \& printf "Term:%s (%s)\enDefinition:%s\enSynonyms:%s\en", \& $term\->name, \& $term\->public_acc, \& $term\->definition, \& join(", ", @{$term\->synonym_list}); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Represents an Ontology term; the same class is used for process, compartment and function .PP currently, a Term is not aware of its Relationships; to find out how a term is related to other terms, use the a GO::Model::Graph object, which will give you the GO::Model::Relationship objects; for example .PP .Vb 1 \& $rels = $graph\->get_parent_relationships($term\->acc); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" GO::Model::Relationship GO::Model::Graph GO::Model::Xref GO::Model::Association .SH "NOTES" .IX Header "NOTES" Like all the GO::Model::* classes, this uses accessor methods to get or set the attributes. by using the accessor method without any arguments gets the value of the attribute. if you pass in an argument, then the attribuet will be set according to that argument. .PP for single-valued attributes .PP .Vb 2 \& # this sets the value of the attribute \& $my_object\->attribute_name("my value"); \& \& # this gets the value of the attribute \& $my_value = $my_object\->attribute_name(); .Ve .PP for lists: .PP .Vb 2 \& # this sets the values of the attribute \& $my_object\->attribute_name(\e@my_values); \& \& # this gets the values of the attribute \& $my_values = $my_object\->attribute_name(); .Ve .SS "acc" .IX Subsection "acc" .Vb 4 \& Usage \- print $term\->acc() \& Alias \- public_acc \& Returns \- \& Args \- .Ve .PP accessor: gets/sets \s-1GO\s0 ID/accession [as an integer] .PP throws: exception if you try to pass in a non-integer .PP if you want to use IDs in the format GO:0000nnn, then use the method \&\fBpublic_acc()\fR .SS "name" .IX Subsection "name" .Vb 3 \& Usage \- print $term\->name; \& Returns \- \& Args \- .Ve .PP accessor: gets/sets \*(L"name\*(R" attribute .SS "subset_list" .IX Subsection "subset_list" .Vb 3 \& Usage \- foreach (@{$term\->subset_list || []}) { printf " $_\en" } \& Returns \- list of strings \& Args \- list of strings [optional] .Ve .PP List of subset Accs for a term .PP Subsets are also known as \s-1GO\s0 Slims .SS "in_subset" .IX Subsection "in_subset" .Vb 3 \& Usage \- if ($term\->in_subset(\*(Aqgoslim_prok\*(Aq); \& Returns \- bool \& Args \- subset\-name str .Ve .PP Tests if the term belongs to a subset .SS "definition" .IX Subsection "definition" .Vb 3 \& Usage \- print $term\->definition; \& Returns \- \& Args \- .Ve .PP accessor: gets/sets \*(L"definition\*(R" attribute .SS "primary_xref" .IX Subsection "primary_xref" .Vb 6 \& Title : primary_xref \& Usage : \& Function: \& Example : \& Returns : GO::Model::Xref \& Args : .Ve .PP The same as \fBacc()\fR, except the \s-1ID\s0 is returned as a GO::Model::Xref rather than a string .SS "comment" .IX Subsection "comment" .Vb 6 \& Title : comment \& Usage : $obj\->comment($newval) \& Function: \& Example : \& Returns : value of comment (a scalar) \& Args : on set, new value (a scalar or undef, optional) .Ve .SS "definition_dbxref_list" .IX Subsection "definition_dbxref_list" .Vb 6 \& Title : definition_dbxref_list \& Usage : $obj\->definition_dbxref(\e@xrefs) \& Function: \& Example : \& Returns : definition_dbxref_list hashlist (of GO::Model::Xref) \& Args : on set, new values (GO::Model::Xref hashlist) .Ve .PP GO::Model::Xref .SS "add_definition_dbxref" .IX Subsection "add_definition_dbxref" .Vb 2 \& \- Usage : $term\->add_definition_dbxref($xref); \& \- Args : GO::Term::Xref .Ve .PP GO::Model::Xref .SS "has_synonym" .IX Subsection "has_synonym" .Vb 3 \& Usage \- if ($term\->has_synonym("autotrophy") {...} \& Returns \- bool \& Args \- string .Ve .SS "add_synonym" .IX Subsection "add_synonym" .Vb 4 \& Usage \- $term\->add_synonym("calcineurin"); \& Usage \- $term\->add_synonym(@synonym_strings); \& Returns \- \& Args \- .Ve .PP Adds a synonym; loses type information (the synonym type in blank) .SS "synonym_list" .IX Subsection "synonym_list" .Vb 4 \& Usage \- my $syn_l = $term\->synonym_list; \& Usage \- $term\->synonym_list([$syn1, $syn2]); \& Returns \- arrayref \& Args \- arrayref [optional] .Ve .PP accessor: gets/set list of synonyms [array reference] .PP each synonym is represented as a string \- this method loses synonym typing information. If used as a setter, will set the type for each synonym to null .SS "add_synonym_by_type" .IX Subsection "add_synonym_by_type" .Vb 3 \& Usage \- $term\->add_synonym_by_type(\*(Aqexact\*(Aq, $syn); \& Returns \- \& Args \- .Ve .SS "synonyms_by_type" .IX Subsection "synonyms_by_type" .Vb 4 \& Usage \- $synstrs = $term\->synonyms_by_type(\*(Aqexact\*(Aq); \& Usage \- $term\->synonyms_by_type(\*(Aqexact\*(Aq, \e@exact_syns); \& Returns \- arrayref of strings \& Args \- type string, arrayref of strings [optional] .Ve .PP in getter mode, gets a list of synonyms of a particular type .PP in setter mode, sets a list of synonyms for a particular type .SS "alt_id_list" .IX Subsection "alt_id_list" .Vb 4 \& Usage \- my $syn_l = $term\->alt_id_list; \& Usage \- $term\->alt_id_list([$syn1, $syn2]); \& Returns \- arrayref \& Args \- arrayref [optional] .Ve .PP accessor: gets/set list of synonyms [array reference] .SS "add_alt_id" .IX Subsection "add_alt_id" .Vb 3 \& Usage \- $term\->add_alt_id(\*(AqGO:0000001\*(Aq); \& Returns \- \& Args \- id string, or list of id strings .Ve .SS "namespace (\s-1INHERITED\s0)" .IX Subsection "namespace (INHERITED)" .Vb 8 \& Usage \- print $term\->namespace(); # getting the type \& Usage \- $term\->namespace("molecular_function"); # setting the type \& Alias \- type \& Alias \- term_type \& Alias \- category \& Alias \- ontology \& Returns \- string representing type \& Args \- string represnting type [optional] .Ve .PP The \s-1OBO\s0 namespace for the GO::Model::Term or GO::Model::Relationship .PP This method is inherited from the superclass .SS "set_namespace_by_code" .IX Subsection "set_namespace_by_code" .Vb 3 \& Usage \- $term\->set_namespace_by_code("P"); \& Returns \- \& Args \- String: M, P or C .Ve .PP Currently the mapping is hardcoded .PP .Vb 3 \& (\*(AqF\*(Aq=>\*(Aqmolecular_function\*(Aq, \& \*(AqP\*(Aq=>\*(Aqbiological_process\*(Aq, \& \*(AqC\*(Aq=>\*(Aqcellular_component\*(Aq); .Ve .SS "get_code_from_namespace" .IX Subsection "get_code_from_namespace" .Vb 3 \& Usage \- $code = $term\->get_code_from_namespace; \& Returns \- String: M, P or F \& Args \- String (if omitted will use current namespace) .Ve .PP Returns the code for the current namespace (or any given namespace if supplied) .SS "add_dbxref" .IX Subsection "add_dbxref" .Vb 2 \& \- Usage : $term\->add_dbxref($xref); \& \- Args : GO::Term::Xref .Ve .PP GO::Model::Xref .SS "dbxref_list" .IX Subsection "dbxref_list" .Vb 3 \& \- Usage : $term\->dbxref_list($xref); \& \- Args : optional listref of GO::Term::Xref \& \- Returns : listref of GO::Term::Xref .Ve .PP accessor: gets/sets list of dbxref [array reference] .SS "is_obsolete" .IX Subsection "is_obsolete" accessor: gets/set obsolete flag [boolean .SS "is_root" .IX Subsection "is_root" accessor: gets/set is_root flag [boolean] .SH "TERM ASSOCIATION METHODS" .IX Header "TERM ASSOCIATION METHODS" .SS "association_list" .IX Subsection "association_list" .Vb 3 \& Usage \- $assoc_l = $term\->association_list \& Returns \- arrayref of GO::Model::Association \& Args \- arrayref of GO::Model::Association [optional] .Ve .PP accessor: gets/set list of associations [array reference] .PP if this is undefined, the datasource will be queried for the associations .SS "selected_association_list" .IX Subsection "selected_association_list" .Vb 3 \& Usage \- $assoc_l = $term\->selected_association_list \& Returns \- arrayref of GO::Model::Association \& Args \- arrayref of GO::Model::Association [optional] .Ve .PP accessor: gets list of \s-1SELECTED\s0 associations [array reference] .PP [this method is only of use if you are using it in conjunction with GO::AppHandle in the go-db-perl distro] .PP this in not the total list of all associations associated with a term; if the term was created via a query on products, this will include those associations .PP GO::Model::Association .SS "add_association" .IX Subsection "add_association" .Vb 3 \& Usage \- $term\->add_association($assoc); \& Returns \- \& Args \- GO::Model::Association .Ve .PP GO::Model::Association .SS "add_selected_association" .IX Subsection "add_selected_association" .Vb 3 \& Usage \- \& Returns \- \& Args \- .Ve .PP GO::Model::Association .SS "association_hash" .IX Subsection "association_hash" returns associations as listref of unique GeneProduct objects .PP GO::Model::Association .SS "get_all_associations" .IX Subsection "get_all_associations" .Vb 3 \& Usage \- my $al = $term\->get_all_associations \& Returns \- GO::Model::Association list \& Args \- .Ve .PP returns all associations for the term and the terms beneath it in the \s-1GO DAG\s0 .PP same as \f(CW$apph\fR\->get_all_associations($term) .PP GO::Model::Association .SS "n_associations" .IX Subsection "n_associations" .Vb 3 \& Usage \- my $n = $term\->n_associations \& Returns \- \& Args \- .Ve .SS "product_list" .IX Subsection "product_list" .Vb 3 \& Usage \- $prods = $term\->product_list \& Returns \- L listref \& Args \- .Ve .PP Returns a reference to an array of gene products that are attached directly to this term. .PP (if the products have not been fetched, this method will call \&\f(CW$term\fR\->association_list, cache the results, and use the associations to build the product list. succeeding calls of product_list to this term will hence be faster) .PP See GO::Model::GeneProduct .SS "deep_product_list" .IX Subsection "deep_product_list" .Vb 3 \& Usage \- \& Returns \- GO::Model::GeneProduct listref \& Args \- .Ve .PP finds all products attached to this term and all terms below in the graph .PP GO::Model::GeneProduct .SS "n_deep_products" .IX Subsection "n_deep_products" .Vb 3 \& Usage \- my $count = $term\->n_deep_products; \& Returns \- int \& Args \- filter (hashref) \- or string "recount" .Ve .PP gets the count for the *dsitinct* number of GO::Model::GeneProduct entries annotated at \s-1OR BELOW\s0 this level. if you have set the filters in GO::AppHandle then these filters will be used in determining the count. .PP Remember, if you did not explicitly set the filters, then the default filter will be used, which is [!IEA] (i.e. curated associations only, see www.geneontology.org for a discussion of evidence codes). .PP Note: currently only the speciesdb filter is respected. It turns out to be very expensive to do the set arithmetic for distinct recursive gene counts with different evidence combinations. Because each product belongs to one speciesdb only, the speciesdb counts are mutually exclusive, which makes this easier. .PP .Vb 6 \& # get the number of gene products that have been annotated \& # as transcription factors in worm and fly discounting \& # uncurated automatic annotations \& $apph\->filters({evcodes=>["!IEA"], speciesdbs=>["SGD", "FB"]}); \& $term = $apph\->get_term({name=>"transcription factor"}); \& print $term\->n_deep_products; .Ve .PP The count will be cached, so if you alter the filter parameters be sure to get a recount like this: .PP .Vb 1 \& my $count = $term\->n_deep_products("recount"); .Ve .PP \&\s-1TODO:\s0 make the recount automatic if the filter is changed .PP \&\s-1PERFORMANCE NOTE 1:\s0 When you ask the AppHandle to give you a list of GO::Model::Term objects, it may decide to populate this attribute when building the terms in a fast and efficient way. Therefore you should avoid setting the filters *after* you have created the objects otherwise it will have to refetch all these values slowing things down. .PP \&\s-1PERFORMANCE NOTE 2:\s0 If you are using the \s-1SQL\s0 GO::AppHandle implementation, then this call will probably involve a query to the *gene_produc_count* table. If you populated the database you are using yourself, make sure this table is filled otherwise this will be an expensive query. .PP GO::Model::GeneProduct .SS "n_products" .IX Subsection "n_products" .Vb 3 \& Usage \- as n_deep_products \& Returns \- \& Args \- .Ve .PP see docs for n_deep_products .PP gets a count of products \s-1AT THIS LEVEL ONLY\s0 .PP GO::Model::GeneProduct .SS "loadtime" .IX Subsection "loadtime" .Vb 6 \& Title : loadtime \& Usage : \& Function: \& Example : \& Returns : time term was loaded into datasource \& Args : none .Ve