Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.models.hmm.states.emissions.discrete
Class ReferenceSequenceDiscreteEmission

    java.lang.Object
      de.jstacs.models.hmm.states.emissions.discrete.AbstractConditionalDiscreteEmission
          de.jstacs.models.hmm.states.emissions.discrete.ReferenceSequenceDiscreteEmission

All Implemented Interfaces:
  DifferentiableEmission, Emission, SamplingEmission, SamplingComponent, SamplingFromStatistic, Storable, Cloneable

    public class ReferenceSequenceDiscreteEmission

extends AbstractConditionalDiscreteEmission

This class implements a discrete emission that depends on some `ReferenceSequenceAnnotation` at a certain reference position. This class can be used in so-called conditional profile HMM for the match states.

Author:
  Jan Grau, Jens Keilwagen

Field Summary

Fields inherited from class de.jstacs.models.hmm.states.emissions.discrete.AbstractConditionalDiscreteEmission
`con, counter, ess, grad, hyperParams, logNorm, offset, params, paramsFile, probs, reader, samplingIndex, statistic, writer`

Constructor Summary
`ReferenceSequenceDiscreteEmission(AlphabetContainer con, AlphabetContainer refCon, int refIdx, double ess)` This is a simple constructor for a `ReferenceSequenceDiscreteEmission` based on the equivalent sample size.
`ReferenceSequenceDiscreteEmission(AlphabetContainer con, AlphabetContainer refCon, int refIdx, double[][] hyperParams)` This constructor creates a `ReferenceSequenceDiscreteEmission` defining the individual hyper parameters.
`ReferenceSequenceDiscreteEmission(AlphabetContainer con, AlphabetContainer refCon, int refIdx, double[][] hyperParams, double[][] initHyperParams)` This constructor creates a `ReferenceSequenceDiscreteEmission` defining the individual hyper parameters.
`ReferenceSequenceDiscreteEmission(AlphabetContainer con, AlphabetContainer refCon, int refIdx, double ess, double[][] initHyperParams)` This is a simple constructor for a `ReferenceSequenceDiscreteEmission` based on the equivalent sample size.
`ReferenceSequenceDiscreteEmission(StringBuffer xml)` Creates a `ReferenceSequenceDiscreteEmission` from its XML representation.

Method Summary
`protected void` | `appendFurtherInformation(StringBuffer xml)` This method appends further information to the XML representation.
`protected void` | `extractFurtherInformation(StringBuffer xml)` This method extracts further information from the XML representation.
`protected int` | `getConditionIndex(boolean forward, int seqPos, Sequence seq)` This method returns an index encoding the condition.
`String` | `toString()`

Methods inherited from class de.jstacs.models.hmm.states.emissions.discrete.AbstractConditionalDiscreteEmission
`acceptParameters, addGradientOfLogPriorTerm, addToStatistic, clone, drawParametersFromStatistic, estimateFromStatistic, extendSampling, fillCurrentParameter, fillSamplingGroups, finalize, fromXML, getAlphabetContainer, getHyperParams, getLogGammaScoreFromStatistic, getLogPosteriorFromStatistic, getLogPriorTerm, getLogProbAndPartialDerivationFor, getLogProbFor, getNodeLabel, getNodeShape, getNumberOfParameters, getSizeOfEventSpace, initForSampling, initializeFunctionRandomly, isInSamplingMode, parseNextParameterSet, parseParameterSet, precompute, resetStatistic, samplingStopped, setLinear, setParameter, setParameterOffset, setShape, toXML`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ReferenceSequenceDiscreteEmission

    public ReferenceSequenceDiscreteEmission(AlphabetContainer con,
                                             AlphabetContainer refCon,
                                             int refIdx,
                                             double ess)

  This is a simple constructor for a `ReferenceSequenceDiscreteEmission` based on the equivalent sample size.

  Parameters:
    `con` - the `AlphabetContainer` of this emission
    `refCon` - the `AlphabetContainer` of the reference
    `refIdx` - the index in the reference sequence
    `ess` - the equivalent sample size (ess) of this emission that is equally distributed over all parameters
  See Also:
    `ReferenceSequenceDiscreteEmission(AlphabetContainer, AlphabetContainer, int, double[][])`

