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 reachescutoff
Further calculates the expected distance (ED
) for all nucleotide pairs based on the following formula, whereD
specifies the distance on a given structureS
andP(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
matrixcontaining approximated expected distances from nucleotide
i
toj
atmatrix[i][j]
- Return type:
np.ndarray