Constructor and Description |
---|
MixtureEmission(Emission[] emission,
double[] hyperParameters)
The main constructor creating a
MixtureEmission from a set of emissions. |
MixtureEmission(StringBuffer xml)
The standard constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
void |
addToStatistic(boolean forward,
int startPos,
int endPos,
double weight,
Sequence seq)
This method adds the
weight to the internal sufficient statistic. |
MixtureEmission |
clone() |
void |
estimateFromStatistic()
This method estimates the parameters from the internal sufficient statistic.
|
AlphabetContainer |
getAlphabetContainer()
This method returns the
AlphabetContainer of this emission. |
double |
getLogPriorTerm()
Returns a value that is proportional to the log of the prior.
|
double |
getLogProbFor(boolean forward,
int startPos,
int endPos,
Sequence seq)
This method computes the logarithm of the likelihood.
|
String |
getNodeLabel(double weight,
String name,
NumberFormat nf)
Returns the graphviz label of the node containing this emission.
|
String |
getNodeShape(boolean forward)
Returns the graphviz string for the shape of the node.
|
void |
initializeFunctionRandomly()
This method initializes the emission randomly.
|
void |
joinStatistics(Emission... emissions)
This method joins the statistics of different instances and sets this joined statistic as statistic of each instance.
|
void |
resetStatistic()
This method resets the internal sufficient statistic.
|
void |
setParameters(Emission t)
Set values of parameters of the instance to the value of the parameters of the given instance.
|
String |
toString(NumberFormat nf)
This method returns a
String representation of the instance. |
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public MixtureEmission(Emission[] emission, double[] hyperParameters) throws CloneNotSupportedException
MixtureEmission
from a set of emissions.emission
- the individual emissionshyperParameters
- the hyper parameters for each componentCloneNotSupportedException
- if the emission could not be clonedpublic MixtureEmission(StringBuffer xml) throws NonParsableException
Storable
.
Constructs an MixtureEmission
out of an XML representation.xml
- the XML representation as StringBuffer
NonParsableException
- if the MixtureEmission
could not be reconstructed out of
the StringBuffer
xml
public StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.public MixtureEmission clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void joinStatistics(Emission... emissions)
Emission
joinStatistics
in interface Emission
emissions
- the emissions to be joinedpublic void addToStatistic(boolean forward, int startPos, int endPos, double weight, Sequence seq) throws OperationNotSupportedException
Emission
weight
to the internal sufficient statistic.addToStatistic
in interface Emission
forward
- whether to use the forward or the reverse strandstartPos
- the start positionendPos
- the end positionweight
- the weight of the sequenceseq
- the sequenceOperationNotSupportedException
- if forward=false
and the reverse complement of the sequence seq
is not definedpublic void estimateFromStatistic()
Emission
estimateFromStatistic
in interface Emission
public AlphabetContainer getAlphabetContainer()
Emission
AlphabetContainer
of this emission.getAlphabetContainer
in interface Emission
AlphabetContainer
of this emissionpublic double getLogPriorTerm()
Emission
getLogPriorTerm
in interface Emission
StatisticalModel.getLogPriorTerm()
public double getLogProbFor(boolean forward, int startPos, int endPos, Sequence seq) throws OperationNotSupportedException
Emission
getLogProbFor
in interface Emission
forward
- whether to use the forward or the reverse strandstartPos
- the start positionendPos
- the end positionseq
- the sequenceOperationNotSupportedException
- if forward=false
and the reverse complement of the sequence seq
is not definedpublic void initializeFunctionRandomly()
Emission
initializeFunctionRandomly
in interface Emission
public void resetStatistic()
Emission
resetStatistic
in interface Emission
public String getNodeShape(boolean forward)
Emission
getNodeShape
in interface Emission
forward
- if this emission is used on the forward strandpublic String getNodeLabel(double weight, String name, NumberFormat nf)
Emission
getNodeLabel
in interface Emission
weight
- the weight of the node which is represented by
the color of the node, or -1 for no representation, i.e.,
white backgroundname
- the name of the state using this emissionnf
- the NumberFormat
for formatting the textual representation of this emissionpublic void setParameters(Emission t) throws IllegalArgumentException
Emission
setParameters
in interface Emission
t
- the emission with the parameters to be setIllegalArgumentException
- if the assumption about the same class for given and current instance is wrongpublic String toString(NumberFormat nf)
Emission
String
representation of the instance.toString
in interface Emission
nf
- the NumberFormat
for the String
representation of parameters or probabilitiesString
representation of the instance