[Bioperl-l] gcg.pm

Jason Stajich jason at cgt.duhs.duke.edu
Fri Oct 31 08:24:48 EST 2003


Go ahead and submit it as a bug at http://bugzilla.open-bio.org/ so that
we have a record of this and someone who wants to jump in and fix simple
bugs can do so.

You can also just change the line
 my $comment     = $seq->desc;
to
 $comment = '' unless defined $comment;
To get rid of the warning.

Note that the GCG output is still clean and usuable, you're just getting
warnings to STDERR.

The more sophisticated soln you propose would be a pretty simple
if / elsif based on $seq->alphabet

I would love to see people submitting code patches too when it
something pretty straight forward like this...

-jason
On Fri, 31 Oct 2003, Derek Gatherer wrote:

> 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
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

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


More information about the Bioperl-l mailing list