mfe

package
v0.0.0-...-e8a583a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	// DefaultTemperature is the temperature in Celsius for free energy evaluation
	DefaultTemperature float64 = 37.0
)

Variables

This section is empty.

Functions

func EvaluateExteriorStem

func EvaluateExteriorStem(basePairType energy_params.BasePairType, fivePrimeMismatch int, threePrimeMismatch int, energyParams *energy_params.EnergyParams) int

Evaluate a stem branching off the exterior loop.

Given a base pair (i,j) (encoded by `energy_params.BasePairTypeEncodedInt()`), compute the energy contribution including dangling-end/terminal-mismatch contributions.

You can prevent taking 5'-, 3'-dangles or mismatch contributions into account by passing -1 for `fivePrimeMismatch` and/or `threePrimeMismatch` respectively.

@param basePairType The encoded base pair type of (i, j) (see `energy_params.EncodeBasePair()`) @param fivePrimeMismatch The encoded nucleotide directly adjacent (in the 5' direction) to i (may be -1 if index of i is 0) @param threePrimeMismatch The encoded nucleotide directly adjacent (in the 3' direction) to j (may be -1 if index of j is len(sequence) - 1) @param energyParams The pre-computed energy parameters @return The energy contribution of the exterior-loop stem

func EvaluateHairpinLoop

func EvaluateHairpinLoop(size int, basePairType energy_params.BasePairType, fivePrimeMismatch, threePrimeMismatch int, sequence string, energyParams *energy_params.EnergyParams) int

Compute the energy of a hairpin loop.

To evaluate the free energy of a hairpin loop, several parameters have to be known. A general hairpin-loop has this structure:

  a3 a4
a2     a5
a1     a6
  X - Y
  |   |
  5'  3'

where X-Y marks the closing pair [e.g. a (G,C) pair]. The length of this loop is 6 as there are six unpaired nucleotides (a1-a6) enclosed by (X,Y). The 5' mismatching nucleotide is a1 while the 3' mismatch is a6. The nucleotide sequence of this loop is [a1 a2 a3 a4 a5 a6] @note The parameter `sequence` should contain the sequence of the loop in capital letters of the nucleic acid alphabet if the loop size is below 7. This is useful for unusually stable tri-, tetra- and hexa-loops which are treated differently (based on experimental data) if they are tabulated.

More information available at: https://rna.urmc.rochester.edu/NNDB/turner04/hairpin.html

@param size The size of the hairpin loop (number of unpaired nucleotides) @param basePairType The pair type of the base pair closing the hairpin @param fivePrimeMismatch The 5'-mismatching encoded nucleotide @param threePrimeMismatch The 3'-mismatching encoded nucleotide @param sequence The sequence of the loop @param energyParams The datastructure containing scaled energy parameters @return The free energy of the hairpin loop in dcal/mol

func EvaluateMultiLoopStem

func EvaluateMultiLoopStem(basePairType energy_params.BasePairType, fivePrimeMismatch, threePrimeMismatch int, energyParams *energy_params.EnergyParams) int

Compute the energy contribution of a multi-loop stem.

Given a base pair (i,j) (encoded by `energy_params.EncodeBasePair()`), compute the energy contribution including dangling-end/terminal-mismatch contributions.

@param basePairType The encoded base pair type of (i, j) (see `energy_params.EncodeBasePair()`) @param fivePrimeMismatch The encoded nucleotide directly adjacent (in the 5' direction) to i (may be -1 if index of i is 0) @param threePrimeMismatch The encoded nucleotide directly adjacent (in the 3' direction) to j (may be -1 if index of j is len(sequence) - 1) @param energyParams The pre-computed energy parameters @return The energy contribution of the introduced multi-loop stem

func EvaluateStemStructure

func EvaluateStemStructure(stemStructureType StemStructureType,
	nbUnpairedFivePrime, nbUnpairedThreePrime int,
	closingBasePairType, enclosedBasePairType energy_params.BasePairType,
	closingFivePrimeMismatch, closingThreePrimeMismatch,
	enclosedThreePrimeMismatch, enclosedFivePrimeMismatch int,
	energyParams *energy_params.EnergyParams) int

