"Grammars/gra_pknot_microstate.gap" is an extension of the normal folding grammar by pseudoknots. In principal, pseudoknot prediction with an thermodynamic energy model is NP-hard in general. Thus, most programs focus only on a small subset of pseudoknot classes. A further complication is, that pseudoknots cannot be represented as trees, thus we have to "hack" Bellman's GAP to be able to deal with them. "Grammars/gra_pknot_microstate.gap" contains the most frequently known pseudoknots of pknotsRG (H-type pseudoknots) and pKiss (K-type pseudoknots). It uses the microstate way to cope with dangling bases. Pseudoknot components are outsourced into the grammar fragments Grammars/grapart_pkinnars.gap for the free folding parts, Grammars/grapart_pknotsrg.gap for the index hacking for pknotsRG knots, and Grammars/grapart_pkissA.gap for free folding parts and strategy A for knots of type pKiss. See Prediction of RNA secondary structure including kissing hairpin motifs. There are also grammar fragments Grammars/grapart_pkissB.gap, Grammars/grapart_pkissC.gap and Grammars/grapart_pkissD.gap for the remaining three strategies of pKiss, plus Grammars/grapart_pkissBC.gap, which contains some rules used by strategies B and C.
"Grammars/gra_pknot_microstate.gap" serves as prototype grammar for Locomotif.It is a graphical editor, letting you literally draw your favorite RNA motif, and converts this drawing into a highly specialized grammar, which lo longer enumerates the complete folding space, but only those parts defined by your drawing.