TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Reading DNA and Count Bases in Raku – Suman Khanal

5 pointsby lizmatabout 5 years ago

1 comment

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