Rosalind Problems in Clojure
This weekend I’ve been having a lot of fun working the Bioinformatics problems from Rosalind. Most people work them in Python, but so far they have been very amenable to Clojure except where BioPython libraries are used for access to online databases. The problems have been straightforward so far but I have enjoyed the elegance and brevity that Clojure lends the solutions.
In particular, I like this short translator from RNA sequences to amino acids:
The body of the proteins
table is literally cut-and-pasted from the
problem page (click on “RNA
codon table”). I think it’s a good example of using macros to provide
a little bit of syntactic sugar to make the code just a little more
readable and elegant.
This and my other solutions so far are up on GitHub.
blog comments powered by Disqus