cp_expected_distance#

RNAdist.dp.cpedistance.cp_expected_distance(sequence, md=None)#

Calculate the expected Distance Matrix using the clote-ponty algorithm.

Clote, P., Ponty, Y., & Steyaert, J. M. (2012). Expected distance between terminal nucleotides of RNA secondary structures. Journal of mathematical biology, 65(3), 581-599.

https://doi.org/10.1007/s00285-011-0467-8

Parameters:
  • sequence (str) – RNA sequence of size N

  • md (RNA.md) – ViennaRNA model details object

Returns:

N x N matrix

containing expected distance from nucleotide 0 to n at matrix[0][-1]

Return type:

np.ndarray

Warning

Experimental function. might not work if your numpy version doesnt match the numpy version the C extension was compiled with

You can calculate this using the default model details from ViennaRNA like this

>>> seq = "GGGCUAUUAGCUCAGUUGGUUAGAGCGCACCCCUGAUAAGGGUGAGGUCGCUGAUUCGAAUUCAGCAUAGCCCA"
>>> x = cp_expected_distance(seq)
>>> x[0, -1]
2.0040000903244186

By including a model details object in the function call you can change settings for e.g. the temperature

>>> seq = "GGGCUAUUAGCUCAGUUGGUUAGAGCGCACCCCUGAUAAGGGUGAGGUCGCUGAUUCGAAUUCAGCAUAGCCCA"
>>> md = RNA.md(temperature=35.4)
>>> x = cp_expected_distance(seq, md=md)
>>> x[0, -1]
2.0025985167453437