[Bioperl-l] BioPerl and empty sequences

Kris Boulez krbou@pgsgent.be
Wed, 30 Aug 2000 11:28:19 +0200

From looking at the sources (in bioperl-live) it looks that BioPerl
isn't happy with 'empty' sequences (ie. containing 0 nucleotides).

Looking at PrimarySeq.pm ( $seq contains the sequence characters and is
empty in this case, not undefined) (around line 195)

  $seq     && $self->seq($seq);

Even if we get to the seq method we wouldn't survive the following
(around line 220)

       if( $value !~ /^[A-Za-z\-\.\*]+$/ ) {
           $obj->throw("Attempting to set the sequence to [$value] which
does not look healthy");

May I ask what the reason is why the Seq object is created, but the
sequence cannot be empty. I ask because I would have expected
$seq->length() on an empty sequence to return '0' and not fail. Now when
gets 'use of unitialized value, ...' and not a BioPerl warning.

If there is a fundemental reason for this, can someone provide an easy
test (apart from opening the file myself) from within BioPerl  ?