|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectState
public class State
Holds the state name and the associated ratios expected
Eg: In a het deletion, we expect [observed coverage]/[average coverage in other samples]~1/2 and [observed heterozygosity]/[average heterozygosity in other samples]~0
Also contains methods to compute the emission and transition probabilities.
Field Summary | |
---|---|
static int |
computeAtRunTime
|
static int |
DOUBLE_INSERT
|
(package private) int |
E_LengthOfState
|
static int |
HETEROZYGOUS_DELETE
|
static int |
HOMOZYGOUS_DELETE
|
static int |
INSERTION
|
static java.util.HashMap<java.lang.Integer,java.lang.Double> |
LOG_FACTORIAL
|
static int |
NORMAL
|
(package private) static double |
rateOfOccurenceOfCNV
|
(package private) double |
rpkmRatio
|
(package private) double |
snpRatio
|
(package private) int |
stateName
|
(package private) static java.util.HashMap<State,java.util.HashMap<State,java.lang.Double>> |
transitionProbabilities
|
Constructor Summary | |
---|---|
State()
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object aThat)
|
static double |
getEmissionProbability(double observedFPKM,
double observedSNPs,
double expectedFPKM,
double expectedSNPs,
double stdDevFPKM,
double stdDevSNPs,
double normalizationFPKM,
double normalizationSNPs,
State s)
To remove |
static java.lang.Double |
getEmissionProbability(Exon exon,
Exon expected,
Exon stdDev,
State s)
To remove |
static double |
getLogEmissionProbability(Exon exon,
Exon expected,
Exon stdDev,
State s,
int nSamples,
cern.jet.random.Gamma gamma,
double gammaK,
double gammaTheta,
double gammaSNPsK,
double gammaSNPsTheta)
Calculates the emission probability for the observation at a particular exon, in state s |
java.lang.String |
getStateName()
For pretty-printing and for serving coffee with the code |
static double |
getTransitionProbability(State s1,
State s2,
int lengthOfIntron,
int lengthOfExon)
Gets the transition probability from state s1 -> state s2 |
static java.util.HashMap<java.lang.String,State> |
initializeStates(java.lang.String parameterFile)
Initializes all the states with the values in the parameter file |
private static double |
logFactorial(int number)
Calculated the log of the factorial of the number |
private static double |
logGamma(double x,
double k,
double theta)
Calculates the log of the pdf of a gamma distribution |
private static double |
logPoisson(double x,
double lambda)
Calculates log of pdf of Poisson distribution |
java.lang.String |
toString()
|
private static double |
updateGammaK(double ratio,
int nSamples,
double gammaK,
double expectedFPKM)
Updates the k for the Gamma prior (computes the posterior hyperparameter) |
private static double |
updateGammaTheta(int nSamples,
double gammaTheta)
Updates the theta for the Gamma prior (computes the posterior hyperparameter) |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
int stateName
double rpkmRatio
double snpRatio
int E_LengthOfState
static double rateOfOccurenceOfCNV
static java.util.HashMap<State,java.util.HashMap<State,java.lang.Double>> transitionProbabilities
public static final int NORMAL
public static final int HOMOZYGOUS_DELETE
public static final int HETEROZYGOUS_DELETE
public static final int INSERTION
public static final int DOUBLE_INSERT
public static final int computeAtRunTime
public static java.util.HashMap<java.lang.Integer,java.lang.Double> LOG_FACTORIAL
Constructor Detail |
---|
public State()
Method Detail |
---|
public static double getTransitionProbability(State s1, State s2, int lengthOfIntron, int lengthOfExon)
For CNV state -> normal state, transition probability is dependent on length of intron
s1
- State transitioning froms2
- State transitioning tolengthOfIntron
- length of the intronlengthOfExon
- length of the exon
public static java.util.HashMap<java.lang.String,State> initializeStates(java.lang.String parameterFile)
parameterFile
- name of parameter file
public java.lang.String getStateName()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object aThat)
equals
in class java.lang.Object
public static double getEmissionProbability(double observedFPKM, double observedSNPs, double expectedFPKM, double expectedSNPs, double stdDevFPKM, double stdDevSNPs, double normalizationFPKM, double normalizationSNPs, State s)
public static java.lang.Double getEmissionProbability(Exon exon, Exon expected, Exon stdDev, State s)
private static double logFactorial(int number)
number
-
public static double getLogEmissionProbability(Exon exon, Exon expected, Exon stdDev, State s, int nSamples, cern.jet.random.Gamma gamma, double gammaK, double gammaTheta, double gammaSNPsK, double gammaSNPsTheta)
exon
- exon for which emission probability is computedexpected
- expected observations for that exon (based on other samples)stdDev
- std deviations for that exon (based on other samples)s
- statenSamples
- number of samplesgamma
- to removegammaK
- gamma parameter k of the coveragegammaTheta
- gamma parameter Theta of the coveragegammaSNPsK
- gamma parameter k of the heterozygositygammaSNPsTheta
- gamma parameter Theta of the heterozygosity
private static double logGamma(double x, double k, double theta)
x
- - observationk
- - parameter of Gamma distributiontheta
- - parameter of Gamma distribution
private static double logPoisson(double x, double lambda)
x
- - observedlambda
- - parameter of Poisson distribution
private static double updateGammaTheta(int nSamples, double gammaTheta)
nSamples
- number of samplesgammaTheta
- original Theta value
private static double updateGammaK(double ratio, int nSamples, double gammaK, double expectedFPKM)
ratio
- ratio of observed to expected in the particular statenSamples
- number of samplesgammaK
- original k valueexpectedFPKM
- expected coverage
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |