ViennaRNA folding based on an algebraic ring structure. This should combine the goals of few lines of codes, multiple different folding functions and extensibility.
NOTE Assume that you want '-d 3' for folding with dangles. Then you can just instanciate the folding functions, replacing only those functions where the folding changes based on the new dangle options.
NOTE compile with: -fno-method-sharing
- type ResultTables a = (Table a, Table a, Table a, Table a, Table a)
- type Pairlist = [(Int, Int)]
- class FoldFunctions a => Fold a where
- fold :: TurnerTables a -> Primary -> ResultTables a
- foldST :: TurnerTables a -> Primary -> ST s (ResultTables a)
- backtrack :: TurnerTables a -> Primary -> ResultTables a -> a -> [(Secondary, a)]
Documentation
type ResultTables a = (Table a, Table a, Table a, Table a, Table a)Source
Folding works on unboxed values of a Ring-type for which a FoldFunctions instance does exist. By default, we have this for Energy values. Again, we use a class as we could be interested in probabilistic backtracking or something like that.
class FoldFunctions a => Fold a whereSource
fold :: TurnerTables a -> Primary -> ResultTables aSource
foldST :: TurnerTables a -> Primary -> ST s (ResultTables a)Source
backtrack :: TurnerTables a -> Primary -> ResultTables a -> a -> [(Secondary, a)]Source