3 # BioPerl module for Bio::Ontology::DocumentRegistry
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Allen Day <allenday@ucla.edu>
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Ontology::DocumentRegistry - Keep track of where to find ontologies.
18 Allows lookups by name.
22 my $registry = Bio::Ontology::DocumentRegistry->get_instance();
23 my($ont,$def,$fmt) = $registry->documents('Sequence Ontology');
25 my $io = Bio::OntologyIO->new(-url => $ont,
28 my $so = $io->next_ontology();
33 Do not use this directly, use Bio::Ontology::OntologyStore instead.
34 Bio::Ontology::OntologyStore uses Bio::Ontology::DocumentRegistry to
35 load and cache ontologies as object graphs, you can just ask it for
36 what you want by name. See L<Bio::Ontology::OntologyStore> for
43 User feedback is an integral part of the evolution of this and other
44 Bioperl modules. Send your comments and suggestions preferably to
45 the Bioperl mailing list. Your participation is much appreciated.
47 bioperl-l@bioperl.org - General discussion
48 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
52 Please direct usage questions or support issues to the mailing list:
54 I<bioperl-l@bioperl.org>
56 rather than to the module maintainer directly. Many experienced and
57 reponsive experts will be able look at the problem and quickly
58 address it. Please include a thorough description of the problem
59 with code and data examples if at all possible.
63 Report bugs to the Bioperl bug tracking system to help us keep track
64 of the bugs and their resolution. Bug reports can be submitted via
67 http://bugzilla.open-bio.org/
69 =head1 AUTHOR - Allen Day
71 Email allenday@ucla.edu
75 The rest of the documentation details each of the object methods.
76 Internal methods are usually preceded with a _
81 # Let the code begin...
83 package Bio
::Ontology
::DocumentRegistry
;
85 use base
qw(Bio::Root::Root);
92 'Sequence Ontology' => {
93 ontology
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.ontology?rev=HEAD",
94 definitions
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.definition?rev=HEAD",
97 'Sequence Ontology OBO' => {
98 ontology
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.obo?rev=HEAD",
99 definitions
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.definition?rev=HEAD",
103 #### TODO Server http://umn.dl.sourceforge.net/ does not respond, are there
104 #### alternative sources?
105 'Sequence Ontology Feature Annotation' => {
106 ontology
=> 'http://umn.dl.sourceforge.net/sourceforge/song/sofa.ontology',
107 definitions
=>'http://umn.dl.sourceforge.net/sourceforge/song/sofa.definition',
112 'http://www.geneontology.org/ontology/function.ontology',
113 'http://www.geneontology.org/ontology/process.ontology',
114 'http://www.geneontology.org/ontology/component.ontology'
116 definitions
=> 'http://www.geneontology.org/ontology/GO.defs',
122 $instance->{Gene_Ontology
} = $instance->{'Gene Ontology'};
124 bless $instance, __PACKAGE__
;
129 return shift->get_instance(@_);
135 Usage : my $singleton = Bio::Ontology::DocumentRegistry->get_instance();
136 Function: constructor
137 Returns : The Bio::Ontology::DocumentRegistry singleton.
150 Usage : my($ontology_url, $definitions_url, $format) = $obj->documents('Sequence Ontology');
151 Function: Maps an ontology name to a list of (local or) remote URIs where the
152 files can be located.
153 Returns : A 3-item list:
154 (1) URI for the ontology file
155 (2) URI for the ontology definitions file
156 (3) format of the files (dagedit, obo, etc)
157 Args : Name of an ontology, e.g. 'Sequence Ontology', or 'Cellular Component
164 my($self,$name) = @_;
166 if(defined($self->{$name})){
167 return ($self->{$name}{ontology
} , $self->{$name}{definitions
}, $self->{$name}{format
});