.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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 "Bio::Ontology::SimpleOntologyEngine 3pm" .TH Bio::Ontology::SimpleOntologyEngine 3pm "2020-10-28" "perl v5.30.3" "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" Bio::Ontology::SimpleOntologyEngine \- Implementation of OntologyEngineI interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $soe = Bio::Ontology::SimpleOntologyEngine\->new; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a \*(L"simple\*(R" implementation of Bio::Ontology::OntologyEngineI. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR \- Peter Dimitrov" .IX Header "AUTHOR - Peter Dimitrov" Email dimitrov@gnf.org .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Hilmar Lapp, hlapp at gmx.net .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "new" .IX Subsection "new" .Vb 6 \& Title : new \& Usage : $soe = Bio::Ontology::SimpleOntologyEngine\->new; \& Function: Initializes the ontology engine. \& Example : $soe = Bio::Ontology::SimpleOntologyEngine\->new; \& Returns : Object of class SimpleOntologyEngine. \& Args : .Ve .SS "_instantiated_terms_store" .IX Subsection "_instantiated_terms_store" .Vb 6 \& Title : _instantiated_terms_store \& Usage : $obj\->_instantiated_terms_store($newval) \& Function: \& Example : \& Returns : hash \& Args : empty hash .Ve .SS "mark_instantiated" .IX Subsection "mark_instantiated" .Vb 10 \& Title : mark_instantiated \& Usage : $self\->mark_instantiated(TermI terms): TermI \& Function: Marks TermI objects as fully instantiated, \& allowing for proper counting of the number of terms in the term store. \& The TermI objects has to be already stored in the term store in order \& to be marked. \& Example : $self\->mark_instantiated($term); \& Returns : its argument or throws an exception if a term is not \& in the term store. \& Args : array of objects of class TermI. .Ve .SS "mark_uninstantiated" .IX Subsection "mark_uninstantiated" .Vb 7 \& Title : mark_uninstantiated \& Usage : $self\->mark_uninstantiated(TermI terms): TermI \& Function: Marks TermI objects as not fully instantiated, \& Example : $self\->mark_uninstantiated($term); \& Returns : its argument or throws an exception if a term is not \& in the term store(if the term is not marked it does nothing). \& Args : array of objects of class TermI. .Ve .SS "_term_store" .IX Subsection "_term_store" .Vb 6 \& Title : term_store \& Usage : $obj\->_term_store($newval) \& Function: \& Example : \& Returns : reference to an array of Bio::Ontology::TermI objects \& Args : reference to an array of Bio::Ontology::TermI objects .Ve .SS "add_term" .IX Subsection "add_term" .Vb 7 \& Title : add_term \& Usage : add_term(TermI term): TermI \& Function: Adds TermI object to the ontology engine term store. \& Marks the term fully instantiated by default. \& Example : $soe\->add_term($term) \& Returns : its argument. \& Args : object of class TermI. .Ve .SS "get_term_by_identifier" .IX Subsection "get_term_by_identifier" .Vb 7 \& Title : get_term_by_identifier \& Usage : get_term_by_identifier(String id): TermI \& Function: Retrieves terms from the term store by their identifier \& field, or an empty list if not there. \& Example : $term = $soe\->get_term_by_identifier("IPR000001"); \& Returns : An array of zero or more Bio::Ontology::TermI objects. \& Args : An array of identifier strings .Ve .SS "_get_number_rels" .IX Subsection "_get_number_rels" .Vb 6 \& Title : get_number_rels \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "_get_number_terms" .IX Subsection "_get_number_terms" .Vb 6 \& Title : _get_number_terms \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "_relationship_store" .IX Subsection "_relationship_store" .Vb 6 \& Title : _storerelationship_store \& Usage : $obj\->relationship_store($newval) \& Function: \& Example : \& Returns : reference to an array of Bio::Ontology::TermI objects \& Args : reference to an array of Bio::Ontology::TermI objects .Ve .SS "_inverted_relationship_store" .IX Subsection "_inverted_relationship_store" .Vb 6 \& Title : _inverted_relationship_store \& Usage : \& Function: \& Example : \& Returns : reference to an array of Bio::Ontology::TermI objects \& Args : reference to an array of Bio::Ontology::TermI objects .Ve .SS "_relationship_type_store" .IX Subsection "_relationship_type_store" .Vb 6 \& Title : _relationship_type_store \& Usage : $obj\->_relationship_type_store($newval) \& Function: \& Example : \& Returns : reference to an array of Bio::Ontology::RelationshipType objects \& Args : reference to an array of Bio::Ontology::RelationshipType objects .Ve .SS "_add_relationship_simple" .IX Subsection "_add_relationship_simple" .Vb 6 \& Title : _add_relationship_simple \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "add_relationship" .IX Subsection "add_relationship" .Vb 6 \& Title : add_relationship \& Usage : add_relationship(RelationshipI relationship): RelationshipI \& Function: Adds a relationship object to the ontology engine. \& Example : \& Returns : Its argument. \& Args : A RelationshipI object. .Ve .SS "get_relationships" .IX Subsection "get_relationships" .Vb 6 \& Title : get_relationships \& Usage : get_relationships(): RelationshipI \& Function: Retrieves all relationship objects. \& Example : \& Returns : Array of RelationshipI objects \& Args : .Ve .SS "get_all_relationships" .IX Subsection "get_all_relationships" .Vb 6 \& Title : get_all_relationships \& Usage : get_all_relationships(): RelationshipI \& Function: Retrieves all relationship objects. \& Example : \& Returns : Array of RelationshipI objects \& Args : .Ve .SS "get_predicate_terms" .IX Subsection "get_predicate_terms" .Vb 6 \& Title : get_predicate_terms \& Usage : get_predicate_terms(): TermI \& Function: Retrieves all relationship types stored in the engine \& Example : \& Returns : reference to an array of Bio::Ontology::RelationshipType objects \& Args : .Ve .SS "_is_rel_type" .IX Subsection "_is_rel_type" .Vb 6 \& Title : _is_rel_type \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "_typed_traversal" .IX Subsection "_typed_traversal" .Vb 6 \& Title : _typed_traversal \& Usage : \& Function: \& Example : \& Returns : \& Args : .Ve .SS "get_child_terms" .IX Subsection "get_child_terms" .Vb 12 \& Title : get_child_terms \& Usage : get_child_terms(TermI term, TermI predicate_terms): TermI \& get_child_terms(TermI term, RelationshipType predicate_terms): TermI \& Function: Retrieves all child terms of a given term, that satisfy a \& relationship among those that are specified in the second \& argument or undef otherwise. get_child_terms is a special \& case of get_descendant_terms, limiting the search to the \& direct descendants. \& Example : \& Returns : Array of TermI objects. \& Args : First argument is the term of interest, second is the list of \& relationship type terms. .Ve .SS "get_descendant_terms" .IX Subsection "get_descendant_terms" .Vb 7 \& Title : get_descendant_terms \& Usage : get_descendant_terms(TermI term, TermI rel_types): TermI \& get_child_terms(TermI term, RelationshipType predicate_terms): TermI \& Function: Retrieves all descendant terms of a given term, that \& satisfy a relationship among those that are specified in \& the second argument or undef otherwise. Uses \& _typed_traversal to find all descendants. \& \& Example : \& Returns : Array of TermI objects. \& Args : First argument is the term of interest, second is the list of \& relationship type terms. .Ve .SS "get_parent_terms" .IX Subsection "get_parent_terms" .Vb 8 \& Title : get_parent_terms \& Usage : get_parent_terms(TermI term, TermI predicate_terms): TermI \& get_child_terms(TermI term, RelationshipType predicate_terms): TermI \& Function: Retrieves all parent terms of a given term, that satisfy a \& relationship among those that are specified in the second \& argument or undef otherwise. get_parent_terms is a special \& case of get_ancestor_terms, limiting the search to the \& direct ancestors. \& \& Example : \& Returns : Array of TermI objects. \& Args : First argument is the term of interest, second is the list of relationship type terms. .Ve .SS "get_ancestor_terms" .IX Subsection "get_ancestor_terms" .Vb 7 \& Title : get_ancestor_terms \& Usage : get_ancestor_terms(TermI term, TermI predicate_terms): TermI \& get_child_terms(TermI term, RelationshipType predicate_terms): TermI \& Function: Retrieves all ancestor terms of a given term, that satisfy \& a relationship among those that are specified in the second \& argument or undef otherwise. Uses _typed_traversal to find \& all ancestors. \& \& Example : \& Returns : Array of TermI objects. \& Args : First argument is the term of interest, second is the list \& of relationship type terms. .Ve .SS "get_leaf_terms" .IX Subsection "get_leaf_terms" .Vb 6 \& Title : get_leaf_terms \& Usage : get_leaf_terms(): TermI \& Function: Retrieves all leaf terms from the ontology. Leaf term is a term w/o descendants. \& Example : @leaf_terms = $obj\->get_leaf_terms() \& Returns : Array of TermI objects. \& Args : .Ve .SS "get_root_terms" .IX Subsection "get_root_terms" .Vb 6 \& Title : get_root_terms \& Usage : get_root_terms(): TermI \& Function: Retrieves all root terms from the ontology. Root term is a term w/o descendants. \& Example : @root_terms = $obj\->get_root_terms() \& Returns : Array of TermI objects. \& Args : .Ve .SS "_filter_repeated" .IX Subsection "_filter_repeated" .Vb 6 \& Title : _filter_repeated \& Usage : @lst = $self\->_filter_repeated(@old_lst); \& Function: Removes repeated terms \& Example : \& Returns : List of unique TermI objects \& Args : List of TermI objects .Ve .SS "get_all_terms" .IX Subsection "get_all_terms" .Vb 6 \& Title : get_all_terms \& Usage : get_all_terms(): TermI \& Function: Retrieves all terms currently stored in the ontology. \& Example : @all_terms = $obj\->get_all_terms() \& Returns : Array of TermI objects. \& Args : .Ve .SS "find_terms" .IX Subsection "find_terms" .Vb 3 \& Title : find_terms \& Usage : ($term) = $oe\->find_terms(\-identifier => "SO:0000263"); \& Function: Find term instances matching queries for their attributes. \& \& This implementation can efficiently resolve queries by \& identifier. \& \& Example : \& Returns : an array of zero or more Bio::Ontology::TermI objects \& Args : Named parameters. The following parameters should be recognized \& by any implementations: \& \& \-identifier query by the given identifier \& \-name query by the given name .Ve .SS "relationship_factory" .IX Subsection "relationship_factory" .Vb 4 \& Title : relationship_factory \& Usage : $fact = $obj\->relationship_factory() \& Function: Get/set the object factory to be used when relationship \& objects are created by the implementation on\-the\-fly. \& \& Example : \& Returns : value of relationship_factory (a Bio::Factory::ObjectFactoryI \& compliant object) \& Args : on set, a Bio::Factory::ObjectFactoryI compliant object .Ve .SS "term_factory" .IX Subsection "term_factory" .Vb 4 \& Title : term_factory \& Usage : $fact = $obj\->term_factory() \& Function: Get/set the object factory to be used when term objects are \& created by the implementation on\-the\-fly. \& \& Note that this ontology engine implementation does not \& create term objects on the fly, and therefore setting this \& attribute is meaningless. \& \& Example : \& Returns : value of term_factory (a Bio::Factory::ObjectFactoryI \& compliant object) \& Args : on set, a Bio::Factory::ObjectFactoryI compliant object .Ve .SS "_filter_unmarked" .IX Subsection "_filter_unmarked" .Vb 6 \& Title : _filter_unmarked \& Usage : _filter_unmarked(TermI terms): TermI \& Function: Removes the uninstantiated terms from the list of terms \& Example : \& Returns : array of fully instantiated TermI objects \& Args : array of TermI objects .Ve .SS "remove_term_by_id" .IX Subsection "remove_term_by_id" .Vb 8 \& Title : remove_term_by_id \& Usage : remove_term_by_id(String id): TermI \& Function: Removes TermI object from the ontology engine using the \& string id as an identifier. Current implementation does not \& enforce consistency of the relationships using that term. \& Example : $term = $soe\->remove_term_by_id($id); \& Returns : Object of class TermI or undef if not found. \& Args : The string identifier of a term. .Ve .SS "to_string" .IX Subsection "to_string" .Vb 7 \& Title : to_string \& Usage : print $sv\->to_string(); \& Function: Currently returns formatted string containing the number of \& terms and number of relationships from the ontology engine. \& Example : print $sv\->to_string(); \& Returns : \& Args : .Ve .SS "_unique_termid" .IX Subsection "_unique_termid" .Vb 4 \& Title : _unique_termid \& Usage : \& Function: Returns a string that can be used as ID using fail\-over \& approaches. \& \& If the identifier attribute is not set, it uses the \& combination of name and ontology name, provided both are \& set. If they are not, it returns the name alone. \& \& Note that this is a private method. Call from inheriting \& classes but not from outside. \& \& Example : \& Returns : a string \& Args : a Bio::Ontology::TermI compliant object .Ve