2 # BioPerl module for Bio::Ontology::DocumentRegistry
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Allen Day <allenday@ucla.edu>
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Ontology::DocumentRegistry - Keep track of where to find ontologies.
17 Allows lookups by name.
21 my $registry = Bio::Ontology::DocumentRegistry->get_instance();
22 my($ont,$def,$fmt) = $registry->documents('Sequence Ontology');
24 my $io = Bio::OntologyIO->new(-url => $ont,
27 my $so = $io->next_ontology();
32 Do not use this directly, use Bio::Ontology::OntologyStore instead.
33 Bio::Ontology::OntologyStore uses Bio::Ontology::DocumentRegistry to
34 load and cache ontologies as object graphs, you can just ask it for
35 what you want by name. See L<Bio::Ontology::OntologyStore> for
42 User feedback is an integral part of the evolution of this and other
43 Bioperl modules. Send your comments and suggestions preferably to
44 the Bioperl mailing list. Your participation is much appreciated.
46 bioperl-l@bioperl.org - General discussion
47 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
51 Please direct usage questions or support issues to the mailing list:
53 I<bioperl-l@bioperl.org>
55 rather than to the module maintainer directly. Many experienced and
56 reponsive experts will be able look at the problem and quickly
57 address it. Please include a thorough description of the problem
58 with code and data examples if at all possible.
62 Report bugs to the Bioperl bug tracking system to help us keep track
63 of the bugs and their resolution. Bug reports can be submitted via
66 https://github.com/bioperl/bioperl-live/issues
68 =head1 AUTHOR - Allen Day
70 Email allenday@ucla.edu
74 The rest of the documentation details each of the object methods.
75 Internal methods are usually preceded with a _
80 # Let the code begin...
82 package Bio
::Ontology
::DocumentRegistry
;
84 use base
qw(Bio::Root::Root);
91 'Sequence Ontology' => {
92 ontology
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.ontology?rev=HEAD",
93 definitions
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.definition?rev=HEAD",
96 'Sequence Ontology OBO' => {
97 ontology
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.obo?rev=HEAD",
98 definitions
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.definition?rev=HEAD",
102 #### TODO Server http://umn.dl.sourceforge.net/ does not respond, are there
103 #### alternative sources?
104 'Sequence Ontology Feature Annotation' => {
105 ontology
=> 'http://umn.dl.sourceforge.net/sourceforge/song/sofa.ontology',
106 definitions
=>'http://umn.dl.sourceforge.net/sourceforge/song/sofa.definition',
111 'http://www.geneontology.org/ontology/function.ontology',
112 'http://www.geneontology.org/ontology/process.ontology',
113 'http://www.geneontology.org/ontology/component.ontology'
115 definitions
=> 'http://www.geneontology.org/ontology/GO.defs',
121 $instance->{Gene_Ontology
} = $instance->{'Gene Ontology'};
123 bless $instance, __PACKAGE__
;
128 return shift->get_instance(@_);
134 Usage : my $singleton = Bio::Ontology::DocumentRegistry->get_instance();
135 Function: constructor
136 Returns : The Bio::Ontology::DocumentRegistry singleton.
149 Usage : my($ontology_url, $definitions_url, $format) = $obj->documents('Sequence Ontology');
150 Function: Maps an ontology name to a list of (local or) remote URIs where the
151 files can be located.
152 Returns : A 3-item list:
153 (1) URI for the ontology file
154 (2) URI for the ontology definitions file
155 (3) format of the files (dagedit, obo, etc)
156 Args : Name of an ontology, e.g. 'Sequence Ontology', or 'Cellular Component
163 my($self,$name) = @_;
165 if(defined($self->{$name})){
166 return ($self->{$name}{ontology
} , $self->{$name}{definitions
}, $self->{$name}{format
});