public class SimpleState extends Object implements TrainableState
State
based on Emission
that allows to reuse Emission
s for different State
s.Modifier and Type | Field and Description |
---|---|
protected Emission |
e
The emission that is internally used for scoring subsequences.
|
protected boolean |
forward
A switch that decides whether to use the forward or the reverse complementary strand of a sequence.
|
protected String |
name
The name of the state.
|
Constructor and Description |
---|
SimpleState(Emission e,
String name,
boolean forward)
This is the constructor of a
SimpleState . |
Modifier and Type | Method and Description |
---|---|
void |
addToStatistic(int startPos,
int endPos,
double weight,
Sequence seq)
This method allows to add a certain
weight to the sufficient statistic of the parameters that
are used for scoring the specific subsequence(s). |
String |
getGraphvizNodeOptions(double weight,
double maxWeight,
NumberFormat nf)
This method returns a
String representation of the node options that
can be used in Graphviz to create the node for this state. |
double |
getLogScoreFor(int startPos,
int endPos,
Sequence seq)
This method returns the logarithm of the score for a given sequence with given start and end position.
|
String |
getName()
Returns the name of the state.
|
boolean |
isSilent()
This method returns whether a state is silent or not.
|
String |
toString(NumberFormat nf)
This method returns a
String representation of the instance. |
protected Emission e
protected String name
protected boolean forward
public SimpleState(Emission e, String name, boolean forward)
SimpleState
.e
- the emission that is internally used for scoring subsequencesname
- the name of the stateforward
- a switch that decides whether to use the forward or the reverse complementary strand of a sequencepublic String getGraphvizNodeOptions(double weight, double maxWeight, NumberFormat nf)
State
String
representation of the node options that
can be used in Graphviz to create the node for this state.getGraphvizNodeOptions
in interface State
weight
- for statemaxWeight
- the maximal weight for the statenf
- the NumberFormat
for the output, can be null
String
representation of the statepublic double getLogScoreFor(int startPos, int endPos, Sequence seq) throws WrongLengthException, OperationNotSupportedException
State
getLogScoreFor
in interface State
startPos
- the start position within the sequence(s)endPos
- the end position within the sequence(s)seq
- the sequence(s)WrongLengthException
- if the length can not be modeledOperationNotSupportedException
- if the reverse complement of the sequence can not be computedpublic void addToStatistic(int startPos, int endPos, double weight, Sequence seq) throws OperationNotSupportedException
TrainableState
weight
to the sufficient statistic of the parameters that
are used for scoring the specific subsequence(s).addToStatistic
in interface TrainableState
startPos
- the start positionendPos
- the end positionweight
- the weight which will be added to the sufficient statisticseq
- the Sequence
(s)OperationNotSupportedException
- if the reverse complement of the sequence can not be computedpublic boolean isSilent()
State
isSilent
in interface State
true
if the state is silent, otherwise false
SilentEmission
public String toString(NumberFormat nf)
State
String
representation of the instance.toString
in interface State
nf
- the NumberFormat
for the String
representation of parameters or probabilitiesString
representation of the instancepublic String getName()