A thermodynamic matcher (TDM) is a specialized RNA folding program. Instead of spanning the complete search space of general RNA folding, a TDM spans only a defined subset of it. This subset might be defined via a graphical description (see Locomotif: From Graphical Motif Description to RNA Motif Search) or via a shape string (see Faster computation of exact RNA shape probabilities).
"Grammars/gra_tdm.gap" is for the later one. Given a shape string of a specific shape level, we have to generate a specialized grammar out of one of the four prototype grammars Grammars/gra_nodangle.gap Grammars/gra_overdangle.gap Grammars/gra_microstate.gap or Grammars/gra_macrostate.gap. This process itself is done with a GAP-L program. So one could say a GAP program generates a GAP program. Due to modularity it only generates the grammar, algebras, signatures and instances could simply be re-used.
Actually, "Grammars/gra_tdm.gap" is not a single grammar, but six of them. They all use Signatures/sig_tdm.gap, but not all functions in all shape levels or with all prototype grammars.
helixinterrupt
function. Fortunately, the difference to level 3 is even more easy. It manifests only in the way the specialized grammar is created, but not on parsing the given shape string. Thus, there is no difference between 4 and 3!helixinterrupt
, we now have leftbulge
, rightbulge
and internalloop
.sadd
, mlsadd
and unpaired
_
. On the other hand, this underscore could also result from a "real" stretch of unpaired bases. The grammar must take care of all these situations.Have a look at the application RapidShapes, to see TDMs in action.