3 # BioPerl module for Bio::Ontology::DocumentRegistry
5 # Cared for by Allen Day <allenday@ucla.edu>
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
15 Bio::Ontology::DocumentRegistry - Keep track of where to find ontologies.
16 Allows lookups by name.
20 my $registry = Bio::Ontology::DocumentRegistry->get_instance();
21 my($ont,$def,$fmt) = $registry->documents('Sequence Ontology');
23 my $io = Bio::OntologyIO->new(-url => $ont,
26 my $so = $io->next_ontology();
31 Do not use this directly, use Bio::Ontology::OntologyStore instead.
32 Bio::Ontology::OntologyStore uses Bio::Ontology::DocumentRegistry to
33 load and cache ontologies as object graphs, you can just ask it for
34 what you want by name. See L<Bio::Ontology::OntologyStore> for
41 User feedback is an integral part of the evolution of this and other
42 Bioperl modules. Send your comments and suggestions preferably to
43 the Bioperl mailing list. Your participation is much appreciated.
45 bioperl-l@bioperl.org - General discussion
46 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
50 Report bugs to the Bioperl bug tracking system to help us keep track
51 of the bugs and their resolution. Bug reports can be submitted via
54 http://bugzilla.open-bio.org/
56 =head1 AUTHOR - Allen Day
58 Email allenday@ucla.edu
62 The rest of the documentation details each of the object methods.
63 Internal methods are usually preceded with a _
68 # Let the code begin...
70 package Bio
::Ontology
::DocumentRegistry
;
72 use base
qw(Bio::Root::Root);
79 'Sequence Ontology' => {
80 ontology
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.ontology?rev=HEAD",
81 definitions
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.definition?rev=HEAD",
84 'Sequence Ontology OBO' => {
85 ontology
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.obo?rev=HEAD",
86 definitions
=> "http://song.cvs.sourceforge.net/*checkout*/song/ontology/so.definition?rev=HEAD",
89 'Sequence Ontology Feature Annotation' => {
90 ontology
=> 'http://umn.dl.sourceforge.net/sourceforge/song/sofa.ontology',
91 definitions
=>'http://umn.dl.sourceforge.net/sourceforge/song/sofa.definition',
96 'http://www.geneontology.org/ontology/function.ontology',
97 'http://www.geneontology.org/ontology/process.ontology',
98 'http://www.geneontology.org/ontology/component.ontology'
100 definitions
=> 'http://www.geneontology.org/ontology/GO.defs',
106 $instance->{Gene_Ontology
} = $instance->{'Gene Ontology'};
108 bless $instance, __PACKAGE__
;
113 return shift->get_instance(@_);
119 Usage : my $singleton = Bio::Ontology::DocumentRegistry->get_instance();
120 Function: constructor
121 Returns : The Bio::Ontology::DocumentRegistry singleton.
134 Usage : my($ontology_url, $definitions_url, $format) = $obj->documents('Sequence Ontology');
135 Function: Maps an ontology name to a list of (local or) remote URIs where the
136 files can be located.
137 Returns : A 3-item list:
138 (1) URI for the ontology file
139 (2) URI for the ontology definitions file
140 (3) format of the files (dagedit, obo, etc)
141 Args : Name of an ontology, e.g. 'Sequence Ontology', or 'Cellular Component
148 my($self,$name) = @_;
150 if(defined($self->{$name})){
151 return ($self->{$name}{ontology
} , $self->{$name}{definitions
}, $self->{$name}{format
});