I have this code
use warnings;
use Getopt::Long;
use Bio::SeqIO;
GetOptions("in=s" => \$file) or die("Error in command line arguments\n");
open $new3, ">", "sequences_tmp.tab";
$seqin = Bio::SeqIO->new(-file => $file, -format => "Fasta");
$seqout = Bio::SeqIO->new(-file => ">$new3", -format => "tab");
while ($seq = $seqin->next_seq()) {
$seqout->width($seq->length);
$obj = $seq->id ."\t".$seq->seq()."\n";
$seqout->write_seq($obj);
}
close $new3;
expecting to print the sequences this way seq_id TAB sequence
. However, this code prints an empty file. Do you know what's going on?