Package org.biojavax.ga.functions
Class MutationFunction.NoMutation
java.lang.Object
org.biojavax.ga.functions.MutationFunction.NoMutation
- All Implemented Interfaces:
Changeable,MutationFunction
- Enclosing interface:
- MutationFunction
Place Holder class that doesn't mutate its SymbolLists
- 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
Modifier and TypeMethodDescriptionvoidAdd a listener that will be informed of all changes.voidAdd a listener that will be informed of changes of a given type.double[]booleanA particular ChangeType can never be raised by this Changeable.mutate(SymbolList syml) Produces a new SymbolList by mutation.voidRemove a listener that was interested in all types of changes.voidRemove a listener that was interested in a specific types of changes.voidsetMutationProbs(double[] muts) Set the probability of a mutation occuring at a certain position Position 0 in the array corresponds to the probability of the first residue ofseqmutating.voidSets theDistributionofSymbolsthat will be selected from when a mutation occurs.
-
Constructor Details
-
NoMutation
public NoMutation()
-
-
Method Details
-
getMutationProbs
- Specified by:
getMutationProbsin interfaceMutationFunction
-
getMutationSpectrum
- Specified by:
getMutationSpectrumin interfaceMutationFunction- Returns:
- null if the Distribution has not been set.
-
mutate
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.- Specified by:
mutatein interfaceMutationFunction- Parameters:
syml- the sequence to mutate- Returns:
- The mutated sequence.
-
setMutationProbs
Description copied from interface:MutationFunctionSet the probability of a mutation occuring at a certain position 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.- Specified by:
setMutationProbsin interfaceMutationFunction- Parameters:
muts- an array of double values representing mutation probabilities- Throws:
ChangeVetoException- if a ChangeListener vetoes the change.
-
setMutationSpectrum
Description copied from interface:MutationFunctionSets theDistributionofSymbolsthat will be selected from when a mutation occurs. AnOrderNDistributionis used so that you can model a situation where the identity of the 'mutant'Symbolis dependent on the originalSymbol. The primary use is to preventSymbolsmutating to themselves. Another use would be to model transitions and transversions.- Specified by:
setMutationSpectrumin interfaceMutationFunction- Parameters:
odn- the Distribution of 'mutant' bases to choose from.- Throws:
ChangeVetoException- if a ChangeListener vetoes the change.
-
isUnchanging
Description copied from interface:ChangeableA particular ChangeType can never be raised by this Changeable.
If this returns true, then it is guaranteed that change events of this type (and all child types) can never under any circumstances be fired by this Changeable instance. If it returns false, that does not mean that this type of event will or even can be raised, but that it is worth registering listeners incase.
- Specified by:
isUnchangingin interfaceChangeable- Parameters:
ct- the ChangeType to check- Returns:
- true if ChangeEvents of this type are guaranteed to never be fired
-
removeChangeListener
Description copied from interface:ChangeableRemove a listener that was interested in all types of changes.- Specified by:
removeChangeListenerin interfaceChangeable- Parameters:
c- a ChangeListener to remove
-
addChangeListener
Description copied from interface:ChangeableAdd a listener that will be informed of all changes.- Specified by:
addChangeListenerin interfaceChangeable- Parameters:
cl- the ChangeListener to add
-
addChangeListener
Description copied from interface:ChangeableAdd a listener that will be informed of changes of a given type.- Specified by:
addChangeListenerin interfaceChangeable- Parameters:
cl- the ChangeListenerct- the ChangeType it is to be informed of
-
removeChangeListener
Description copied from interface:ChangeableRemove a listener that was interested in a specific types of changes.- Specified by:
removeChangeListenerin interfaceChangeable- Parameters:
cl- a ChangeListener to removect- the ChangeType that it was interested in
-