~ubuntu-branches/ubuntu/lucid/bioperl/lucid

« back to all changes in this revision

Viewing changes to Bio/Annotation/Collection.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2007-09-21 22:52:22 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070921225222-tt20m2yy6ycuy2d8
Tags: 1.5.2.102-1
* Developer release.
* Upgraded source package to debhelper 5 and standards-version 3.7.2.
* Added libmodule-build-perl and libtest-harness-perl to
  build-depends-indep.
* Disabled automatic CRAN download.
* Using quilt instead of .diff.gz to manage modifications.
* Updated Recommends list for the binary package.
* Moved the "production-quality" scripts to /usr/bin/.
* New maintainer: Debian-Med packaging team mailing list.
* New uploaders: Charles Plessy and Steffen Moeller.
* Updated Depends, Recommends and Suggests.
* Imported in Debian-Med's SVN repository on Alioth.
* Executing the regression tests during package building.
* Moved the Homepage: field out from the package's description.
* Updated watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: Collection.pm,v 1.16 2002/11/22 22:48:25 birney Exp $
 
1
# $Id: Collection.pm,v 1.23.4.1 2006/10/02 23:10:12 sendu Exp $
2
2
 
3
3
#
4
4
# BioPerl module for Bio::Annotation::Collection.pm
13
13
 
14
14
=head1 NAME
15
15
 
16
 
Bio::Annotation::Collection - Default Perl implementation of AnnotationCollectionI
 
16
Bio::Annotation::Collection - Default Perl implementation of 
 
17
AnnotationCollectionI
17
18
 
18
19
=head1 SYNOPSIS
19
20
 
35
36
 
36
37
=head1 DESCRIPTION
37
38
 
38
 
Bioperl implementation for Bio::AnnotationCollecitonI 
 
39
Bioperl implementation for Bio::AnnotationCollectionI 
39
40
 
40
41
=head1 FEEDBACK
41
42
 
45
46
Bioperl modules. Send your comments and suggestions preferably to one
46
47
of the Bioperl mailing lists. Your participation is much appreciated.
47
48
 
48
 
  bioperl-l@bioperl.org              - General discussion
49
 
  http://bio.perl.org/MailList.html  - About the mailing lists
 
49
  bioperl-l@bioperl.org                  - General discussion
 
50
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
50
51
 
51
52
=head2 Reporting Bugs
52
53
 
53
54
Report bugs to the Bioperl bug tracking system to help us keep track
54
 
the bugs and their resolution.  Bug reports can be submitted via email
55
 
or the web:
 
55
the bugs and their resolution.  Bug reports can be submitted via
 
56
the web:
56
57
 
57
 
  bioperl-bugs@bioperl.org
58
 
  http://bugzilla.bioperl.org/
 
58
  http://bugzilla.open-bio.org/
59
59
 
60
60
=head1 AUTHOR - Ewan Birney
61
61
 
74
74
 
75
75
package Bio::Annotation::Collection;
76
76
 
77
 
use vars qw(@ISA);
78
77
use strict;
79
78
 
80
79
# Object preamble - inherits from Bio::Root::Root
81
80
 
82
 
use Bio::AnnotationCollectionI;
83
 
use Bio::AnnotationI;
84
 
use Bio::Root::Root;
85
81
use Bio::Annotation::TypeManager;
86
82
use Bio::Annotation::SimpleValue;
87
83
 
88
84
 
89
 
@ISA = qw(Bio::Root::Root Bio::AnnotationCollectionI Bio::AnnotationI);
 
85
use base qw(Bio::Root::Root Bio::AnnotationCollectionI Bio::AnnotationI);
90
86
 
91
87
 
92
88
=head2 new
244
240
   my ($self,$key,$object,$archetype) = @_;
245
241
   
246
242
   # if there's no key we use the tagname() as key
247
 
   if(ref($key) && $key->isa("Bio::AnnotationI") &&
248
 
      (! ($object && ref($object)))) {
249
 
       $archetype = $object if $object;
 
243
   if(ref($key) && $key->isa("Bio::AnnotationI") && (!ref($object))) {
 
244
       $archetype = $object if defined($object);
250
245
       $object = $key;
251
246
       $key = $object->tagname();
252
 
       $key = $key->name() if $key && ref($key); # OntologyTermI
 
247
       $key = $key->name() if ref($key); # OntologyTermI
253
248
       $self->throw("Annotation object must have a tagname if key omitted")
254
249
           unless $key;
255
250
   }
319
314
    @keys = $self->get_all_annotation_keys() unless @keys;
320
315
    my @anns = $self->get_Annotations(@keys);
321
316
    # flush
322
 
    foreach (@keys) {
323
 
        delete $self->{'_annotation'}->{$_};
 
317
    foreach my $key (@keys) {
 
318
      delete $self->{'_annotation'}->{$key};
 
319
      delete $self->{'_typemap'}->{'_type'}->{$key};
324
320
    }
325
321
    return @anns;
326
322
}