Class SimpleEmissionState

    • Method Detail

      • getDistribution

        public final Distribution 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 interface EmissionState
        Returns:
        the current Distribution object used by this state
      • getAdvance

        public int[] 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 interface EmissionState
      • setAdvance

        public void setAdvance​(int[] advance)
                        throws ChangeVetoException
        Description copied from interface: EmissionState
        Set the advance array.
        Specified by:
        setAdvance in interface EmissionState
        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
      • getName

        public final String getName()
        Description copied from interface: Symbol
        The long name for the symbol.
        Specified by:
        getName in interface Symbol
        Returns:
        the long name
      • getMatches

        public Alphabet 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 interface Symbol
        Returns:
        the Alphabet of symbols matched by this symbol
      • getSymbols

        public List 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 interface BasisSymbol
        Returns:
        the List of Symbols that this Symbol is built from
      • registerWithTrainer

        public void registerWithTrainer​(ModelTrainer trainer)
        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 interface Trainable
        Parameters:
        trainer - the ModelTrainer that encapsulates the training environment
      • getChangeSupport

        protected ChangeSupport getChangeSupport​(ChangeType ct)
        Description copied from class: AbstractChangeable
        Called to retrieve the ChangeSupport for this object.

        Your implementation of this method should have the following structure:

         ChangeSupport cs = super.getChangeSupport(ct);
        
         if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
           someForwarder = new ChangeForwarder(...
        
           this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
         }
        
         return cs;
         
        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.
        Overrides:
        getChangeSupport in class AbstractChangeable