public abstract class AbstractMutationFunction extends AbstractChangeable implements MutationFunction
MutationFunction all custom
implementations should inherit from here.MutationFunction.NoMutationDEFAULT_MUTATION_PROBS, MUTATION_PROBS, MUTATION_SPECTRUM, NO_MUTATION| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMutationFunction() |
| Modifier and Type | Method and Description |
|---|---|
double[] |
getMutationProbs() |
OrderNDistribution |
getMutationSpectrum() |
void |
setMutationProbs(double[] mutationProbs)
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. |
void |
setMutationSpectrum(OrderNDistribution mutationSpectrum)
Sets the
Distribution of Symbols that will be selected
from when a mutation occurs. |
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmutateaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerprotected AbstractMutationFunction()
public final void setMutationProbs(double[] mutationProbs) throws ChangeVetoException
MutationFunctionseq 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.setMutationProbs in interface MutationFunctionmutationProbs - an array of double values representing mutation probabilitiesChangeVetoException - if a ChangeListener vetoes the change.public final double[] getMutationProbs()
getMutationProbs in interface MutationFunctionpublic final void setMutationSpectrum(OrderNDistribution mutationSpectrum) throws ChangeVetoException
MutationFunctionDistribution 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.setMutationSpectrum in interface MutationFunctionmutationSpectrum - the Distribution of 'mutant' bases to choose from.ChangeVetoException - if a ChangeListener vetoes the change.public final OrderNDistribution getMutationSpectrum()
getMutationSpectrum in interface MutationFunctionCopyright © 2020 BioJava. All rights reserved.