|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.models.hmm.HMMFactory
public class HMMFactory
This class allows to create some frequently used HMMs.
Nested Class Summary | |
---|---|
static class |
HMMFactory.HMMType
This enum defines some standard architecture of profile HMMs. |
Constructor Summary | |
---|---|
HMMFactory()
|
Method Summary | |
---|---|
static AbstractHMM |
createErgodicHMM(HMMTrainingParameterSet pars,
int order,
double ess,
double selfTranistionPart,
double expectedSequenceLength,
Emission... emission)
This method creates an ergodic, i.e. a completely connected, HMM using the given emissions. |
static AbstractHMM |
createProfileHMM(MaxHMMTrainingParameterSet trainingParameterSet,
double[][] initFromTo,
boolean likelihood,
int order,
int numLayers,
AlphabetContainer con,
double ess,
boolean conditionalMain,
boolean closeCircle,
double[][] conditionInitProbs)
Creates a new profile HMM for a given architecture and number of layers. |
static AbstractHMM |
createProfileHMM(MaxHMMTrainingParameterSet trainingParameterSet,
HMMFactory.HMMType type,
boolean likelihood,
int order,
int numLayers,
AlphabetContainer con,
double ess,
boolean conditionalMain,
boolean closeCircle,
double[][] conditionInitProbs)
Creates a new profile HMM for a given architecture and number of layers. |
static AbstractHMM |
createSunflowerHMM(HMMTrainingParameterSet pars,
AlphabetContainer con,
double ess,
int expectedSequenceLength,
boolean startCentral,
int... motifLength)
This method creates a first order sunflower HMM. |
static AbstractHMM |
createSunflowerHMM(HMMTrainingParameterSet pars,
AlphabetContainer con,
double ess,
int expectedSequenceLength,
boolean startCentral,
PhyloTree[] t,
double[] motifProb,
int[] motifLength)
This method creates a first order sunflower HMM allowing phylogenetic emissions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HMMFactory()
Method Detail |
---|
public static AbstractHMM createErgodicHMM(HMMTrainingParameterSet pars, int order, double ess, double selfTranistionPart, double expectedSequenceLength, Emission... emission) throws Exception
pars
- the parameter determining the training procedure of the HMMorder
- the Markov order of the HMMess
- the ess to be used for the HMMselfTranistionPart
- the a-priori probability of any self transitionexpectedSequenceLength
- the expected length of sequences to be modeledemission
- the emissions of the states
Exception
- if the HMM can not be created properlypublic static AbstractHMM createSunflowerHMM(HMMTrainingParameterSet pars, AlphabetContainer con, double ess, int expectedSequenceLength, boolean startCentral, int... motifLength) throws Exception
pars
- the parameter determining the training procedure of the HMMcon
- the AlphabetContainer
of the HMMess
- the equivalent sample size (ess) of this modelexpectedSequenceLength
- the expected sequence length to be modeled; this parameter is used to determine the priorstartCentral
- a switch for deciding between starting in the central state or in all statesmotifLength
- the length of the motifs building the petals of the sunflower
Exception
- if the HMM can not be created properlycreateSunflowerHMM(HMMTrainingParameterSet, AlphabetContainer, double, int, boolean, PhyloTree[], double[], int[])
public static AbstractHMM createSunflowerHMM(HMMTrainingParameterSet pars, AlphabetContainer con, double ess, int expectedSequenceLength, boolean startCentral, PhyloTree[] t, double[] motifProb, int[] motifLength) throws Exception
pars
- the parameter determining the training procedure of the HMMcon
- the AlphabetContainer
of the HMMess
- the equivalent sample size (ess) of this modelexpectedSequenceLength
- the expected sequence length to be modeled; this parameter is used to determine the priorstartCentral
- a switch for deciding between starting in the central state or in all statest
- an array of length two that contains a PhyloTree
for the background and the motif, can be null
than a normal sunflower HMM is returnedmotifProb
- the a-priori probabilities for each motif, i.e., the a-priori probabilities for the edges from the central node to the first motif statesmotifLength
- the length of the motifs building the petals of the sunflower
Exception
- if the HMM can not be created properlypublic static AbstractHMM createProfileHMM(MaxHMMTrainingParameterSet trainingParameterSet, HMMFactory.HMMType type, boolean likelihood, int order, int numLayers, AlphabetContainer con, double ess, boolean conditionalMain, boolean closeCircle, double[][] conditionInitProbs) throws Exception
trainingParameterSet
- the parameters of the algorithm for learning the model parameterstype
- the type of the HMM, i.e., its architecturelikelihood
- if true
, the likelihood is considered as score of a sequence, and the probability of the Viterbi path otherwiseorder
- the order of the HMM, i.e., the number of previous states that are considered for a transition probabilitynumLayers
- the number of layers of the profile HMMcon
- the alphabet of the profile HMMess
- the equivalent sample size, is propagated between states to obtain consistent hyper-parameters for all parametersconditionalMain
- if true
, the match states have ReferenceSequenceDiscreteEmission
s, and DiscreteEmission
s otherwisecloseCircle
- if true
the circle from end to initial state is closed, i.e., the HMM can be traversed several timesconditionInitProbs
- the hyper-parameters for initializing the match states if conditionalMain
is true. May be null
for using the hyper-parameters of the prior
Returns:
the profile HMM
Throws:
Exception
- if the profile HMM could not be created
createProfileHMM
public static AbstractHMM createProfileHMM(MaxHMMTrainingParameterSet trainingParameterSet,
double[][] initFromTo,
boolean likelihood,
int order,
int numLayers,
AlphabetContainer con,
double ess,
boolean conditionalMain,
boolean closeCircle,
double[][] conditionInitProbs)
throws Exception
- Creates a new profile HMM for a given architecture and number of layers.
- Parameters:
trainingParameterSet
- the parameters of the algorithm for learning the model parametersinitFromTo
- hyper-parameters of the transition from each state (first dimension) of the current layer to each other state in the same layer (first three entries of the second dimension)
and the next layer (next three entries in the second dimension). If a hyper-parameter is set to Double.NaN
, the corresponding transition is not allowedlikelihood
- if true
, the likelihood is considered as score of a sequence, and the probability of the Viterbi path otherwiseorder
- the order of the HMM, i.e., the number of previous states that are considered for a transition probabilitynumLayers
- the number of layers of the profile HMMcon
- the alphabet of the profile HMMess
- the equivalent sample size, is propagated between states to obtain consistent hyper-parameters for all parametersconditionalMain
- if true
, the match states have ReferenceSequenceDiscreteEmission
s, and DiscreteEmission
s otherwisecloseCircle
- if true
the circle from end to initial state is closed, i.e., the HMM can be traversed several timesconditionInitProbs
- the hyper-parameters for initializing the match states if conditionalMain
is true. May be null
for using the hyper-parameters of the prior
Returns:
the profile HMM
Throws:
Exception
- if the profile HMM could not be created
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD