BioPerl:批量转换序列格式

$inputfile="E:/perltest/SequenceExactInfo.fasta";
$format1="fasta";
$outputfile="E:/perltest/SequenceExactInfo2.gb";
$format2="genbank";
#定义输入输出文件的名称和格式等,输入文件已知为fasta格式的数据文件


use Bio::SeqIO;
$in=Bio::SeqIO->new(-file=>"$inputfile",-format=>"$format1");
#建立文件句柄,将内容存储在变量中
$out=Bio::SeqIO->new(-file=>">$outputfile",-format=>"$format2");
#建立文件句柄,将内容输出
while($seq=$in->next_seq()){
#逐次读取单一序列存入变量中
$out->write_seq($seq);
}