The GenussFold package

[ Tags: bioinformatics, formal-languages, gpl, library, program ] [ Propose Tags ]

generalized Algebraic Dynamic Programming

Genus-1 RNA pseudoknot grammars implemented with a multiple context-free language. Compared to the usual implementations that are based on explicit recursions, an implementation based on a formal grammar is much more pleasing to write.

Consult the README for details.

[Skip to Readme]


Change log
Dependencies ADPfusion (>= && <0.4.2), ansi-wl-pprint (==0.6.7.*), base (>=4.7 && <4.9), bytestring (==0.10.*), cmdargs (==0.10.*), containers, data-default (==0.5.*), FormalGrammars (==0.2.1.*), GenussFold, lens (>=4.0 && <5.0), mtl (>=2.0 && <3.0), PrimitiveArray (>=0.6.0 && <0.6.2), semigroups (==0.16.*), template-haskell, text (>=1.0 && <1.3), transformers (>=0.3 && <0.5), unordered-containers (==0.2.*), vector (==0.10.*) [details]
License GPL-3
Copyright Christian Hoener zu Siederdissen, 2015
Author Christian Hoener zu Siederdissen, 2015
Category Formal Languages, Bioinformatics
Home page
Bug tracker
Source repository head: git clone git://
Uploaded Thu Jul 16 17:51:09 UTC 2015 by ChristianHoener
Distributions NixOS:
Executables GenussFold
Downloads 303 total (3 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-07-16 [all 1 reports]
Hackage Matrix CI





dump intermediate Core files


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for GenussFold-

[back to package description]

Build Status

GenussFold: RNA Pseudoknot Folding

generalized Algebraic Dynamic Programming Homepage

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
2015, submitted

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:

[[[ ((( ]]] )))

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]

The PKN grammar in GenussFold (for genus-1 structures, but much more pleasurable to write) offers the required features:

  1. state that a syntactic variable is split between two regions <U,U>
  2. state that this split system is linearized and different symbols can be interleaved: U V U V
  3. in addition, we allow syntactic variables of lower dimension (like S) to be used in dimensional stacks of symbols ([S,-]).

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.

Performance comparison

C-code for running time performance comparison is available in the GenussFold github repository. The direct URL is:


Christian Hoener zu Siederdissen
Leipzig University, Leipzig, Germany