Package org.biojavax.ga.functions
Class SimpleMutationFunction
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.ga.functions.AbstractMutationFunction
org.biojavax.ga.functions.SimpleMutationFunction
- All Implemented Interfaces:
Changeable,MutationFunction
Simple no frills Implementation of the MutationFunction interface
This class is final, custom implementations should extend
AbstractMutationFunction
- Since:
- 1.5
- Version:
- 1.0
- Author:
- Mark Schreiber
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojavax.ga.functions.MutationFunction
MutationFunction.NoMutation -
Field Summary
Fields inherited from interface org.biojavax.ga.functions.MutationFunction
DEFAULT_MUTATION_PROBS, MUTATION_PROBS, MUTATION_SPECTRUM, NO_MUTATION -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.biojavax.ga.functions.AbstractMutationFunction
getMutationProbs, getMutationSpectrum, setMutationProbs, setMutationSpectrumMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
SimpleMutationFunction
public SimpleMutationFunction()
-
-
Method Details
-
mutate
public SymbolList mutate(SymbolList seq) throws ChangeVetoException, IllegalAlphabetException, IllegalSymbolException Description copied from interface:MutationFunctionProduces a new SymbolList by mutation. Each position i in the SymbolListseqis mutated with probabilitygetMutationProbs[i]. The new residue is selected at random from theDistribution 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 ofseqmutating. If the length of the array defined ingetMutationProbs()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.- Parameters:
seq- the sequence to mutate- Returns:
- The mutated sequence.
- Throws:
ChangeVetoException- ifseqis unmodifiableIllegalAlphabetException- If themutationSpectrum Distributionis not emitting Symbols from the sameAlphabetasseq.IllegalSymbolException- if themutationSpectrum Distributionis not conditioned with the sameAlphabetas theseq Alphabet.
-