RNAFold- RNA secondary structure prediction

Safe HaskellSafe-Infered



A set of energy functions that are modelled after the ViennaRNA package, Version 2 (with d=2).

As part of the design, we could have (i) either continued giving many parameters or (ii) have fewer parameters that require input of the (Primary,Index,Index) type. Since the compilation speed of the grammars using these functions depends on the number of arguments (in case (i) compilation takes minutes!), this approach has benefits for testing the fusion library.

This means compilation is a lot faster, but runtime is not 2.8x slower but 3.5x slower.



hairpinF :: Vienna2004 -> (Nuc :!: Nuc) -> ((Primary :!: Int) :!: Int) -> (Nuc :!: Nuc) -> IntSource

Hairpin structures. Hairpins with less than 3 unpaired nucleotides are forbidden.

NOTE (xs,i,j) is indeed *only* the unpaired stretch. Hence, the length is j-i+1, as given.

TODO Activate tabulated hairpin structures.

tinyloopF :: Vienna2004 -> ((Primary :!: Int) :!: Int) -> Int -> ((Primary :!: Int) :!: Int) -> IntSource

Tiny loops are small interior loops. This includes canonical stacks without any unpaired nucleotides, and small, tabulated interior loops.

bulgeLF :: Vienna2004 -> ((Primary :!: Int) :!: Int) -> Int -> (Nuc :!: Nuc) -> IntSource

A left bulge (....[[...]]) which four unpaired nucleotides in the bulge. the left bulge ls will be given six nucleotides (note, ls is the complete input, use li and lj as the first and last included nucleotide index), the two outer ones being for the outer and inner loop. On the right, we have rp and r which are nucleotides. ls!(Z:.li) and r form the outer Vienna pair. rp and ls!(Z:.lj) form the inner pair.

bulgeRF :: Vienna2004 -> (Nuc :!: Nuc) -> Int -> ((Primary :!: Int) :!: Int) -> IntSource

A right bulge ([[...]]....). See bulgeLF for how this works.

iloopN1F :: Vienna2004 -> ((Primary :!: Int) :!: Int) -> Int -> ((Primary :!: Int) :!: Int) -> IntSource

An interior loop with N unpaired nucleotides to the left and 1 unpaired nucleotide to the right. The regions ls and rs each have 2 nucleotides more than are unpaired. These first and last nucleotides form the last paired or first pairs in the stacks around the loop.

iloop1NF :: Vienna2004 -> ((Primary :!: Int) :!: Int) -> Int -> ((Primary :!: Int) :!: Int) -> IntSource

1xN interior loops.

bsF :: Int -> Int -> IntSource

rSF :: Nuc -> Int -> IntSource

bcF :: Int -> Int -> IntSource

cmF :: Int -> Int -> IntSource

iD :: a -> aSource

h :: Monad m => Stream m Int -> m IntSource

terminalAU :: Num a => a -> ViennaPair -> aSource