sample_pthreshold#

RNAdist.sampling.ed_sampling.sample_pthreshold(sequence, cutoff: float = 0.99, md=None)#

Samples structures for a sequence non-redundantly

Draws structures (S) via non redundant sampling from the ensemble of Structures (ES) until the probability mass of structures reaches cutoff Further calculates the expected distance (ED) for all nucleotide pairs based on the following formula, where D specifies the distance on a given structure S and P(s) is the corresponding probability.

\[ED_{i, j} = \sum_{S \in SE} P(S) × D_{i, j}\]
Parameters:
  • sequence (str) – RNA sequence as a string

  • cutoff (float) – Probability cutoff. If sum of probability of samples structures reaches this sampling stops

  • md (RNA.md) – ViennaRNA model details (Will automatically set uniq_ML to 1 and pf_smooth to 0)

Returns:

N x N matrix

containing approximated expected distances from nucleotide i to j at matrix[i][j]

Return type:

np.ndarray