Class AbstractMutationFunction

java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.ga.functions.AbstractMutationFunction
All Implemented Interfaces:
Changeable, MutationFunction
Direct Known Subclasses:
SimpleMutationFunction, SwapMutationFunction

public abstract class AbstractMutationFunction extends AbstractChangeable implements MutationFunction
Abstract implementation of MutationFunction all custom implementations should inherit from here.
Since:
1.5
Version:
1.0
Author:
Mark Schreiber
  • Constructor Details

  • Method Details

    • setMutationProbs

      public final void setMutationProbs(double[] mutationProbs) throws ChangeVetoException
      Description copied from interface: MutationFunction
      Set the probability of a mutation occuring at a certain position Position 0 in the array corresponds to the probability of the first residue of seq mutating. If the length of the array defined in getMutationProbs() is shorter than the length of the sequence the default behaivour of implementations will be to apply the last probability to each subsequence residue. A single member array will mutate all bases with equal probability.
      Specified by:
      setMutationProbs in interface MutationFunction
      Parameters:
      mutationProbs - an array of double values representing mutation probabilities
      Throws:
      ChangeVetoException - if a ChangeListener vetoes the change.
    • getMutationProbs

      public final double[] getMutationProbs()
      Specified by:
      getMutationProbs in interface MutationFunction
    • setMutationSpectrum

      public final void setMutationSpectrum(OrderNDistribution mutationSpectrum) throws ChangeVetoException
      Description copied from interface: MutationFunction
      Sets the Distribution of Symbols that will be selected from when a mutation occurs. An OrderNDistribution is used so that you can model a situation where the identity of the 'mutant' Symbol is dependent on the original Symbol. The primary use is to prevent Symbols mutating to themselves. Another use would be to model transitions and transversions.
      Specified by:
      setMutationSpectrum in interface MutationFunction
      Parameters:
      mutationSpectrum - the Distribution of 'mutant' bases to choose from.
      Throws:
      ChangeVetoException - if a ChangeListener vetoes the change.
    • getMutationSpectrum

      Specified by:
      getMutationSpectrum in interface MutationFunction
      Returns:
      null if the Distribution has not been set.