|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjbil.sequence.AbstractFixedLengthSequenceModel
jbil.sequence.MarkovFixedLengthSequenceModel
public class MarkovFixedLengthSequenceModel
Probabilistic model for sequences of a fixed length W, in which
they are assumed to be generated from a non-homogeneous Markov chain of
order K, that is
Pr(x1...xW) = prod_{i=1}^W Pr(xi|xi-1...xi-K).
Field Summary | |
---|---|
static int |
PVALUE_BRANCH_AND_BOUND
Branch & bound p-value computation mode. |
static int |
PVALUE_BRUTE_FORCE
Brute force p-value computation mode. |
static int |
PVALUE_ITERATIVE_REFINEMENT
Iterative refinememnt p-value computation mode. |
KMerCounter |
transitionsTree
|
Constructor Summary | |
---|---|
MarkovFixedLengthSequenceModel(Alphabet alphabet,
int length,
int order,
KMerCounter transitionsTree)
Constructs a new K-order Markov sequence model. |
Method Summary | |
---|---|
Alphabet |
getAlphabet()
Returns the base alphabet of the modelled sequences. |
int |
getPvalueMode()
Gets the p-value computation mode. |
int |
length()
Returns the length of the modelled sequences. |
double |
likelihood(Sequence word,
int beginIndex)
Returns the likelihod of the subword of the given word starting at beginIndex and with the appropriate length. |
double |
likelihoodThreshold(double significance,
SequenceModel nullModel)
Given p in [0,1], we define the p-value of p as the as the probability under a null model for a sequence to have a likelihood greater or equal to p. |
double |
positionProbability(int position,
Sequence neighbourhoodSeq,
int beginIndex,
int endIndex,
int letterPosition)
Computes the probability of observing a letter in a given position of the sequence. |
double |
prefixLikelihood(Sequence sequence,
int beginIndex,
int endIndex)
Returns the likelihod of the given prefix under this model, that is, the sum of the probabilities of all words starting with the subword of sequence starting at position beginIndex and ending at position endIndex-1. |
double |
pvalue(Sequence word,
int beginIndex,
SequenceModel nullModel)
Returns the p-value of the subword of the given word starting at beginIndex and with the appropriate length. |
Sequence |
sample()
Samples a sequence with the apropriate length from this model. |
void |
setObservedDataWeight(double weight)
A uniform pseudocount of ~ [length-order-1]/[samplesize^observedDataWeight] is added to each kmer. |
void |
setPvalueMode(int pvalueMode)
Sets the p-value computation mode. |
Methods inherited from class jbil.sequence.AbstractFixedLengthSequenceModel |
---|
likelihood, likelihood, likelihoodThreshold, prefixLikelihood, pvalue, pvalue, pvalue, pvalue, pvalue, sample, sampleN, sampleN |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PVALUE_BRUTE_FORCE
public static final int PVALUE_BRANCH_AND_BOUND
public static final int PVALUE_ITERATIVE_REFINEMENT
public KMerCounter transitionsTree
Constructor Detail |
---|
public MarkovFixedLengthSequenceModel(Alphabet alphabet, int length, int order, KMerCounter transitionsTree)
alphabet
- The base alphabetlength
- The length of the represented wordsorder
- The order of the MCtransitionsTree
- The counter of k-mers necessary for the computation of transition probabilitiesMethod Detail |
---|
public Alphabet getAlphabet()
SequenceModel
public int length()
FixedLengthSequenceModel
public void setObservedDataWeight(double weight)
public double likelihood(Sequence word, int beginIndex)
FixedLengthSequenceModel
public double prefixLikelihood(Sequence sequence, int beginIndex, int endIndex)
SequenceModel
public double positionProbability(int position, Sequence neighbourhoodSeq, int beginIndex, int endIndex, int letterPosition)
SequenceModel
position
- the position at which the letter appears.neighbourhoodSeq
- A sequence containing the neighbourhood.beginIndex
- The start of the neighbourhood within neighbourhoodSeq.endIndex
- The end of the neighbourhood within neighbourhoodSeq.letterPosition
- The position of the target letter within neighbourhoodSeq.
public Sequence sample()
FixedLengthSequenceModel
public int getPvalueMode()
public void setPvalueMode(int pvalueMode)
pvalueMode
- the pvalueMode to setpublic double pvalue(Sequence word, int beginIndex, SequenceModel nullModel)
FixedLengthSequenceModel
SequenceModel.pvalue(Sequence, SequenceModel)
public double likelihoodThreshold(double significance, SequenceModel nullModel)
SequenceModel
significance
- The p of the description above.nullModel
- The null model m0 of the description above.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |