Bio::O...yStore(3pm)
π NAME π
Bio::Ontology::OntologyStore β bestie, it's a whole repository of ontologies. That's the whole vibe. (You might see it filed under Bio::O...yStore(3pm) in the man page index, that's just the title being dramatic and truncating itself π
)
β¨ SYNOPSIS β¨
Okay so, two whole scenarios, both iconic:
#----------
#SCENARIO 1
#----------
#make an ontology object manually. via OntologyIO
my $io = Bio::OntologyIO->new(
#params to fetch Cell Ontology here
);
my $cell_ontology = $io->next_ontology;
#this is a singleton that caches the fact that you've created
#a 'Cell Ontology' instance...
my $store = Bio::Ontology::OntologyStore->get_instance();
#...and it can hand you back a copy of it at any time.
my $cell_ontology_copy = $store->get_ontology('Cell Ontology');
#----------
#SCENARIO 2
#----------
my $store = Bio::Ontology::OntologyStore->get_instance();
#this use case allows the construction of an ontology on
#demand just by supplying the name.
my $ontology = $store->get_ontology('Sequence Ontology');
Scenario 1 is you doing the work yourself and the store remembering it forever. Scenario 2 is the store doing the work itself because you just said a name. Both slay. π«Ά
πΈ DESCRIPTION πΈ
The primary purpose of this module is that of a singleton repository of Bio::Ontology::OntologyI instances from which an Ontology instance can be retrieved by name or identifier. No cap. β¨
This enables TermI implementations to return their corresponding OntologyI through using this singleton store instead of storing a direct reference to the Ontology object. And why does that matter? Because the latter would almost inevitably lead to memory cycles, and would therefore potentially blow up an application. π So like... the store is genuinely saving your whole program's life. Main character energy fr.
π¦ FEEDBACK π¦
π 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. (They literally want to hear from you, bestie.)
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. There are so many experienced and reponsive experts who will be able look at the problem and quickly address it. π
If at all possible, please include a thorough description of the problem with code and data examples. The more detail you give, the faster someone can help you out. π
π 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 - Hilmar Lapp
- Hilmar Lapp <hlapp@gmx.net>
- Allen Day <allenday@ucla.edu>
π 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 private ones π)
π new
- Title:
new - Usage:
my $obj = Bio::Ontology::OntologyStore->new(); - Function: Returns the
Bio::Ontology::OntologyStoreobject.
Unlike usual implementations of new, this implementation will try to return a previously instantiated store, if there is any. It is just a synonym for get_instance. In order to avoid ambiguities in your code, you may rather want to call rather get_instance explicitly, which also usually is better associated with this kind of behaviour.
- Returns: an instance of
Bio::Ontology::OntologyStore - Args:
π get_instance
- Title:
get_instance - Usage:
- Function: Get an instance of this class for perusal.
Since by design this class is meant to be used as a singleton, the implementation will return a previously instantianted store if there is one, and instantiate a new one otherwise. In order to use this class by means of an instance, call this method for added code clarity, not new().
- Example:
- Returns: an instance of this class
- Args: named parameters, if any (currently, there are no class-specific parameters other than those accepted by
Bio::Root::Root.
See Bio::Root::Root.
π get_ontology
- Title:
get_ontology - Usage:
- Function: Get a previously instantiated and registered instance of this class by name or by identifier.
One of the main purposes of this class is to enable TermI implementations to return their respective ontology without keeping a strong reference to the respective ontology object. Only objects previously registered objects can be retrieved.
This is a class method, hence you can call it on the class name, without dereferencing an object. (So no $obj-> needed, just the class name itself. periodt.)
- Example:
- Returns: a
Bio::Ontology::OntologyIimplementing object, orundefif the query could not be satisfied - Args: Named parameters specifying the query. The following parameters are recognized:
-nameβ query the store for an ontology with the given name-idβ query for an ontology with the given identifier
If both are specified, an implicit AND logical operator is assumed.
See Bio::Ontology::OntologyI.
π register_ontology
- Title:
register_ontology - Usage:
- Function: Registers the given Ontology object for later retrieval by name and identifier.
- Example:
- Returns:
TRUEon success andFALSEotherwise - Args: the
Bio::Ontology::OntologyIobject(s) to register
See Bio::Ontology::OntologyI.
π remove_ontology
- Title:
remove_ontology - Usage:
- Function: Remove the specified ontology from the store.
- Example:
- Returns:
TRUEon success andFALSEotherwise - Args: the
Bio::Ontology::OntologyIimplementing object(s) to be removed from the store
See Bio::Ontology::OntologyI.
π guess_ontology()
- Usage:
my $ontology = Bio::Ontology::OntologyStore->guess_ontology('GO:0000001'); - Function: tries to guess which ontology a term identifier comes from, loads it as necessary, and returns it as a
Bio::Ontology::Ontologyobject. - Example:
- Returns: a
Bio::Ontology::Ontologyobject, or warns and returnsundef - Args: an ontology term identifier in
XXXX:DDDDDDDformat. Guessing is based on theXXXXstring before the colon.
okay that's the whole page, bestie, you're officially an ontology store expert now π β¨
this little beauty lives at perl v5.32.1, dated 2021-08-15, and it's the Bio::O...yStore(3pm) page β go forth and cache your ontologies responsibly ππ¦π
π¦ 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