.\" 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::OntologyStore 3pm" .TH Bio::Ontology::OntologyStore 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::OntologyStore \- A repository of ontologies .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& #\-\-\-\-\-\-\-\-\-\- \& #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\*(Aqve created \& #a \*(AqCell Ontology\*(Aq 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(\*(AqCell Ontology\*(Aq); \& \& \& #\-\-\-\-\-\-\-\-\-\- \& #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(\*(AqSequence Ontology\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "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. .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 \- Hilmar Lapp" .IX Header "AUTHOR - Hilmar Lapp" .Vb 2 \& Hilmar Lapp Ehlapp@gmx.netE \& Allen Day Eallenday@ucla.eduE .Ve .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 3 \& Title : new \& Usage : my $obj = Bio::Ontology::OntologyStore\->new(); \& Function: Returns the Bio::Ontology::OntologyStore object. \& \& 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 : .Ve .SS "get_instance" .IX Subsection "get_instance" .Vb 3 \& 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. .Ve .PP See Bio::Root::Root. .SS "get_ontology" .IX Subsection "get_ontology" .Vb 4 \& 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. \& \& Example : \& Returns : a Bio::Ontology::OntologyI implementing object, or undef \& if 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. .Ve .PP See Bio::Ontology::OntologyI. .SS "register_ontology" .IX Subsection "register_ontology" .Vb 4 \& Title : register_ontology \& Usage : \& Function: Registers the given Ontology object for later retrieval \& by name and identifier. \& \& Example : \& Returns : TRUE on success and FALSE otherwise \& Args : the Bio::Ontology::OntologyI object(s) to register .Ve .PP See Bio::Ontology::OntologyI. .SS "remove_ontology" .IX Subsection "remove_ontology" .Vb 7 \& Title : remove_ontology \& Usage : \& Function: Remove the specified ontology from the store. \& Example : \& Returns : TRUE on success and FALSE otherwise \& Args : the Bio::Ontology::OntologyI implementing object(s) \& to be removed from the store .Ve .PP See Bio::Ontology::OntologyI. .SS "\fBguess_ontology()\fP" .IX Subsection "guess_ontology()" .Vb 9 \& Usage : my $ontology = \& Bio::Ontology::OntologyStore\->guess_ontology(\*(AqGO:0000001\*(Aq); \& 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 undef \& Args : an ontology term identifier in XXXX:DDDDDDD format. \& Guessing is based on the XXXX string before the colon. .Ve