## org.biojava.bio.dist
Class DNADistribution

    java.lang.Object
      |
      +--org.biojava.bio.dist.AbstractDistribution
            |
            +--org.biojava.bio.dist.DNADistribution

public final class DNADistribution
extends AbstractDistribution
implements java.io.Serializable

A state in a markov process.

This implementation is optimized for DNA.

See Also:
  Serialized Form

Constructor Summary
`DNADistribution()`

Method Summary
`Alphabet` `getAlphabet()` The alphabet from which this spectrum emits symbols.
`Distribution` `getNullModel()` Retrieve the null model Distribution that this Distribution recognizes.
`double` `getWeight(Symbol s)` Return the probability that Symbol s is emited by this spectrum.
`void` `registerWithTrainer(DistributionTrainerContext dtc)` Register an IgnoreCountsTrainer instance as the trainer for this distribution.
`void` `setNullModel(Distribution nullModel)` Assign a background probability distribution to the DNA distribution.
`void` `setWeight(Symbol s, double score)` Set the weight of a given symbol in this distribution.

Methods inherited from class org.biojava.bio.dist.AbstractDistribution
`getAmbiguityWeight, sampleSymbol`

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

Constructor Detail

### DNADistribution

    public DNADistribution()

Method Detail

### getAlphabet

    public Alphabet getAlphabet()

  Description copied from interface: Distribution
  The alphabet from which this spectrum emits symbols.
  Tags copied from interface: Distribution
  Returns:
    the Alphabet associated with this spectrum

### getNullModel

    public Distribution getNullModel()

  Description copied from class: AbstractDistribution
  Retrieve the null model Distribution that this Distribution recognizes.
  Overrides:
    getNullModel in class AbstractDistribution
  Tags copied from class: AbstractDistribution
  Returns:
    the apropriate null model

### setNullModel

    public void setNullModel(Distribution nullModel)
                      throws IllegalAlphabetException

  Assign a background probability distribution to the DNA distribution.
  Parameters:
    `nullModel` - the Distribution to be added as the background distribution.

### getWeight

    public double getWeight(Symbol s)
                     throws IllegalSymbolException

  Description copied from interface: Distribution
  Return the probability that Symbol s is emited by this spectrum.

  If the symbol is an AmbiguitySymbol, then it is the probability that exactly one of the symbols matching it was emitted.

  Tags copied from interface: Distribution
  Parameters:
    `s` - the Symbol emitted
  Returns:
    the log probability of emitting that symbol
  Throws:
    IllegalSymbolException - if s is not from this state's alphabet

### setWeight

    public void setWeight(Symbol s,
                          double score)
                   throws IllegalSymbolException

  Description copied from class: AbstractDistribution
  Set the weight of a given symbol in this distribution. This implementation simply throws an exception.
  Overrides:
    setWeight in class AbstractDistribution
  Tags copied from interface: Distribution
  Parameters:
    `s` - the Symbol emitted
    `w` - the probability of emitting that symbol
  Throws:
    IllegalSymbolException - if s is not from this state's alphabet, or if it is an ambiguity symbol and the implementation can't handle this case
    java.lang.UnsupportedOperationException - if this state does not allow weights to be tampered with

### registerWithTrainer

    public void registerWithTrainer(DistributionTrainerContext dtc)

  Description copied from class: AbstractDistribution
  Register an IgnoreCountsTrainer instance as the trainer for this distribution. Override this if you wish to implement a trainable distribution.
  Overrides:
    registerWithTrainer in class AbstractDistribution
  Tags copied from interface: Distribution
  Parameters:
    `dtc` - the DistributionTrainerContext with witch to register a trainer