|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MutationFunction
A class that mutates a SymbolList
Nested Class Summary | |
---|---|
static class |
MutationFunction.NoMutation
Place Holder class that doesn't mutate its SymbolLists |
Field Summary | |
---|---|
static double[] |
DEFAULT_MUTATION_PROBS
|
static ChangeType |
MUTATION_PROBS
|
static ChangeType |
MUTATION_SPECTRUM
|
static MutationFunction |
NO_MUTATION
|
Method Summary | |
---|---|
double[] |
getMutationProbs()
|
OrderNDistribution |
getMutationSpectrum()
|
SymbolList |
mutate(SymbolList seq)
Produces a new SymbolList by mutation. |
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. |
Methods inherited from interface org.biojava.utils.Changeable |
---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Field Detail |
---|
static final double[] DEFAULT_MUTATION_PROBS
static final ChangeType MUTATION_PROBS
static final ChangeType MUTATION_SPECTRUM
static final MutationFunction NO_MUTATION
Method Detail |
---|
SymbolList mutate(SymbolList seq) throws IllegalAlphabetException, ChangeVetoException, IllegalSymbolException
seq
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 mutate
IllegalAlphabetException
- If the mutationSpectrum Distribution
is not
emitting Symbols from the same Alphabet
as seq
.
IllegalSymbolException
- if the mutationSpectrum Distribution
is not
conditioned with the same Alphabet
as the seq Alphabet
.
ChangeVetoException
- if seq
is unmodifiablevoid setMutationProbs(double[] mutationProbs) throws ChangeVetoException
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.
mutationProbs
- an array of double values representing mutation probabilities
ChangeVetoException
- if a ChangeListener vetoes the change.double[] getMutationProbs()
void setMutationSpectrum(OrderNDistribution mutationSpectrum) throws ChangeVetoException
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.
mutationSpectrum
- the Distribution of 'mutant' bases to choose from.
ChangeVetoException
- if a ChangeListener vetoes the change.OrderNDistribution getMutationSpectrum()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |