Module nimna_interactionlist

Module nimna_interactionlist

InteractionList

This module implements procedures for the InteractionList and PairList types, which allow to access interactions in a Compound, with their types and probabilities. Such interactions can be base pairs or G-quadruplexes. It also implements maximum expected accuracy folding, based on an InteractionList.

Example usage

We want to extract the maximum expectad accuracy fold of a Compound.

import nimna

var
  c: Compound = ... # The Compound in quesion.
  plist = c.pairList

let
  # Do the folding:
  (accuracy, structure) = plist.mea

Procs

proc pairList(structure: string; probability: float): PairList {.
raises: [], tags: []
.}
Creates a PairList from a dot-bracket secondary structure string together with a weighting probability.
proc pairList(c: Compound; cutoff: float = 1e-06): PairList {.
raises: [Exception], tags: []
.}
Creates a PairList from a Compound, taking into account all base pairs with probability greater than a cutoff. If no probabilities exist, they will be computed.
proc pairList(p: Probabilities; cutoff: float = 1e-06): PairList {.
raises: [], tags: []
.}
Creates a PairList from a set of Probabilities, taking into account all base pairs with probability greater than cutoff.
proc mea(pl: PairList; gamma: float = 1.0'f64): tuple[accuracy: float, struc: string] {.
raises: [Exception, Exception], tags: []
.}
Computes the maximum accuracy structure of an Ensemble stored in a PairList.
proc mea(c: Compound; gamma: float = 1.0'f64): tuple[accuracy: float, struc: string] {.
raises: [Exception], tags: []
.}
Computes the maximum accuracy structure of an Ensemble stored in a Compound. A computation of the partition function will be done, if no ensemble is available.
proc mea(p: Probabilities; gamma: float = 1.0'f64): tuple[accuracy: float, struc: string] {.
raises: [Exception], tags: []
.}
Computes the maximum accuracy structure of an Ensemble stored in a set of Probabilities.

Iterators

iterator items(pl: PairList): PairListItem {.
raises: [], tags: []
.}
Iterates over PairListItems in a PairList.
iterator probabilities(pl: PairList): float {.
raises: [], tags: []
.}
Iterates over probabilities in a PairList.
iterator basePairs(pl: PairList): tuple[i, j: int] {.
raises: [], tags: []
.}
Iterates over base pairs contained in a PairList.
iterator pairs(pl: PairList): tuple[bp: tuple[i, j: int], prob: float] {.
raises: [], tags: []
.}
Iterates over pairs of base pairs and probabilities.
iterator triples(pl: PairList): tuple[i, j: int, prob: float] {.
raises: [], tags: []
.}
Iterates over triples of base positions i, j and their pairing probabilities.

Templates

template `[]`(pl: PairList; idx: int): PairListItem
Bracket accessor for the PairList.