Bio::O...yEngine(3pm)
π Bio::O...yEngine(3pm) π
okay so this is a page from the User Contributed Perl Documentation, and bestie, we're talking about Bio::Ontology::SimpleOntologyEngine β yes the manpage header literally abbreviates it to Bio::O...yEngine(3pm) because the real name is a lot, and honestly? relatable. anyway, let's get into it, this is part 1 so don't go anywhere πΈ
β¨ NAME β¨
Bio::Ontology::SimpleOntologyEngine β it's an Implementation of OntologyEngineI interface, no cap π«Ά
β¨ SYNOPSIS β¨
the vibe check, in code:
my $soe = Bio::Ontology::SimpleOntologyEngine->new;
that's it. that's the whole synopsis. iconic brevity π
β¨ DESCRIPTION β¨
so this is a "simple" implementation of Bio::Ontology::OntologyEngineI. the quotes around "simple" are doing a lot of work here and we respect them π
β¨ FEEDBACK β¨
π¬ Mailing Lists
User feedback is, like, integral to the evolution of this and other Bioperl modules. so send your comments and suggestions preferably to the Bioperl mailing list. your participation is much appreciated, fr fr π₯Ί
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π«Ά Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. bestie, this is the way β there are so many experienced and reponsive experts who will be able look at the problem and quickly address it. and please include a thorough description of the problem with code and data examples if at all possible π
π 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:
https://github.com/bioperl/bioperl-live/issues
β¨ AUTHOR - Peter Dimitrov β¨
Email dimitrov@gnf.org π
β¨ CONTRIBUTORS β¨
Hilmar Lapp, hlapp at gmx.net π
β¨ APPENDIX β¨
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (iykyk, the underscore ones are the behind-the-scenes girlies) π
π new
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 :
so you call new, it initializes the ontology engine, and you get back an object of class SimpleOntologyEngine. main character energy β¨
π _instantiated_terms_store
Title : _instantiated_terms_store
Usage : $obj->_instantiated_terms_store($newval)
Function:
Example :
Returns : hash
Args : empty hash
returns a hash, args are an empty hash. that's the whole story π
π mark_instantiated
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.
so this marks TermI objects as fully instantiated, which lets the engine count the number of terms in the term store properly. important: the TermI objects has to be already stored in the term store in order to be marked β like, you can't mark a term that isn't in the store, okay? it returns its argument, or throws an exception if a term is not in the term store π
π mark_uninstantiated
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.
the opposite of the last one β marks TermI objects as not fully instantiated. returns its argument, or throws an exception if a term is not in the term store (and if the term is not marked it does nothing, so, chill) π
π _term_store
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
returns a reference to an array of Bio::Ontology::TermI objects, and takes the same as an arg. cute symmetry π¦
π add_term
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.
adds a TermI object to the ontology engine term store, and β heads up β it marks the term fully instantiated by default. returns its argument. so easy, so slay π
π get_term_by_identifier
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
looks up terms from the term store by their identifier field, or an empty list if they're not there (no drama, just an empty list). returns an array of zero or more Bio::Ontology::TermI objects, and you feed it an array of identifier strings. the example is straight up:
$term = $soe->get_term_by_identifier("IPR000001");
π _get_number_rels
Title : get_number_rels
Usage :
Function:
Example :
Returns :
Args :
internal, all fields basically vibes π
π _get_number_terms
Title : _get_number_terms
Usage :
Function:
Example :
Returns :
Args :
also internal, also mysterious π§
π _relationship_store
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
returns a reference to an array of Bio::Ontology::TermI objects, takes a reference to an array of Bio::Ontology::TermI objects. (yes, the Title line says _storerelationship_store β that's literally what it says, we're not touching it, periodt) π
π _inverted_relationship_store
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
returns a reference to an array of Bio::Ontology::TermI objects, args are a reference to an array of Bio::Ontology::TermI objects π
π _relationship_type_store
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
returns a reference to an array of Bio::Ontology::RelationshipType objects, takes a reference to an array of Bio::Ontology::RelationshipType objects π₯
π _add_relationship_simple
Title : _add_relationship_simple
Usage :
Function:
Example :
Returns :
Args :
internal. short. sweet. β
π add_relationship
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.
adds a relationship object to the ontology engine. returns its argument, takes a RelationshipI object. lowkey the most straightforward method here π
π get_relationships
Title : get_relationships
Usage : get_relationships(): RelationshipI
Function: Retrieves all relationship objects.
Example :
Returns : Array of RelationshipI objects
Args :
retrieves all the relationship objects. returns an Array of RelationshipI objects. no args, just vibes πΈ
π get_all_relationships
Title : get_all_relationships
Usage : get_all_relationships(): RelationshipI
Function: Retrieves all relationship objects.
Example :
Returns : Array of RelationshipI objects
Args :
same energy as the last one: retrieves all relationship objects, returns an Array of RelationshipI objects π
π get_predicate_terms
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 :
retrieves all the relationship types stored in the engine, and gives you back a reference to an array of Bio::Ontology::RelationshipType objects π
π _is_rel_type
Title : _is_rel_type
Usage :
Function:
Example :
Returns :
Args :
internal helper, mystery girlie β¨
π _typed_traversal
Title : _typed_traversal
Usage :
Function:
Example :
Returns :
Args :
also internal β but remember this name, because get_descendant_terms and get_ancestor_terms both use it to do their thing π
π get_child_terms
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.
retrieves all child terms of a given term that satisfy a relationship among those specified in the second argument β or undef otherwise. and here's the tea: get_child_terms is a special case of get_descendant_terms, limiting the search to the direct descendants only. returns an Array of TermI objects. first arg = the term of interest, second arg = the list of relationship type terms π
π get_descendant_terms
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.
retrieves all descendant terms of a given term that satisfy a relationship among those specified in the second argument, or undef otherwise. it uses _typed_traversal to find all descendants (told you that name would come back). returns an Array of TermI objects. first arg = term of interest, second = list of relationship type terms π¦
π get_parent_terms
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.
retrieves all parent terms of a given term that satisfy a relationship among those specified in the second argument, or undef otherwise. and yes, get_parent_terms is a special case of get_ancestor_terms, limiting the search to the direct ancestors. returns an Array of TermI objects. first arg = term of interest, second = list of relationship type terms π
π get_ancestor_terms
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.
retrieves all ancestor terms of a given term that satisfy a relationship among those specified in the second argument, or undef otherwise. uses _typed_traversal to find all ancestors. returns an Array of TermI objects. first arg = term of interest, second = list of relationship type terms π
π get_leaf_terms
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 :
retrieves all leaf terms from the ontology. a leaf term is a term w/o descendants β that's the definition, write it down. example:
@leaf_terms = $obj->get_leaf_terms()
returns an Array of TermI objects π
π get_root_terms
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 :
retrieves all root terms from the ontology. (the original says "Root term is a term w/o descendants" β yes, exactly like the leaf one, we're reporting it as written, no editing, that's the rule π) example:
@root_terms = $obj->get_root_terms()
returns an Array of TermI objects β¨
π _filter_repeated
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
removes repeated terms. you give it a List of TermI objects, it gives you back a List of unique TermI objects. dedupe queen π
π get_all_terms
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 :
retrieves all terms currently stored in the ontology. example:
@all_terms = $obj->get_all_terms()
returns an Array of TermI objects π
π find_terms
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
find term instances matching queries for their attributes. and ooh, this implementation can efficiently resolve queries by identifier β that's a flex. returns an array of zero or more Bio::Ontology::TermI objects.
args are Named parameters, and the following parameters should be recognized by any implementations:
-identifierβ query by the given identifier-nameβ query by the given name
example usage:
($term) = $oe->find_terms(-identifier => "SO:0000263");
π relationship_factory
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.
get/set the object factory to be used when relationship objects are created by the implementation on-the-fly. that's the last one for part 1, bestie β more parts follow, so don't go anywhere πΈπ
okay so we were mid-sentence in relationship_factory β here's the last lil chunk of it, no cap π«Ά
- Example : literally nothing here, it's giving minimalist
- Returns : value of
relationship_factory(aBio::Factory::ObjectFactoryIcompliant object) - Args : on set, a
Bio::Factory::ObjectFactoryIcompliant object
β¨ term_factory β¨
- Title :
term_factory - Usage :
$fact = $obj->term_factory() - Function : get/set the object factory that gets used when term objects are created by the implementation on-the-fly π
β οΈ bestie, read this twice: this ontology engine implementation does not create term objects on the fly, so setting this attribute is meaningless. Not "kinda useless", not "meh" β meaningless. Don't waste your main character energy on it. π
- Example : empty, it said what it said
- Returns : value of
term_factory(aBio::Factory::ObjectFactoryIcompliant object) - Args : on set, a
Bio::Factory::ObjectFactoryIcompliant object
πΈ _filter_unmarked πΈ
- Title :
_filter_unmarked - Usage :
_filter_unmarked(TermI terms): TermI - Function : removes the uninstantiated terms from the list of terms π§Ήβ¨
- Example : nope, nothing
- Returns : array of fully instantiated
TermIobjects - Args : array of
TermIobjects
π remove_term_by_id π
- Title :
remove_term_by_id - Usage :
remove_term_by_id(String id): TermI - Function : removes a
TermIobject from the ontology engine, using the string id as the identifier. Heads up tho: the current implementation does not enforce consistency of the relationships that use that term. So likeβ¦ it's gone, but its situationships are still out there. π - Example :
$term = $soe->remove_term_by_id($id); - Returns : object of class
TermI, orundefif it wasn't found - Args : the string identifier of a term
π to_string π
- Title :
to_string - Usage :
print $sv->to_string(); - Function : currently returns a formatted string containing the number of terms and the number of relationships from the ontology engine πβ¨
- Example :
print $sv->to_string(); - Returns : nothing listed
- Args : nothing listed
π¦ _unique_termid π¦
- Title :
_unique_termid - Usage : blank, it's mysterious like that
- Function : returns a string that can be used as an ID, using fail-over approaches π
- if the
identifierattribute is not set, it uses the combination ofnameandontology nameβ provided both are set - if they are not, it returns the
namealone
- if the
π real talk: this is a private method. Call it from inheriting classes, but not from outside. It's iykyk only, bestie.
- Example : empty
- Returns : a string
- Args : a
Bio::Ontology::TermIcompliant object
and that's the whole page, bestie, we ate and left no crumbs ππ
this was served up from the perl v5.32.1 release, dated 2021-08-15, and yeah β the footer really does just say Bio::O...yEngine(3pm) like that, abbreviations and all, iconic behaviour honestly πβ periodt.
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms