Function Repository Resource:

RNAFoldingFreeEnergyChange

Source Notebook

Calculate the free energy changes for folding one RNA strand using nearest neighbor parameters

Contributed by: Björn Zimmermann

ResourceFunction["RNAFoldingFreeEnergyChange"][biosequence]

calculates the free energy change for one folded RNA BioSequence strand.

ResourceFunction["RNAFoldingFreeEnergyChange"][biosequence, options]

calculates the free energy change for one folded RNA BioSequence strand with optional insights.

Details and Options

ResourceFunction["RNAFoldingFreeEnergyChange"] uses the current set of nearest neighbor parameters for RNA compiled by the Turner group. In this set, free energy changes at have been estimated, allowing for structure prediction at arbitrary temperature.
Supported structures include base pair stack, dangling end, terminal mismatch, hairpin loop, bulge loop, internal loop, coaxial stack, and multibranch loop. Neither pseudoknots nor multiple/hybrid strands are supported.
Both Watson-Crick base pairs and GU base pairs (so-called "wobble base pairs") are supported.
ResourceFunction["RNAFoldingFreeEnergyChange"] supports a Method option, which can be set to any of the following:
Automaticcalculate free energy change
"Structures"identify substructures with connected indices
"StructuresWithEnergy"identify substructures with connected indices, and calculate their respective free energy changes

Examples

Basic Examples (4) 

Predict the free energy change for a given folded BioSequence:

In[1]:=
ResourceFunction["RNAFoldingFreeEnergyChange"][
 BioSequence["RNA", "CCGCAGUCACACCAGCG", Bond /@ {{3, 16}, {4, 15}, {6, 12}, {7, 11}}]]
Out[1]=

Visualize the BioSequence with BioSequencePlot:

In[2]:=
BioSequencePlot[
 BioSequence["RNA", "CCGCAGUCACACCAGCG", Bond /@ {{3, 16}, {4, 15}, {6, 12}, {7, 11}}]]
Out[2]=

Return a breakdown of the various structures:

In[3]:=
ResourceFunction["RNAFoldingFreeEnergyChange"][
 BioSequence["RNA", "CCGCAGUCACACCAGCG", Bond /@ {{3, 16}, {4, 15}, {6, 12}, {7, 11}}], Method -> "Structures"]
Out[3]=

Predict respective free energy changes for the various structures:

In[4]:=
ResourceFunction["RNAFoldingFreeEnergyChange"][
 BioSequence["RNA", "CCGCAGUCACACCAGCG", Bond /@ {{3, 16}, {4, 15}, {6, 12}, {7, 11}}], Method -> "StructuresWithEnergy"]
Out[4]=
In[5]:=
Total[%[[All, 3]]]
Out[5]=

Possible Issues (2) 

Possible base pairs can yield invalid nearest neighbor structures and ultimately in an Indeterminate result:

In[6]:=
ResourceFunction["RNAFoldingFreeEnergyChange"][
 BioSequence["RNA", "CCGCAGUCACACCAGCG", Bond /@ {{4, 6}}]]
Out[6]=

A more detailed look:

In[7]:=
ResourceFunction["RNAFoldingFreeEnergyChange"][
 BioSequence["RNA", "CCGCAGUCACACCAGCG", Bond /@ {{4, 6}}], Method -> "Structures"]
Out[7]=

Visual inspection of the BioSequence with Graph:

In[8]:=
With[{len = StringLength[#[[2]]]}, Graph[Labeled[#, #] & /@ Range[len], DeleteDuplicates[
     Join[(# <-> (# + 1)) & /@ Range[len - 1], (#1 <-> #2) & @@@ #[[3, All, 1]]]], GraphLayout -> {"SpringEmbedding", "Multilevel" -> "MaximalIndependentVertexSet"}]] &@
 BioSequence["RNA", "CCGCAGUCACACCAGCG", Bond /@ {{4, 6}}]
Out[8]=

Pseudoknots are not supported:

In[9]:=
ResourceFunction["RNAFoldingFreeEnergyChange"][
 BioSequence["RNA", "CUCGUCUAGUCAUUUCUGGCCCCACUGGAGGUCGAG", Bond /@ {{4, 20}, {5, 19}, {8, 17}, {9, 16}, {14, 35}, {15, 34}, {22, 28}, {23, 27}}]]
Out[9]=

Closer inspection of the respective BioSequence:

In[10]:=
With[{len = StringLength[#[[2]]]}, Graph[Labeled[#, #] & /@ Range[len], DeleteDuplicates[
     Join[(# <-> (# + 1)) & /@ Range[len - 1], (#1 <-> #2) & @@@ #[[3, All, 1]]]], GraphLayout -> {"SpringEmbedding", "Multilevel" -> "MaximalIndependentVertexSet"}]] &@
 BioSequence["RNA", "CUCGUCUAGUCAUUUCUGGCCCCACUGGAGGUCGAG", Bond /@ {{4, 20}, {5, 19}, {8, 17}, {9, 16}, {14, 35}, {15, 34}, {22, 28}, {23, 27}}]
Out[10]=

Version History

  • 1.0.1 – 06 December 2021

Source Metadata

Related Resources

License Information