### ReferenceSequenceDiscreteEmission

    public ReferenceSequenceDiscreteEmission(AlphabetContainer con,
                                             AlphabetContainer refCon,
                                             int refIdx,
                                             double ess,
                                             double[][] initHyperParams)

  This is a simple constructor for a `ReferenceSequenceDiscreteEmission` based on the equivalent sample size.

  Parameters:
    `con` - the `AlphabetContainer` of this emission
    `refCon` - the `AlphabetContainer` of the reference
    `refIdx` - the index in the reference sequence
    `ess` - the equivalent sample size (ess) of this emission that is equally distributed over all parameters
    `initHyperParams` - the individual hyper parameters for each parameter used in `AbstractConditionalDiscreteEmission.initializeFunctionRandomly()`
  See Also:
    `ReferenceSequenceDiscreteEmission(AlphabetContainer, AlphabetContainer, int, double[][])`

### ReferenceSequenceDiscreteEmission

    public ReferenceSequenceDiscreteEmission(AlphabetContainer con,
                                             AlphabetContainer refCon,
                                             int refIdx,
                                             double[][] hyperParams)
                                      throws IllegalArgumentException

  This constructor creates a `ReferenceSequenceDiscreteEmission` defining the individual hyper parameters.

  Parameters:
    `con` - the `AlphabetContainer` of this emission
    `refCon` - the `AlphabetContainer` of the reference
    `refIdx` - the index in the reference sequence
    `hyperParams` - the individual hyper parameters for each parameter
  Throws:
    `IllegalArgumentException` - if the dimension of the hyper parameters and the size of the alphabet defined by reference `AlphabetContainer` do not match

### ReferenceSequenceDiscreteEmission

    public ReferenceSequenceDiscreteEmission(AlphabetContainer con,
                                             AlphabetContainer refCon,
                                             int refIdx,
                                             double[][] hyperParams,
                                             double[][] initHyperParams)
                                      throws IllegalArgumentException

  This constructor creates a `ReferenceSequenceDiscreteEmission` defining the individual hyper parameters.

  Parameters:
    `con` - the `AlphabetContainer` of this emission
    `refCon` - the `AlphabetContainer` of the reference
    `refIdx` - the index in the reference sequence
    `hyperParams` - the individual hyper parameters for each parameter
    `initHyperParams` - the individual hyper parameters for each parameter used in `AbstractConditionalDiscreteEmission.initializeFunctionRandomly()`
  Throws:
    `IllegalArgumentException` - if the dimension of the hyper parameters and the size of the alphabet defined by reference `AlphabetContainer` do not match

### ReferenceSequenceDiscreteEmission

    public ReferenceSequenceDiscreteEmission(StringBuffer xml)
                                      throws NonParsableException

  Creates a `ReferenceSequenceDiscreteEmission` from its XML representation.

  Parameters:
    `xml` - the XML representation.
  Throws:
    `NonParsableException` - if the XML representation could not be parsed

Method Detail

### getConditionIndex

    protected int getConditionIndex(boolean forward,
                                    int seqPos,
                                    Sequence seq)

  Description copied from class: `AbstractConditionalDiscreteEmission`
  This method returns an index encoding the condition.

  Specified by:
    `getConditionIndex` in class `AbstractConditionalDiscreteEmission`
  Parameters:
    `forward` - a switch to decide whether to use the forward or the reverse complementary strand (e.g. for DNA sequences)
    `seqPos` - the position in the sequence `seq`
    `seq` - the sequence
  Returns:
    the index encoding the condition

### toString

    public String toString()

  Specified by:
    `toString` in class `AbstractConditionalDiscreteEmission`

### appendFurtherInformation

    protected void appendFurtherInformation(StringBuffer xml)

  Description copied from class: `AbstractConditionalDiscreteEmission`
  This method appends further information to the XML representation. It allows subclasses to save further parameters that are not defined in the superclass.

  Overrides:
    `appendFurtherInformation` in class `AbstractConditionalDiscreteEmission`
  Parameters:
    `xml` - the XML representation

### extractFurtherInformation

    protected void extractFurtherInformation(StringBuffer xml)
                                      throws NonParsableException

  Description copied from class: `AbstractConditionalDiscreteEmission`
  This method extracts further information from the XML representation. It allows subclasses to cast further parameters that are not defined in the superclass.

  Overrides:
    `extractFurtherInformation` in class `AbstractConditionalDiscreteEmission`
  Parameters:
    `xml` - the XML representation
  Throws:
    `NonParsableException` - if the information could not be reconstructed out of the `StringBuffer` `xml`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD