2 # BioPerl module for Bio::Ontology::Term
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Christian M. Zmasek <czmasek-at-burnham.org> or <cmzmasek@yahoo.com>
8 # (c) Christian M. Zmasek, czmasek-at-burnham.org, 2002.
9 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
11 # You may distribute this module under the same terms as perl itself.
12 # Refer to the Perl Artistic License (see the license accompanying this
13 # software package, or see http://www.perl.com/language/misc/Artistic.html)
14 # for the terms under which you may use, modify, and redistribute this module.
16 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 # You may distribute this module under the same terms as perl itself
22 # POD documentation - main docs before the code
26 Bio::Ontology::TermI - interface for ontology terms
30 #get Bio::Ontology::TermI somehow.
32 print $term->identifier(), "\n";
33 print $term->name(), "\n";
34 print $term->definition(), "\n";
35 print $term->is_obsolete(), "\n";
36 print $term->comment(), "\n";
38 foreach my $synonym ( $term->get_synonyms() ) {
45 This is "dumb" interface for ontology terms providing basic methods
46 (it provides no functionality related to graphs).
52 User feedback is an integral part of the evolution of this and other
53 Bioperl modules. Send your comments and suggestions preferably to one
54 of the Bioperl mailing lists. Your participation is much appreciated.
56 bioperl-l@bioperl.org - General discussion
57 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
61 Please direct usage questions or support issues to the mailing list:
63 I<bioperl-l@bioperl.org>
65 rather than to the module maintainer directly. Many experienced and
66 reponsive experts will be able look at the problem and quickly
67 address it. Please include a thorough description of the problem
68 with code and data examples if at all possible.
72 Report bugs to the Bioperl bug tracking system to help us keep track
73 the bugs and their resolution. Bug reports can be submitted via
76 https://github.com/bioperl/bioperl-live/issues
82 Email: czmasek-at-burnham.org or cmzmasek@yahoo.com
84 WWW: http://monochrome-effect.net/
88 Genomics Institute of the Novartis Research Foundation
89 10675 John Jay Hopkins Drive
94 The rest of the documentation details each of the object
100 # Let the code begin...
102 package Bio
::Ontology
::TermI
;
105 use base
qw(Bio::Root::RootI);
112 Usage : $term->identifier( "0003947" );
114 print $term->identifier();
115 Function: Set/get for the identifier of this Term.
116 Returns : The identifier [scalar].
117 Args : The identifier [scalar] (optional).
122 shift->throw_not_implemented();
131 Usage : $term->name( "N-acetylgalactosaminyltransferase" );
134 Function: Set/get for the name of this Term.
135 Returns : The name [scalar].
136 Args : The name [scalar] (optional).
141 shift->throw_not_implemented();
151 Usage : $term->definition( "Catalysis of ..." );
153 print $term->definition();
154 Function: Set/get for the definition of this Term.
155 Returns : The definition [scalar].
156 Args : The definition [scalar] (optional).
161 shift->throw_not_implemented();
169 Usage : $ont = $term->ontology();
171 $term->ontology( $ont );
172 Function: Get the ontology this term is in.
174 An implementation may not permit the value of this
175 attribute to be changed once it is set, since that may have
176 serious consequences (note that with the ontology in hand
177 you can query for all related terms etc).
179 Note for implementors: you will almost certainly have to
180 take special precaution in order not to create cyclical
181 references in memory.
183 Returns : The ontology of this Term as a Bio::Ontology::OntologyI
185 Args : On set, the ontology of this Term as a Bio::Ontology::OntologyI
186 implementing object or a string representing its name.
188 See L<Bio::Ontology::OntologyI>.
193 shift->throw_not_implemented();
201 Usage : $term->version( "1.00" );
203 print $term->version();
204 Function: Set/get for version information.
205 Returns : The version [scalar].
206 Args : The version [scalar] (optional).
211 shift->throw_not_implemented();
220 Usage : $term->is_obsolete( 1 );
222 if ( $term->is_obsolete() )
223 Function: Set/get for the obsoleteness of this Term.
224 Returns : the obsoleteness [0 or 1].
225 Args : the obsoleteness [0 or 1] (optional).
230 shift->throw_not_implemented();
238 Usage : $term->comment( "Consider the term ..." );
240 print $term->comment();
241 Function: Set/get for an arbitrary comment about this Term.
243 Args : A comment (optional).
248 shift->throw_not_implemented();
257 Usage : @aliases = $term->get_synonyms();
258 Function: Returns a list of aliases of this Term.
260 If an implementor of this interface permits modification of
261 this array property, the class should define at least
262 methods add_synonym() and remove_synonyms(), with obvious
265 Returns : A list of aliases [array of [scalar]].
271 shift->throw_not_implemented();
276 Title : get_dblinks()
277 Usage : @ds = $term->get_dblinks();
278 Function: Returns a list of each dblink of this term.
280 If an implementor of this interface permits modification of
281 this array property, the class should define at least
282 methods add_dblink() and remove_dblinks(), with obvious
285 Returns : A list of dblinks [array of [scalars]].
287 Note : This has been deprecated in favor of get_dbxrefs()
292 shift->throw('get_dblinks() is deprecated, use get_dbxrefs() instead');
297 Title : get_dbxrefs()
298 Usage : @ds = $term->get_dbxrefs();
299 Function: Returns a list of each link for this term.
301 If an implementor of this interface permits modification of
302 this array property, the class should define at least
303 methods add_dbxref() and remove_dbxrefs(), with obvious
306 Returns : A list of dblinks. This can return a mixed 'bag' of scalars and
307 L<Bio::Annotation::DBLink> instances, or specific subgroups
308 can be returned based on passed arguments
309 Args : implementation-specific
314 shift->throw_not_implemented();
317 =head2 get_secondary_ids
319 Title : get_secondary_ids
320 Usage : @ids = $term->get_secondary_ids();
321 Function: Returns a list of secondary identifiers of this Term.
323 Secondary identifiers mostly originate from merging terms,
324 or possibly also from splitting terms.
326 If an implementor of this interface permits modification of
327 this array property, the class should define at least
328 methods add_secondary_id() and remove_secondary_ids(), with
329 obvious functionality.
331 Returns : A list of secondary identifiers [array of [scalar]]
336 sub get_secondary_ids
{
337 shift->throw_not_implemented();
338 } # get_secondary_ids
341 =head1 Deprecated methods
343 Used for looking up the methods that supercedes them.
351 Function: This method is deprecated. Use ontology() instead. We provide
352 an implementation here that preserves backwards compatibility,
353 but if you do not have legacy code using it you should not be
364 $self->warn("TermI::category is deprecated and being phased out. ".
365 "Use TermI::ontology instead.");
367 # called in set mode?
369 # yes; what is incompatible with ontology() is if we were given
372 $arg = $arg->name() if ref($arg) && $arg->isa("Bio::Ontology::TermI");
373 return $self->ontology($arg,@_);
375 # No, called in get mode. This is always incompatible with ontology()
376 # since category is supposed to return a TermI.
377 my $ont = $self->ontology();
380 $term = Bio
::Ontology
::Term
->new(-name
=> $ont->name(),
381 -identifier
=>$ont->identifier());