[Bioperl-l] gcg.pm

Derek Gatherer d.gatherer at vir.gla.ac.uk
Fri Oct 31 07:13:21 EST 2003


Hi

Please excuse if this is an already known bug.

Seq.pm says you can do this:


# make from strings in script
     $seqobj = Bio::Seq->new( -display_id => 'my_id',
                              -seq => $sequence_as_string);

and then you can do:

     $seq_out->write_seq($seqobj);

which is fine, except if you previously defined a GCG-format IO, eg:

my $seq_out = Bio::SeqIO->new('-file' => ">$outfile", '-format' => "GCG");

in which case you have to do

$seqobj = Bio::Seq->new( -display_id => 'my_id',
                              -seq => $sequence_as_string,
                              -desc => "a description");

Otherwise, you get:

Use of uninitialized value in concatenation (.) or string at 
/usr/local/lib/site_perl/5.8.0//Bio/SeqIO/gcg.pm line 197,

The offending line in gcg.pm is:

197 push(@out,"$comment\n");

which causes offence since:

178     my $comment     = $seq->desc;

If the IO format is FASTA, none of this happens and the output is clean.

I suggest that a default $comment should be used in gcg.pm, which is 
"!!AA_SEQUENCE" or "!!NA_SEQUENCE" depending on sequence type, as that is 
the normal first line in most CGC files.

Cheers
Derek



More information about the Bioperl-l mailing list