Class SimpleEmissionState
- All Implemented Interfaces:
Serializable
,Annotatable
,EmissionState
,State
,Trainable
,AtomicSymbol
,BasisSymbol
,Symbol
,Changeable
- Direct Known Subclasses:
MagicalState
,ProfileEmissionState
- Author:
- Matthew Pocock, Thomas Down, Mark Schreiber
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
-
Field Summary
FieldsFields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
Fields inherited from interface org.biojava.bio.dp.EmissionState
ADVANCE, DISTRIBUTION
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleEmissionState
(String name, Annotation ann, int[] advance, Distribution dis) -
Method Summary
Modifier and TypeMethodDescriptionint[]
Determine the number of symbols this state advances along one or more symbol lists.final Annotation
Should return the associated annotation object.getBases()
protected ChangeSupport
Called to retrieve the ChangeSupport for this object.final Distribution
Get the Distribution associated with this state.The alphabet containing the symbols matched by this ambiguity symbol.final String
getName()
The long name for the symbol.The list of symbols that this symbol is composed from.char
getToken()
void
registerWithTrainer
(ModelTrainer trainer) Perform any registration that is necessary with mt.void
setAdvance
(int[] advance) Set the advance array.final void
setAnnotation
(Annotation ann) final void
Set the Distribution associated with this state.final void
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
annotationForwarder
-
distForwarder
-
-
Constructor Details
-
SimpleEmissionState
-
-
Method Details
-
getAnnotation
Description copied from interface:Annotatable
Should return the associated annotation object.- Specified by:
getAnnotation
in interfaceAnnotatable
- Returns:
- an Annotation object, never null
-
setAnnotation
- Throws:
ChangeVetoException
-
getDistribution
Description copied from interface:EmissionState
Get the Distribution associated with this state.
If the state is to be added to an HMM, then the state's emission spectrum must be compatible with the HMM - that is, their emission alphabets must match.
- Specified by:
getDistribution
in interfaceEmissionState
- Returns:
- the current Distribution object used by this state
-
setDistribution
Description copied from interface:EmissionState
Set the Distribution associated with this state.- Specified by:
setDistribution
in interfaceEmissionState
- Parameters:
dis
- the new Distribution to use- Throws:
ChangeVetoException
- if the implementation doesn't support setting the distribution, or if the change is vetoed
-
getAdvance
Description copied from interface:EmissionState
Determine the number of symbols this state advances along one or more symbol lists. In the simple case, this method should almost always return {1} if it is a true `emmision' state, or {0} if it is a dot state which only emits a gap character. For pairwise HMMs, it will normally return {1, 1} for match state, and {0, 1} or {1, 0} for a gap state. Under some circumstances it may be valid to return values other than 1 or 0, but you should consider the consequences for HMM architecture very carefully, and contact the authors. Developers may wish to return a copy of some underlying array from this method as code outside could modify the array you give- Specified by:
getAdvance
in interfaceEmissionState
-
setAdvance
Description copied from interface:EmissionState
Set the advance array.- Specified by:
setAdvance
in interfaceEmissionState
- Parameters:
advance
- an array of ints, specifying how many symbols are consumed from each sequence- Throws:
ChangeVetoException
- if the implementation doesn't support setting advance, or if the change is vetoed
-
getToken
-
getName
Description copied from interface:Symbol
The long name for the symbol. -
setName
-
getMatches
Description copied from interface:Symbol
The alphabet containing the symbols matched by this ambiguity symbol.This alphabet contains all of, and only, the symbols matched by this symbol. For example, the symbol representing the DNA ambiguity code for W would contain the symbol for A and T from the DNA alphabet.
- Specified by:
getMatches
in interfaceSymbol
- Returns:
- the Alphabet of symbols matched by this symbol
-
getBases
-
getSymbols
Description copied from interface:BasisSymbol
The list of symbols that this symbol is composed from.
In the usual case, this list will contain just this single symbol. In the case where a symbol represents an ordered combination of other symbols, the list will contain each of these BasisSymbols.
- Specified by:
getSymbols
in interfaceBasisSymbol
- Returns:
- the List of Symbols that this Symbol is built from
-
registerWithTrainer
Description copied from interface:Trainable
Perform any registration that is necessary with mt.This may include registering handlers for transition or emission counts, or registering other Trainable objects with the ModelTrainer.
- Specified by:
registerWithTrainer
in interfaceTrainable
- Parameters:
trainer
- the ModelTrainer that encapsulates the training environment
-
getChangeSupport
Description copied from class:AbstractChangeable
Called to retrieve the ChangeSupport for this object.Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to be transient and lazily instantiated. Be sure to register invalid input: '&' unregister the forwarder in the code that does the ChangeEvent handling in setter methods.ChangeSupport cs = super.getChangeSupport(ct); if(someForwarder == null invalid input: '&'invalid input: '&' ct.isMatching(SomeInterface.SomeChangeType)) { someForwarder = new ChangeForwarder(... this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange); } return cs;
- Overrides:
getChangeSupport
in classAbstractChangeable
-