Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: File::Wrap and Fasta format

by robsv (Curate)
on Mar 25, 2003 at 21:41 UTC ( #245796=note: print w/replies, xml ) Need Help??

in reply to File::Wrap and Fasta format

Here's another shorter regex (although it's not doing any substitution):
... 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:
... print $fh ">$description\n"; print $fh substr($seq,0,50,'') . "\n" while ($seq); ...
The thing to watch here is that it's destructive - $seq will be empty when it finishes.

- robsv

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://245796]
[Corion]: 1nickt: Finding autobox in production would give me pause, yes
[LanX]: efficient survey
[MidLifeXis]: And under MINGW64_NT-6.1 MYHOST 2.6.0(0.304/5/3) 2016-09-09 09:46 x86_64 Msys there seem to be issues with escapes in external build tool calls.
[Corion]: I mean, it's a technical feat it achieves, but... why? ;)
[MidLifeXis]: And it also has the 0.14 version of the tarball in its manifest.
[LanX]: avoiding unreadable brackets
[MidLifeXis]: Although the previous one could be a b0rken PATH, I would need to dig for that.
[thezip]: I've got to go to meetings now. If anyone has further comments regarding Spreadsheet::XLSX deployment to Strawberry Perl 5.24.1, please /msg me -- thanks!
LanX has to go ... plans to crash with a car into a group of pythonistas while screaming "LARRY IS THE GREATEST"
LanX ... darn ... where is my car?

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2017-03-23 17:28 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (291 votes). Check out past polls.