statalign.base.hmm
Class HmmNonParam

java.lang.Object
  extended by statalign.base.hmm.Hmm
      extended by statalign.base.hmm.HmmSilent
          extended by statalign.base.hmm.HmmNonParam

public class HmmNonParam
extends HmmSilent

An implementation of the abstract pair-HMM that emits characters into non-observable sequences Used when a new alignment is proposed that aligns together two substrings via an ancestral sequence.

Author:
novak

Field Summary
 
Fields inherited from class statalign.base.hmm.Hmm
params
 
Constructor Summary
HmmNonParam()
          Constructs a HMMSilent for Tree.
 
Method Summary
 int[] getEmitPatt2State()
          Returns a conversion array from emission patterns (coded as integers) into state indices.
 int getEnd()
          Returns the index of the end state.
 int getSilent()
          Returns the index of the silent state.
 int getStart()
          Returns the index of the start state.
 int[][] getStateEmit()
          Returns an array specifying the emission pattern of each state.
static void main(java.lang.String[] args)
          For testing/debugging purposes.
 double[][] preCalcRedTransMatrix(double[][] redTransMatrix, double[][] transMatrix)
          Returns the transition matrix.
 double[][] preCalcTransMatrix(double[][] transMatrix, double t1, double t2)
          Returns the transition matrix.
 void updateParam(double[] _P)
           
 
Methods inherited from class statalign.base.hmm.Hmm
getLogStationaryProb
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HmmNonParam

public HmmNonParam()
Constructs a HMMSilent for Tree. Sets up the transition matrices.

Method Detail

updateParam

public void updateParam(double[] _P)
Overrides:
updateParam in class HmmSilent

preCalcTransMatrix

public double[][] preCalcTransMatrix(double[][] transMatrix,
                                     double t1,
                                     double t2)
Returns the transition matrix. See the abstract class HmmSilent for more details.

Specified by:
preCalcTransMatrix in class HmmSilent
Parameters:
transMatrix - If null, the function allocates memory for the return matrix If not, this is used for storing the matrix. For speeding-up purposes, note that allocating memory is time-consuming. In this way we need to allocate memory when asked.
t1 - The length of the left edge
t2 - The length of the right edge.
Returns:
The calculated transition matrix.

preCalcRedTransMatrix

public double[][] preCalcRedTransMatrix(double[][] redTransMatrix,
                                        double[][] transMatrix)
Returns the transition matrix. See the abstract class HmmSilent for more details.

Specified by:
preCalcRedTransMatrix in class HmmSilent
Parameters:
redTransMatrix - Array to store the results, may be left null
transMatrix - Input transition matrix with a silent state
Returns:
The calculated ('reduced') transition matrix (redTransMatrix or a newly allocated array if it is null)

getSilent

public int getSilent()
Returns the index of the silent state.

Specified by:
getSilent in class HmmSilent
Returns:
Index of the silent state

getStart

public int getStart()
Returns the index of the start state.

Specified by:
getStart in class Hmm
Returns:
The index of the start state;

getEnd

public int getEnd()
Returns the index of the end state.

Specified by:
getEnd in class Hmm
Returns:
The index of the end state;

getStateEmit

public int[][] getStateEmit()
Returns an array specifying the emission pattern of each state. See class Hmm.

Specified by:
getStateEmit in class Hmm
Returns:
array specifying emission patterns as described above

getEmitPatt2State

public int[] getEmitPatt2State()
Returns a conversion array from emission patterns (coded as integers) into state indices. See class Hmm for details.

Specified by:
getEmitPatt2State in class Hmm
Returns:
array describing the emission pattern to state conversion

main

public static void main(java.lang.String[] args)
For testing/debugging purposes.

Parameters:
args - No argument is used.