RNAFold-0.0.2.1: RNA secondary structure prediction

BioInf.RNAFold.Functions

Description

These functions are implementations of RNA secondary structure folding as described in Bompfuenewere et al., 2006, Variations on RNA folding and alignment

We have all the facilities needed for folding with the RNA parameter of Turner 2004 http:rna.urmc.rochester.eduNNDBturner04/ but consider only double dangles which correspond to the ViennaRNA package option -d2. They are a bit easier to implement and are what is used for partition function calculations. In addition, it seems unlikely to see a statiscally relevant improvement in predication with -d1 or -d3.

All functions work on an algebraic ring structure. This should make it easier to implement certain functionality without having to rewrite all the functions given here. Try deriving a new Ring instance first and see if it just works.

These functions do quite well, performancewise. GHC-HEAD with -Odph and -fllvm takes 14.4s, while the highly optimized viennaRNA package (the yet unpublished 2.0 version) takes about 1-2s on a sequence of length 1000.

NOTE For GHC <= 6.12.3 you should copy the default instances into your instance BLA, otherwise the resulting code will be slow. Or you could just wait for the new GHC to arrive! The new one produces good code without such stuff.

TODO single nucleotide bulges: http:rna.urmc.rochester.eduNNDBturner04/bulge.html , check what Vienna 2.0 does!

Synopsis

Documentation

class (Show a, Ring a, Unbox a, Prim a) => FoldFunctions a whereSource

The folding functions. It could happen that we need different folding functions with the same type, hence the class-based approach. The default instance uses the usual ring methods.

Methods

stackOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

stackIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

hairpinOpt :: TurnerTables a -> Primary -> Int -> Int -> aSource

hairpinIdx :: TurnerTables a -> Primary -> Int -> Int -> [a]Source

largeInteriorLoopOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

largeInteriorLoopIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

tabbedInteriorLoopOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

tabbedInteriorLoopIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

bulgeLOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

bulgeLIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

bulgeROpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

bulgeRIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

interior1xnLOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

interior1xnLIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

interior1xnROpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

interior1xnRIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

multibranchIJLoopOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

multibranchIJLoopIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

multibranchUnpairedJOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

multibranchUnpairedJIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

multibranchKJHelixOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

multibranchKJHelixIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Int, a)]Source

multibranchAddKJHelixOpt :: TurnerTables a -> Primary -> Table a -> Table a -> Int -> Int -> aSource

multibranchAddKJHelixIdx :: TurnerTables a -> Primary -> Table a -> Table a -> Int -> Int -> [(Int, a)]Source

multibranchCloseOpt :: TurnerTables a -> Primary -> Table a -> Table a -> Int -> Int -> aSource

multibranchCloseIdx :: TurnerTables a -> Primary -> Table a -> Table a -> Int -> Int -> [(Int, a)]Source

externalLoopOpt :: TurnerTables a -> Primary -> Table a -> Int -> Int -> aSource

externalLoopIdx :: TurnerTables a -> Primary -> Table a -> Int -> Int -> [(Cell, a)]Source

externalAddLoopOpt :: TurnerTables a -> Primary -> Table a -> Table a -> Int -> Int -> aSource

externalAddLoopIdx :: TurnerTables a -> Primary -> Table a -> Table a -> Int -> Int -> [(Int, a)]Source

calcNinio :: a -> a -> Int -> aSource

Calculate the ninio asymmetric malus. Can not be written using ring functions alone as a min or max functions is required.

calcTermAUSource

Arguments

:: a 
-> ViennaPair 
-> a

Apply terminal AU penalty

Applies a terminal AU/GU penalty, where required.

TODO shouldn't this be just: if CG||GC then one else termAU?

calcLargeLoop :: Int -> aSource

large hairpin loops >30 require special calculations that involve floor, rounding and other stuff that can not be handled by the Ring class alone

type Table a = PrimArray Cell aSource

ringSumL :: (Ring a, Unbox a) => [a] -> aSource

riap :: (Num a, Ix a, Bounded a) => PrimArray a Nucleotide -> a -> a -> ViennaPairSource

ringProductL :: (Ring a, Unbox a) => [a] -> aSource