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
ANNOTATIONFields 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 AnnotationShould return the associated annotation object.getBases()protected ChangeSupportCalled to retrieve the ChangeSupport for this object.final DistributionGet the Distribution associated with this state.The alphabet containing the symbols matched by this ambiguity symbol.final StringgetName()The long name for the symbol.The list of symbols that this symbol is composed from.chargetToken()voidregisterWithTrainer(ModelTrainer trainer) Perform any registration that is necessary with mt.voidsetAdvance(int[] advance) Set the advance array.final voidsetAnnotation(Annotation ann) final voidSet the Distribution associated with this state.final voidMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:AnnotatableShould return the associated annotation object.- Specified by:
getAnnotationin interfaceAnnotatable- Returns:
- an Annotation object, never null
-
setAnnotation
- Throws:
ChangeVetoException
-
getDistribution
Description copied from interface:EmissionStateGet 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:
getDistributionin interfaceEmissionState- Returns:
- the current Distribution object used by this state
-
setDistribution
Description copied from interface:EmissionStateSet the Distribution associated with this state.- Specified by:
setDistributionin 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:EmissionStateDetermine 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:
getAdvancein interfaceEmissionState
-
setAdvance
Description copied from interface:EmissionStateSet the advance array.- Specified by:
setAdvancein 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:SymbolThe long name for the symbol. -
setName
-
getMatches
Description copied from interface:SymbolThe 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:
getMatchesin interfaceSymbol- Returns:
- the Alphabet of symbols matched by this symbol
-
getBases
-
getSymbols
Description copied from interface:BasisSymbolThe 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:
getSymbolsin interfaceBasisSymbol- Returns:
- the List of Symbols that this Symbol is built from
-
registerWithTrainer
Description copied from interface:TrainablePerform 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:
registerWithTrainerin interfaceTrainable- Parameters:
trainer- the ModelTrainer that encapsulates the training environment
-
getChangeSupport
Description copied from class:AbstractChangeableCalled 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 & unregister the forwarder in the code that does the ChangeEvent handling in setter methods.ChangeSupport cs = super.getChangeSupport(ct); if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) { someForwarder = new ChangeForwarder(... this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange); } return cs;- Overrides:
getChangeSupportin classAbstractChangeable
-