in reply to Can you make this code shorter and/or quicker as well?
Perhaps the following will be helpful:
use strict; use warnings; local $/ = '>'; while (<>) { chomp; my ( $id, $seq ) = /(.+?\n)(.+)/s or next; $seq =~ s/\s+//g; print ">$id$seq\n"; }
Command-line usage: perl script.pl fastaIn [>fastaOut]
The last, optional parameter directs output to a file.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Can you make this code shorter and/or quicker as well?
by Anonymous Monk on Feb 25, 2014 at 00:26 UTC | |
by Anonymous Monk on Feb 25, 2014 at 00:27 UTC | |
by Kenosis (Priest) on Feb 25, 2014 at 00:36 UTC | |
by Anonymous Monk on Feb 25, 2014 at 00:37 UTC |
In Section
Seekers of Perl Wisdom