Class GapDistribution
- All Implemented Interfaces:
Serializable,Distribution,Changeable
It is a useful thing to have around for pair-wise alignment, as you can build a PairDistribution that emits gaps in one sequence and Symbols in the other. The GapDistriution will always emit with a probability of 1, as every symbol has a matches alphabet that contains the empty set. Or is this so?
- Since:
- 1.0
- Author:
- Matthew Pocock
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.dist.Distribution
Distribution.NullModelForwarder -
Field Summary
Fields inherited from interface org.biojava.bio.dist.Distribution
NULL_MODEL, WEIGHTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe alphabet from which this spectrum emits symbols.Retrieve the null model Distribution that this Distribution recognizes.doubleReturn the probability that Symbol s is emitted by this spectrum.voidRegister this distribution with a training context.Sample a symbol from this state's probability distribution.voidsetNullModel(Distribution nullModel) Set the null model Distribution that this Distribution recognizes.voidSet the probability or odds that Symbol s is emitted by this state.Methods inherited from class org.biojava.utils.Unchangeable
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarderMethods 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
-
GapDistribution
Get a GapDistribution for an alphabet.- Parameters:
alpha- the Alphabet that this distribution is over
-
-
Method Details
-
getWeight
Description copied from interface:DistributionReturn the probability that Symbol s is emitted by this spectrum.
If the symbol is ambiguou, then it is the sum of the probability that each one of the matching symbols was emitted.
- Specified by:
getWeightin interfaceDistribution- Parameters:
sym- the Symbol emitted- Returns:
- the probability of emitting that symbol
- Throws:
IllegalSymbolException- if s is not from this state's alphabet
-
setWeight
public void setWeight(Symbol s, double w) throws IllegalSymbolException, UnsupportedOperationException Description copied from interface:DistributionSet the probability or odds that Symbol s is emitted by this state.- Specified by:
setWeightin interfaceDistribution- Parameters:
s- the Symbol emittedw- the probability of emitting that symbol- Throws:
IllegalSymbolException- if s is not from this state's alphabet, or if it is an ambiguity symbol and the implementation can't handle this caseUnsupportedOperationException
-
getAlphabet
Description copied from interface:DistributionThe alphabet from which this spectrum emits symbols.- Specified by:
getAlphabetin interfaceDistribution- Returns:
- the Alphabet associated with this spectrum
-
sampleSymbol
Description copied from interface:DistributionSample a symbol from this state's probability distribution.- Specified by:
sampleSymbolin interfaceDistribution- Returns:
- the symbol sampled
-
getNullModel
Description copied from interface:DistributionRetrieve the null model Distribution that this Distribution recognizes.- Specified by:
getNullModelin interfaceDistribution- Returns:
- the apropriate null model
-
setNullModel
public void setNullModel(Distribution nullModel) throws IllegalAlphabetException, ChangeVetoException Description copied from interface:DistributionSet the null model Distribution that this Distribution recognizes.- Specified by:
setNullModelin interfaceDistribution- Parameters:
nullModel- the new null model Distribution- Throws:
IllegalAlphabetException- if the null model has the wrong alphabetChangeVetoException- if this Distirbution doesn't support setting the null model, or if one of its listeners objects
-
registerWithTrainer
Description copied from interface:DistributionRegister this distribution with a training context.
This should be invoked from within dtc.addDistribution(). This method is responsible for constructing a suitable DistributionTrainer instance and registering it by calling dtc.registerDistributionTrainer(this, trainer). If the distribution is a view onto another distribution, it can force the other to be registered by calling dtc.addDistribution(other), and can then get on with registering it's own trainer.
- Specified by:
registerWithTrainerin interfaceDistribution- Parameters:
dtc- the DistributionTrainerContext with witch to register a trainer
-