Nussinov78- Nussinov78 using the ADPfusion library.

Safe HaskellNone




Strict, scalar nussinov78 algorithm.



nussinov78 :: MkPrimary a => a -> [Backtrace]Source

Simple RNA folding with basepair maximization.

nussinov78Fill :: Primary -> ST s (Arr0 DIM2 Int)Source

The actual Nussinov78 folding algorithm.

fillTable :: PrimMonad m => MArr0 (PrimState m) DIM2 Int -> (DIM2 -> m Int) -> m ()Source

Fill the single table with values in an orderly fashion. The order in which we fill depends on the algorithm.

base' :: Primary -> DIM2 -> Scalar NucSource

Request the single character enclosed by (i,i+1), with i+1==j

empty :: DIM2 -> Scalar BoolSource

True, if the subword at ij is empty.

nil :: Bool -> IntSource

The base case of our recursion.

left :: Nuc -> Int -> IntSource

A single nucleotide to the left. Note that x is monadic. In nussinov we are in the ST monad, here we just know that we are in a monad.

right :: Int -> Nuc -> IntSource

A single nucleotide to the right.

pair :: Nuc -> Int -> Nuc -> IntSource

Pair function

split :: Int -> Int -> IntSource

Combine the partition of x next-to y.

basepair :: MkViennaPair (t, t1) => t -> t1 -> BoolSource

Determine if two characters form a legal basepair.

h :: (Monad m, Ord a) => Stream m a -> m aSource

the grammar makes sure that we at least have nil in the stream

backtrace secondary structures