A bioinformatics library for Scala (and Scala.js)
Features
Creating Sequences
genalgo provides implementations for DNA, RNA, and Protein
Any genalgo sequence is an IndexedSeq thus you can use all standard collections methods such as map, filter, etc.
From a string
val myDNA = DNA("AT")
val myRNA = RNA("AU")
val myProtein = Protein("ME")
From bases
val myDNA = DNA(A, T)
val myRNA = RNA(A, U)
val myProtein = Protein(Met, Glu)
From bases (in an IndexedSeq)
val myDNA = DNA(IndexedSeq(A, T))
val myRNA = RNA(IndexedSeq(A, U))
val myProtein = Protein(IndexedSeq(Met, Glu))
Transformations
Complement
myDNA.complement
myRNA.complement
Conversions
DNA to RNA (and vice-versa)
myDNA.toRNA
myRNA.toDNA
RNA to Protein
myRNA.toProtein
Alignment
Protein("PLEASANTLY").align(Protein("MEANLY"), new BLOSUM62(5))
UniProt
Retrieving data from UniProt returns a Future[FASTA] on which you can set callbacks and apply transformations
Uniprot.getFasta("Q9D103")
Example: Aligning the IFM1 protein from mice and humans and generating an image from the alignment
Uniprot.getFasta("Q9D103").zip(Uniprot.getFasta("P13164")).map { case (mouse, human) =>
val alignment = mouse.sequence.align(human.sequence, new BLOSUM62(5))
println(alignment)
alignment.toImageFile(new File("obscurin.png"))
}