in reply to Re: A strange error message with Bio::SeqIO
in thread A strange error message with Bio::SeqIO

Hi Khen1950fx, thank you for your help. I have copyed you code, and run on my computer(just change the path of the file). However I get the same error message, "the sequence does not to be FASTA format(lacks a descriptor line '>')". The code I run as following:

#!/localperl/bin/perl use strict; use warnings; use Bio::SeqIO; my $in = Bio::SeqIO->new( -file => "/home/zhaoy/document/perl/lwp/seq.fasta", -format => 'FASTA'); my $out = Bio::SeqIO->new( -file => ">/home/zhaoy/document/perl/lwp/new_out.log", -format => "EMBL" ); while ( my $seq = $in->next_seq() ) { print $out->write_seq($seq), "\n"; }

I receive the error message:

------------- EXCEPTION: Bio::Root::Exception ------------- MSG: The sequence does not appear to be FASTA format (lacks a descript +or line '>') STACK: Error::throw STACK: Bio::Root::Root::throw /localperl/lib/site_perl/5.12.4/Bio/Root +/Root.pm:368 STACK: Bio::SeqIO::fasta::next_seq /localperl/lib/site_perl/5.12.4/Bio +/SeqIO/fasta.pm:127 STACK: tmhmm.pl:12 -----------------------------------------------------------

The same program, gain different results. Maybe the problem is that the installation of bioperl. But I am not sure.

Replies are listed 'Best First'.
Re^3: A strange error message with Bio::SeqIO
by Khen1950fx (Canon) on Aug 26, 2011 at 13:27 UTC
    You probably didn't use the corrected sequence that I gave you:).

      Wow, it's work! I download you sequence and save as 'seq.fasta'. The program not report error message any more and export the expected result. I want to know what the difference bettween the sequences? what I should modify my sequence? Thank you very much!

        Both the sequences are corrupt. Your sequence was missing the brackets
        Escherichia coli str. K-12 substr. MG1655
        In order to get it to produce some output, I added some brackets
        [Escherichia coli str. K-12 substr. MG1655]