[Bioperl-l] SeqIO/genbank makes false assumption?

Jason Stajich jason at cgt.duhs.duke.edu
Wed May 7 10:34:15 EDT 2003


No the annotation object is always auto-instantiated.  An undef value
should not be returned there.  We should change the SeqI docs to this
effect I think.  If you look at the Seq.pm implementation it guarantees
that a value is always returned (unless someone explicitly calls
$seq->{_annotation} = undef )

Do you think it should be doing something else?  We can still add some
protection code if you are worried about bad implementations of Bio::SeqI
- but I think this should be part of the contract for SeqI and the
interface docs should be updated.

-j

On Tue, 6 May 2003, Mark Wilkinson wrote:

> Hi all,
>
> I've been "out of the loop" for a while w.r.t. BioPerl, so I am nervous
> about fixing this myself before I get confirmation that it is really a
> bug.  I think this line of code from genbank.pm is making a false
> assumption:
>
> Bio::SeqIO::genbank::write_seq(../bioperl-live/Bio/SeqIO/genbank.pm:598):
> 598:		foreach my $ref ( $seq->annotation->get_Annotations('reference') )
>
> According to the SeqIO docs, $seq->annotation is allowed to return
> undef... so I think it should be checking for a return value before it
> calls get_Annotations.
>
> is this correct?
>
> Cheers all!
>
> Mark
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://pw600a.bioperl.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list