~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to Bio/Ontology/TermI.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: TermI.pm,v 1.11 2003/05/27 22:13:41 lapp Exp $
 
1
# $Id: TermI.pm,v 1.17.4.1 2006/10/02 23:10:22 sendu Exp $
2
2
#
3
3
# BioPerl module for Bio::Ontology::Term
4
4
#
20
20
 
21
21
# POD documentation - main docs before the code
22
22
 
23
 
 
24
23
=head1 NAME
25
24
 
26
 
TermI - interface for ontology terms
 
25
Bio::Ontology::TermI - interface for ontology terms
27
26
 
28
27
=head1 SYNOPSIS
29
28
 
53
52
Bioperl modules. Send your comments and suggestions preferably to one
54
53
of the Bioperl mailing lists.  Your participation is much appreciated.
55
54
 
56
 
  bioperl-l@bioperl.org             - General discussion
57
 
  http://bio.perl.org/MailList.html - About the mailing lists
 
55
  bioperl-l@bioperl.org                  - General discussion
 
56
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
58
57
 
59
58
=head2 Reporting Bugs
60
59
 
61
60
Report bugs to the Bioperl bug tracking system to help us keep track
62
 
the bugs and their resolution.  Bug reports can be submitted via email
63
 
or the web:
 
61
the bugs and their resolution.  Bug reports can be submitted via
 
62
the web:
64
63
 
65
 
  bioperl-bugs@bio.perl.org
66
 
  http://bugzilla.bioperl.org/
 
64
  http://bugzilla.open-bio.org/
67
65
 
68
66
=head1 AUTHOR
69
67
 
90
88
# Let the code begin...
91
89
 
92
90
package Bio::Ontology::TermI;
93
 
use vars qw( @ISA );
94
91
use strict;
95
 
use Bio::Root::RootI;
96
92
 
97
 
@ISA = qw( Bio::Root::RootI );
 
93
use base qw(Bio::Root::RootI);
98
94
 
99
95
 
100
96
 
172
168
           take special precaution in order not to create cyclical
173
169
           references in memory.
174
170
 
175
 
 Returns : The ontology of this Term as a L<Bio::Ontology::OntologyI>
 
171
 Returns : The ontology of this Term as a Bio::Ontology::OntologyI
176
172
           implementing object.
177
 
 Args    : On set, the  ontology of this Term as a L<Bio::Ontology::OntologyI>
 
173
 Args    : On set, the  ontology of this Term as a Bio::Ontology::OntologyI
178
174
           implementing object or a string representing its name.
179
175
 
 
176
See L<Bio::Ontology::OntologyI>.
 
177
 
180
178
=cut
181
179
 
182
180
sub ontology {
305
303
} # get_secondary_ids
306
304
 
307
305
 
 
306
=head1  Deprecated methods
 
307
 
 
308
Used for looking up the methods that supercedes them.
 
309
 
 
310
=cut
 
311
 
 
312
=head2 category
 
313
 
 
314
 Title   : category
 
315
 Usage   :
 
316
 Function: This method is deprecated. Use ontology() instead. We provide
 
317
           an implementation here that preserves backwards compatibility,
 
318
           but if you do not have legacy code using it you should not be
 
319
           calling this method.
 
320
 Example :
 
321
 Returns :
 
322
 Args    :
 
323
 
 
324
=cut
 
325
 
 
326
sub category {
 
327
    my $self = shift;
 
328
 
 
329
    $self->warn("TermI::category is deprecated and being phased out. ".
 
330
                "Use TermI::ontology instead.");
 
331
 
 
332
    # called in set mode?
 
333
    if(@_) {
 
334
        # yes; what is incompatible with ontology() is if we were given
 
335
        # a TermI object
 
336
        my $arg = shift;
 
337
        $arg = $arg->name() if ref($arg) && $arg->isa("Bio::Ontology::TermI");
 
338
        return $self->ontology($arg,@_);
 
339
    } else {
 
340
        # No, called in get mode. This is always incompatible with ontology()
 
341
        # since category is supposed to return a TermI.
 
342
        my $ont = $self->ontology();
 
343
        my $term;
 
344
        if(defined($ont)) {
 
345
            $term = Bio::Ontology::Term->new(-name => $ont->name(),
 
346
                                             -identifier =>$ont->identifier());
 
347
        }
 
348
        return $term;
 
349
    }
 
350
} # category
 
351
 
308
352
1;