Hacker News new | past | comments | ask | show | jobs | submit login
Reading DNA and Count Bases in Raku – Suman Khanal (sumankhanal.netlify.app)
5 points by lizmat 11 months ago | hide | past | favorite | 1 comment



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/... . 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

In principle, since it does more work closer to the machine, it should be faster. I haven't tested it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: