in reply to File::Wrap and Fasta format
Here's another shorter regex (although it's not doing any substitution):
The fastest way I've found of dumping a FASTA sequence (with very large sequences, anyways), is with substr:
- robsv
... print $fh ">$description\n"; print $fh "$_\n" foreach ($seq =~ /.{1,50}/g); ...
The fastest way I've found of dumping a FASTA sequence (with very large sequences, anyways), is with substr:
The thing to watch here is that it's destructive - $seq will be empty when it finishes.... print $fh ">$description\n"; print $fh substr($seq,0,50,'') . "\n" while ($seq); ...
- robsv
In Section
Cool Uses for Perl