Class HiddenMarkovModel

java.lang.Object
  extended by HiddenMarkovModel

public class HiddenMarkovModel
extends java.lang.Object

Calculates and stores states according to the exon data

Author:
arthiramachandran

Field Summary
(package private) static java.util.HashMap<java.lang.String,State> States
           
static double UNDERFLOW
           
static double UNDERFLOW_factor
           
 
Constructor Summary
HiddenMarkovModel()
           
 
Method Summary
private static java.util.ArrayList<java.util.HashMap<State,java.lang.Double>> computeBackwardProbabilities(java.util.ArrayList<Exon> exons, java.util.ArrayList<Exon> expectedValues, java.util.ArrayList<Exon> stdDeviations, int nSamples, cern.jet.random.Gamma gamma, double gammaK, double gammaTheta, double gammaSNPsK, double gammaSNPsTheta)
          Computes the backward probabilities for the observation
private static java.util.ArrayList<java.util.HashMap<State,java.lang.Double>> computeForwardProbabilities(java.util.ArrayList<Exon> exons, java.util.ArrayList<Exon> expectedValues, java.util.ArrayList<Exon> stdDeviations, int nSamples, cern.jet.random.Gamma gamma, double gammaK, double gammaTheta, double gammaSNPsK, double gammaSNPsTheta)
          Computes the forward probabilities for the observation
private static State getStateFromIndex(int stateIndex)
          From state number, figures out the state
static void getStates(java.util.ArrayList<Exon> exons, java.util.ArrayList<Exon> expectedValues, java.util.ArrayList<Exon> stdDeviations, java.lang.String parameterFileName, double threshold, int nSamples, cern.jet.random.Gamma gamma, double gammaK, double gammaTheta, double gammaSNPsK, double gammaSNPsTheta)
          Gets the most likely states given the observations using forward-backward algorithm
static void initialize(java.lang.String parameterFileName)
          Initializes the states with the values from the parameter file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

States

static java.util.HashMap<java.lang.String,State> States

UNDERFLOW

public static final double UNDERFLOW
See Also:
Constant Field Values

UNDERFLOW_factor

public static final double UNDERFLOW_factor
See Also:
Constant Field Values
Constructor Detail

HiddenMarkovModel

public HiddenMarkovModel()
Method Detail

initialize

public static void initialize(java.lang.String parameterFileName)
Initializes the states with the values from the parameter file

Parameters:
parameterFileName - name of parameter file

getStates

public static void getStates(java.util.ArrayList<Exon> exons,
                             java.util.ArrayList<Exon> expectedValues,
                             java.util.ArrayList<Exon> stdDeviations,
                             java.lang.String parameterFileName,
                             double threshold,
                             int nSamples,
                             cern.jet.random.Gamma gamma,
                             double gammaK,
                             double gammaTheta,
                             double gammaSNPsK,
                             double gammaSNPsTheta)
Gets the most likely states given the observations using forward-backward algorithm

Parameters:
exons - observed values of each exon (in sample to call)
expectedValues - expected values for observations of each exon
stdDeviations - std deviations for observations of each exon
parameterFileName - name of parameter file
threshold - threshold for when an exon is called as not normal
nSamples - number of samples
gamma - (to remove)
gammaK - Gamma parameter k of coverage
gammaTheta - Gamma parameter Theta of coverage
gammaSNPsK - Gamma parameter k of heterozygosity
gammaSNPsTheta - Gamma parameter Theta of heterozygosity

getStateFromIndex

private static State getStateFromIndex(int stateIndex)
From state number, figures out the state

Parameters:
stateIndex -
Returns:
state associated with that index

computeBackwardProbabilities

private static java.util.ArrayList<java.util.HashMap<State,java.lang.Double>> computeBackwardProbabilities(java.util.ArrayList<Exon> exons,
                                                                                                           java.util.ArrayList<Exon> expectedValues,
                                                                                                           java.util.ArrayList<Exon> stdDeviations,
                                                                                                           int nSamples,
                                                                                                           cern.jet.random.Gamma gamma,
                                                                                                           double gammaK,
                                                                                                           double gammaTheta,
                                                                                                           double gammaSNPsK,
                                                                                                           double gammaSNPsTheta)
Computes the backward probabilities for the observation

Parameters:
exons - observed values of each exon (in sample to call)
expectedValues - expected values for observations of each exon
stdDeviations - std deviations for observations of each exon
nSamples - number of samples
gamma - (to remove)
gammaK - Gamma parameter k of coverage
gammaTheta - Gamma parameter Theta of coverage
gammaSNPsK - Gamma parameter k of heterozygosity
gammaSNPsTheta - Gamma parameter Theta of heterozygosity
Returns:
Array of backward probabilities for each state for each exon

computeForwardProbabilities

private static java.util.ArrayList<java.util.HashMap<State,java.lang.Double>> computeForwardProbabilities(java.util.ArrayList<Exon> exons,
                                                                                                          java.util.ArrayList<Exon> expectedValues,
                                                                                                          java.util.ArrayList<Exon> stdDeviations,
                                                                                                          int nSamples,
                                                                                                          cern.jet.random.Gamma gamma,
                                                                                                          double gammaK,
                                                                                                          double gammaTheta,
                                                                                                          double gammaSNPsK,
                                                                                                          double gammaSNPsTheta)
Computes the forward probabilities for the observation

Parameters:
exons - observed values of each exon (in sample to call)
expectedValues - expected values for observations of each exon
stdDeviations - std deviations for observations of each exon
nSamples - number of samples
gamma - (to remove)
gammaK - Gamma parameter k of coverage
gammaTheta - Gamma parameter Theta of coverage
gammaSNPsK - Gamma parameter k of heterozygosity
gammaSNPsTheta - Gamma parameter Theta of heterozygosity
Returns:
Array of forward probabilities for each state for each exon