public class State
extends Object
State
class represents a
single state in a hidden Markov model, including the state's
name, a collection of all characters that the state can output,
and the probability of outputting each character.Constructor and Description |
---|
State(String line)
Construct a new
State based on information in a tab-delimited line read-in
from a file. |
Modifier and Type | Method and Description |
---|---|
int |
getEmissionLength()
Returns the length of the characters that this
State can output (all
characters output by a State are the same length). |
double |
getEmissionProbability(String s)
Returns the probability that this
State emits the specified character s ,
or 0.0 if this State cannot emit character s . |
String |
getName()
Returns the name of this State.
|
static void |
main(String[] args)
The
main method creates a new State , for testing purposes,
and prints out this newly created State to the screen. |
String |
toString()
Returns a String representation of this
State . |
public State(String line)
State
based on information in a tab-delimited line read-in
from a file. The name of the state, the alphabet of characters, and the emission
probabilities should be tab-delimited.
The different characters in the alphabet should be comma-delimited.
The different emission probabilities should be comma-delimited.
For example:
Intergenic A,C,G,T 0.2,0.3,0.3,0.2
StartCodon ATG,GTG 0.92,0.08
StopCodon TGA,TAG,TAA 0.28,0.07,0.65
line
- a tab-delimited line containing name, character, and emission probability informationpublic String getName()
String
representing the name of this State
public double getEmissionProbability(String s)
State
emits the specified character s
,
or 0.0 if this State
cannot emit character s
.s
- a character that this State
may outputState
outputs character s
public int getEmissionLength()
State
can output (all
characters output by a State
are the same length).State
public String toString()
State
.
The String representation includes the name of the State,
the set of characters output by the State, and the probability
of outputting each of these characters.toString
in class Object
String
representation of this State
public static void main(String[] args)
main
method creates a new State
, for testing purposes,
and prints out this newly created State
to the screen.args
- an array of Strings
representing any command line arguments