EvaluateStemStructure computes the energy of either a stacking pair, bulge, or interior loop. This function computes the free energy of a loop with the following structure:

    3'  5'
    |   |
    U - V
a_n       b_1
 .        .
 .        .
 .        .
a_1       b_m
    X - Y
    |   |
    5'  3'

This general structure depicts an interior loop that is closed by the base pair (X,Y). The enclosed base pair is (V,U) which leaves the unpaired bases a_1-a_n and b_1-b_n that constitute the loop. The base pair (X,Y) will be referred to as `closingBasePair`, and the base pair (U,V) will be referred to as `enclosedBasePair`. In this example, the length of the interior loop is `n+m` where n or m may be 0 resulting in a bulge-loop or base pair stack. The mismatching nucleotides for the closing pair (X,Y) are:

5'-mismatch: a_1
3'-mismatch: b_m

and for the enclosed base pair (V,U):

5'-mismatch: b_1
3'-mismatch: a_n

@note Base pairs are always denoted in 5'->3' direction. Thus the `enclosedBasePair` must be 'turned around' when evaluating the free energy of the interior loop More information about

@param stemStructureType The type of the stem structure (StackingPair, Bulge, InteriorLoop, etc.) to evaluate @param nbUnpairedFivePrime The number of unpaired nucleotide in the five prime end of the loop @param nbUnpairedThreePrime The number of unpaired nucleotide in the three prime end of the loop @param closingBasePairType The encoded type of the closing base pair of the interior loop @param enclosedBasePairType The encoded type of the enclosed base pair @param closingFivePrimeMismatch The 5'-mismatching encoded nucleotide of the closing pair @param closingThreePrimeMismatch The 3'-mismatching encoded nucleotide of the closing pair @param enclosedThreePrimeMismatch The 3'-mismatching encoded nucleotide of the enclosed pair @param enclosedFivePrimeMismatch The 5'-mismatching encoded nucleotide of the enclosed pair @param energyParams The datastructure containing scaled energy parameters @return The Free energy of the Interior-loop in dcal/mol

func MinimumFreeEnergy

func MinimumFreeEnergy(sequence, dotBracketStructure string, temperature float64, energyParamsSet energy_params.EnergyParamsSet, danglingEndsModel DanglingEndsModel) (mfe float64, secondaryStructureWithEnergy *SecondaryStructure, err error)
 MinimumFreeEnergy returns the free energy of an already folded RNA. For

 @param sequence         		A RNA sequence
 @param dotBracketStructure  Secondary structure in dot-bracket notation
 @param temperature      		Temperature at which to evaluate the free energy
															 of the structure

@param energyParamSet Specify the paper from which to use energy

															parameters from
 @param danglingEndsModel  	Specify whether to include energy from dangling
															ends (`NoDanglingEnds` or `DoubleDangles`)
 @return                 		The free energy of the input structure given the
															input sequence in kcal/mol, and
															`SecondaryStructure` of the input RNA with
															the energy fields of the struct set to the
															relevant values
Example
mfe, _, _ := MinimumFreeEnergy("ACGAUCAGAGAUCAGAGCAUACGACAGCAG", "..((((...))))...((........))..", DefaultTemperature, energy_params.Turner2004, DefaultDanglingEndsModel)
fmt.Println(mfe)
Output:

-2.9

Types

type DanglingEndsModel

type DanglingEndsModel int

DanglingEndsModel specifies the model of dangling ends to use in the free energy calculations. Dangling ends are bases adjacent to helices in free ends and multiloops. The available dangling ends model are `NoDanglingEnds` and `DoubleDanglingEnds`.

const (
	// NoDanglingEnds specifies that no stabilizing energies are assigned to bases
	// adjacent to helices in free ends and multiloops
	NoDanglingEnds DanglingEndsModel = 0
	// DoubleDanglingEnds specifies energies due to dangling ends (on both five
	// and three prime sides) should be added to energy calculations.
	// This option gives more favorable energies to helices directly adjacent to
	// one another, which can be beneficial since such helices often do engage in
	// stabilizing interactions through co-axial stacking.
	DoubleDanglingEnds DanglingEndsModel = 2
	// DefaultDanglingEndsModel defaults to DoubleDangles
	DefaultDanglingEndsModel = DoubleDanglingEnds
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL