Module nimna_fold

Module nimna_fold

Fold

This module contains all procedures for folding a Compound. That is, minimum free energy folding, partition function folding and centroid folding, for monomers and dimers.

Example usage

Those are a few variations on folding.

import nimna

var
  comp: Compound = compound"..."
  dimer: Compound = dimer("...", "...")

# A few variations on folding.
let
  (E, struc) = comp.mfe # Minimum free energy fold
  (Epf, strucPf) = comp.pf # partition function fold
  (distance, struc) = comp.centroid # ensemble centroid

Procs

proc pf(c: Compound): tuple[E: float, struc: string] {.
raises: [Exception, Exception], tags: []
.}
Partition function folding for a Compound. Returns a tuple of ensemble energy and secondary structure.
proc mfe(c: Compound): tuple[E: float, struc: string] {.
raises: [Exception, Exception], tags: []
.}
Minimum free energy folding for a Compound. Returns a tuple of MFE and secondary structure.
proc mfeWindow(c: Compound; f: File): float {.
raises: [], tags: []
.}
Computes the structure of a compound using a sliding window. The structure is written to a File on the fly.
proc pf2D(c: Compound2D; distance1, distance2: int): PfSolutions {.
raises: [], tags: []
.}
Computes the partition function at all points in secondary structure space with maximum distance1 to one reference structure and maximum distance2 to another.
proc mfe2D(c: Compound2D; distance1, distance2: int): MfeSolutions {.
raises: [], tags: []
.}
Computes the Mfe structure, as well as its free energy at all points in secondary structure space with maximum distance1 to one reference structure and maximum distance2 to another.
proc pfDimer(c: Compound): tuple[E: DimerEnergies, struc: string] {.
raises: [Exception, Exception], tags: []
.}
Partition function folding for a Compound (dimer). Returns a tuple of ensemble energy and secondary structure.
proc mfeDimer(c: Compound): tuple[E: float, struc: string] {.
raises: [Exception, Exception], tags: []
.}
Minimum free energy folding for a Compound (dimer). Returns a tuple of MFE and secondary structure.
proc centroid(c: Compound): tuple[dist: float, struc: string] {.
raises: [Exception], tags: []
.}
Computes the centroid structure of an ensemble stored in a Compound, returning a tuple of the mean distance from that structure in the ensemble and the centroid structure itself. A computation of the partition function will be done, if no base pairing probabilities exist.
proc centroid(p: Probabilities): tuple[dist: float, struc: string] {.
raises: [], tags: []
.}
Computes the centroid structure of an ensemble stored in a Probabilities object.