[Bioperl-l] Re: newbie needs help with read/write Genbank

Jonathan Miller millerj at bcm.tmc.edu
Tue Apr 5 00:29:42 EDT 2005


One might have hoped this code would read and write
a Genbank file, unchanged. But no. how then?
-------------------------------------------------------

use Bio::SeqIO;

my $infile=shift;
$in  = Bio::SeqIO->new(-file => $infile,
                       -format => 'GenBank'
                        );
my $outfile= ">" . $infile . ".gbk";
$out = Bio::SeqIO->new(-file => $outfile,
                       -format => 'GenBank'
                        );

while ( $seq = $in->next_seq() ) {
 $out->write_seq($seq);
}





More information about the Bioperl-l mailing list