NAME
Bio::Ontology::OntologyStore - A repository of ontologies
SYNOPSIS
#----------#SCENARIO 1#----------#make an ontology object manually. via OntologyIOmy $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');
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. This enables TermI implementations to return their corresponding OntologyI through using this singleton store instead of storing a direct reference to the Ontology object. The latter would almost inevitably lead to memory cycles, and would therefore potentially blow up an application.
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.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
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.
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 E<lt>[email protected]<gt>Allen Day E<lt>[email protected]<gt>
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : my $obj = Bio::Ontology::OntologyStore->new();Function: Returns the Bio::Ontology::OntologyStore object.Unlike usual implementations of new, this implementationwill try to return a previously instantiated store, ifthere is any. It is just a synonym for get_instance. Inorder to avoid ambiguities in your code, you may ratherwant to call rather get_instance explicitly, which alsousually is better associated with this kind of behaviour.Returns : an instance of Bio::Ontology::OntologyStoreArgs :
get_instance
Title : get_instanceUsage :Function: Get an instance of this class for perusal.Since by design this class is meant to be used as asingleton, the implementation will return a previouslyinstantianted store if there is one, and instantiate a newone otherwise. In order to use this class by means of aninstance, call this method for added code clarity, notnew().Example :Returns : an instance of this classArgs : named parameters, if any (currently, there are noclass-specific parameters other than those accepted byBio::Root::Root.
See Bio::Root::Root.
get_ontology
Title : get_ontologyUsage :Function: Get a previously instantiated and registered instance ofthis class by name or by identifier.One of the main purposes of this class is to enable TermIimplementations to return their respective ontology withoutkeeping a strong reference to the respective ontologyobject. Only objects previously registered objects can beretrieved.This is a class method, hence you can call it on the classname, without dereferencing an object.Example :Returns : a Bio::Ontology::OntologyI implementing object, or undefif the query could not be satisfiedArgs : Named parameters specifying the query. The following parametersare recognized:-name query the store for an ontology with the given name-id query for an ontology with the given identifierIf both are specified, an implicit AND logical operator isassumed.
See Bio::Ontology::OntologyI.
register_ontology
Title : register_ontologyUsage :Function: Registers the given Ontology object for later retrievalby name and identifier.Example :Returns : TRUE on success and FALSE otherwiseArgs : the Bio::Ontology::OntologyI object(s) to register
See Bio::Ontology::OntologyI.
remove_ontology
Title : remove_ontologyUsage :Function: Remove the specified ontology from the store.Example :Returns : TRUE on success and FALSE otherwiseArgs : the Bio::Ontology::OntologyI implementing 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::Ontology object.Example :Returns : a Bio::Ontology::Ontology object, or warns and returns undefArgs : an ontology term identifier in XXXX:DDDDDDD format.Guessing is based on the XXXX string before the colon.