Module nimna_eval

Module nimna_eval

Eval

This module contains procedures to evaluate the energy of a nucleic acid sequence folded into a particular secondary structure, as well as the difference in energy yielded by adding or removing base pairs to a secondary structure.

Example usage

Let's see if we can evaluate how well a sequence fits to a secondary structure:

import nimna

proc fitness(c: Compound; structure: string): float =
  ## Compute E_structure - E_ensemble.
  let
    targetEnergy = c.eval(structure)
    (ensembleEnergy, _) = c.pf
  return targetEnergy - ensembleEnergy

Procs

proc eval(c: Compound; structure: string): float {.
raises: [], tags: []
.}
Calculates the free energy associated with a secondary structure.
proc eval(c: CompoundComparative; structure: string): float {.
raises: [], tags: []
.}
Calculates the free energy associated with a secondary structure for an alignment of sequences.
proc evalAdd(c: Compound; structure: string; a, b: Natural): float {.
raises: [IndexError], tags: []
.}
Calculates the free energy associated with adding a base pair between bases a and b.
proc evalRemove(c: Compound; structure: string; a, b: Natural): float {.
raises: [IndexError], tags: []
.}
Calculates the free energy associated with removing a base pair between bases a and b.
proc evalMove(c: Compound; structure: string; a, b: int): float {.
inline, raises: [IndexError], tags: []
.}
Calculates the free energy associated with adding or removing a base pair. If one of a, b is positive, a base pair is added. else, a base pair is removed at the positions a, b.