Function
calculateProbability
Calculates the probability of a sequence given a Bernoulli model (String of background frequencies)
Include Headers
seqan/alignment_free.h
Parameters
Probability of the sequence given the model Types: double | |
Usually a DNA sequence Types: String | |
String of background frequencies representing the model Types: double |
Return Values
TValue probability; The probability to observe the sequence given the model
Examples
Calculate the probability for the word CCCAAGTTT with p(A)=p(T)=0.3 and p(C)=p(G)=0.2.
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
SeqAn - Sequence Analysis Library - www.seqan.de