public class SwapMutationFunction extends AbstractMutationFunction
MutationFunction.NoMutationDEFAULT_MUTATION_PROBS, MUTATION_PROBS, MUTATION_SPECTRUM, NO_MUTATION| Constructor and Description |
|---|
SwapMutationFunction(double[] probabilities)
Sets the mutation probabilities to the designated values.
|
| Modifier and Type | Method and Description |
|---|---|
SymbolList |
mutate(SymbolList seq)
Produces a new SymbolList by mutation.
|
getMutationProbs, getMutationSpectrum, setMutationProbs, setMutationSpectrumaddChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic SwapMutationFunction(double[] probabilities)
probabilities - An array, which contains the mutation probabilities.public SymbolList mutate(SymbolList seq) throws IllegalAlphabetException, ChangeVetoException, IllegalSymbolException
MutationFunctionseq
is mutated with probability getMutationProbs[i]. The new residue is selected at random
from the Distribution mutation. The use of an array of probabilities
allows the modelling of mutational hotspots. 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.seq - the sequence to mutateIllegalAlphabetException - If the mutationSpectrum Distribution is not
emitting Symbols from the same Alphabet as seq.ChangeVetoException - if seq is unmodifiableIllegalSymbolException - if the mutationSpectrum Distribution is not
conditioned with the same Alphabet as the seq Alphabet.Copyright © 2014 BioJava. All rights reserved.