in reply to Re: Re: very basic, just beginning
in thread very basic, just beginning
In that case, Bioperl is even better...
Run it in the same way, with an argument of *.txtuse Bio::SeqIO; while (my $fname = shift) { ## raw is one seq per line (no newlines) my $in = Bio::SeqIO->new(-file => "$fname", '-format' => 'raw'); $fname =~ s{\.txt}{}' # strip .txt my $outfile = $fname . ".fa"; my $out = Bio::SeqIO->new(-file => "> $outfile" , '-format' => 'fasta'); ## Do the conversion while ( my $seq = $in->next_seq() ) { $seq->display_id($fname); # Add a name $out->write_seq($seq); } }
|
|---|