[BioSQL-l] BioSQL-l Digest, Vol 79, Issue 1

Chris Fields cjfields at illinois.edu
Thu Jan 6 12:20:29 UTC 2011


On Jan 6, 2011, at 4:34 AM, Peter wrote:

> On Thu, Jan 6, 2011 at 5:19 AM, 徐朋 <xupeng86 at gmail.com> wrote:
>> 
>> It seems that Bioperl don't have such scripts which can convert genbank
>> files to .fna/.ffn/.faa etc  fasta format, isn't it ?
>> Bio::SeqIO seems can't tackle this problem.
> 
> Try asking on the BioPerl mailing list - I'm sure it can be done.
> 
> Peter

See the BioPerl SeqIO HOWTO for this:

http://www.bioperl.org/wiki/HOWTO:SeqIO

Basically:

    # create one SeqIO object to read in,and another to write out
    my $seq_in = Bio::SeqIO->new('-file' => "<$infile",
                                 '-format' => $infileformat);
    my $seq_out = Bio::SeqIO->new('-file' => ">$outfile",
                                  '-format' => $outfileformat);
    
    # write each entry in the input file to the output file
    while (my $inseq = $seq_in->next_seq) {
       $seq_out->write_seq($inseq);
    }

You may have to configure the sequence display ID and description to suit your needs.

chris



More information about the BioSQL-l mailing list