2 ms·
I wrote bioinformatics software a long time ago. Meaning that I remember reading the bioperl code back to read FASTA files around Y2K. Their technique is still
by dalke 6y ago
I wrote bioinformatics software a long time ago. Meaning that I remember reading the bioperl code back to read FASTA files around Y2K.
Their technique is still in use, at https://github.com/bioperl/bioperl-live/blob/master/lib/Bio/SeqIO/fasta.pm https://github.com/bioperl/bioperl-live/blob/master/lib/Bio/... . The key point is they set the input record separator, like this:
local $/ = "\n>";
This gets Perl to read each FASTA record as a single block, which they then post-process into title and sequence.
Raku has a per-filehandle version, according to https://docs.raku.org/language/5to6-perlvar https://docs.raku.org/language/5to6-perlvar
In principle, since it does more work closer to the machine, it should be faster. I haven't tested it.