![]() |
|
We don't bite newbies here... much | |
PerlMonks |
regex record separator is certainly possibleby inq123 (Sexton) |
on Mar 20, 2005 at 01:33 UTC ( #440966=note: print w/replies, xml ) | Need Help?? |
but certainly not recommended. :) Using File::Stream one could set $/ to regex, but this approach suffers from several caveats and I wouldn't recommend it. Aside from this, the suggestions above are quite good and covered most what I would suggest. But just to add a bit value to the discussion, purely IMHO, the best approach (as already suggested) might be to use bioperl, 'cause who doesn't want to have somebody else taking care of any format change and deal with potential problems therein? :) Another thing is that set $/ = "\n>" is a correct approach, but ">" is not since FASTA format does not demands that seq description not have '>' in it. I would also certainly set performance as the highest priority in dealing with FASTA format (if I choose not to use Bioperl for some reason) thus code like the following would be an OK alternative to using bioperl:
Now the above solution is all good, until you consider using it on a FASTA file generated on Mac. So maybe we need File::Stream after all? But it is not solution for huge files. So maybe we just use Bioperl and hope they had dealt with this issue? Or maybe I'm just making this simple issue sounding more and more complicated? Now that's my only gift. :) Still, hope it helps. ;) Updated
In Section
Seekers of Perl Wisdom
|
|