MCFGs for Genus-1 RNA Pseudoknots https://github.com/choener/GenussFold
|Latest on Hackage:||0.0.0.2|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
GenussFold: RNA Pseudoknot Folding
The implementation makes use of the gADP technique and provides a larger example on how to implement algorithms that require interleaved, split syntactic variables.
Formal background can be found in this paper:
Maik Riechert, Christian Höner zu Siederdissen, and Peter F. Stadler
Algebraic dynamic programming for multiple context-free languages
As an example, consider palindromic brackets
((())). Given two types of
brackets, these can be interleaved:
((( [[[ ))) ]]]. Such interleaved,
long-range dependencies have been observed in human languages and, in
particular, in RNA bioinformatics.
RNA structures may form so-called pseudoknots, where the RNA structure does not
yield a planar structure (the canonical secondary structure) anymore, but
rather forms graphs with crossing edges. Using the idea of interleaved brackets
and given an input sequence
AAA CCC UUU GGG (with artificial white space to
make this more clear), a pseudoknotted structure may be formed:
AAA CCC UUU GGG [[[ ((( ]]] )))
A formal grammar that parses such a structure requires the ability to denote that a sub-structure has a "hole". We can write such a grammar as follows:
S -> U V U V <U,U> -> [ε,ε] <U,U> -> [S,-] [a,-] <U,U> [-,S] [-,u] <V,V> -> [ε,ε] <V,V> -> [S,-] [c,-] <V,V> [-,S] [-,g]
PKN grammar in GenussFold (for genus-1 structures, but much more
pleasurable to write) offers the required features:
- state that a syntactic variable is split between two regions
- state that this split system is linearized and different symbols can be
U V U V
- in addition, we allow syntactic variables of lower dimension (like
S) to be used in dimensional stacks of symbols (
This system allows writing monotone multiple context-free grammars with good performance -- we are reasonably close to C in running time performance. Reasonable means around a factor of 2 slower.
C-code for running time performance comparison is available in the GenussFold github repository. The direct URL is: https://github.com/choener/GenussFold/blob/master/C/genussfold.c
Christian Hoener zu Siederdissen
Leipzig University, Leipzig, Germany
quickcheck tests for GenussFold
- initial checkin
- preparing travis.yml
- Pseudoknot-enabled Nussinov style RNA folding with basepair maximization.