fn() calculateProbabilityCalculates the probability of a sequence given a Bernoulli model.
Calculates the probability of a sequence given a Bernoulli model.
Defined in | <seqan/alignment_free.h> |
---|---|
Signature |
void calculateProbability(probability, sequence, bgFrequencies);
|
Parameters
probability
|
Probability (double) of the sequence given the model. |
---|---|
sequence
|
String, usually of Dna characters. |
bgFrequencies
|
String of background frequencies (double) representing the model. |
Detailed Description
Examples
Calculate the probability for the word CCCAAGTTT with p(A) = p(T) = 0.3 and p(C) = p(G) = 0.2.
using namespace seqan;
double p = 0.0;
DnaString word = "CCCAAGTTT";
String<double> model;
resize(model, 4);
model[0] = 0.3; // p(A)
model[1] = 0.2; // p(C)
model[2] = 0.2; // p(G)
model[3] = 0.3; // p(T)
calculateProbability(p, word, model); // p = 3.888e-06
Data Races
Thread safety unknown!