Function
calculateProbability
Calculates the probability of a sequence given a Bernoulli model (String of background frequencies)
calculateProbability(probability, sequence, backgroundFrequencies)
Include Headers
seqan/alignment_free.h
Parameters

probability | Probability of the sequence given the model Types: double
sequence | Usually a DNA sequence Types: String
backgroundFrequencies | 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.
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
See Also
calculateCovariance, alignmentFreeComparison, calculateVariance, countKmers
SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2014/10/13 16:12:57