|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojava.bio.dist.TranslatedDistribution
Creates a distribution that is a translated view of an underlying distribution.
Nested Class Summary |
Nested classes inherited from class org.biojava.bio.dist.Distribution |
Distribution.NullModelForwarder |
Field Summary |
Fields inherited from interface org.biojava.bio.dist.Distribution |
NULL_MODEL, WEIGHTS |
Constructor Summary | |
TranslatedDistribution(ReversibleTranslationTable table,
Distribution other,
DistributionFactory distFact)
Users should make these thigs via getDistribuiton. |
Method Summary | |
Alphabet |
getAlphabet()
The alphabet from which this spectrum emits symbols. |
protected ChangeSupport |
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object |
Distribution |
getNullModel()
Retrieve the null model Distribution that this Distribution recognizes. |
ReversibleTranslationTable |
getTable()
Retrieve the translation table encapsulating the map from this emission spectrum to the underlying one. |
double |
getWeight(Symbol sym)
Return the probability that Symbol s is emited by this spectrum. |
void |
registerWithTrainer(DistributionTrainerContext dtc)
Register this distribution with a training context. |
Symbol |
sampleSymbol()
Sample a symbol from this state's probability distribution. |
void |
setNullModel(Distribution dist)
Set the null model Distribution that this Distribution recognizes. |
void |
setWeight(Symbol sym,
double weight)
Set the probability or odds that Symbol s is emited by this state. |
Methods inherited from class org.biojava.utils.AbstractChangeable |
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.biojava.utils.Changeable |
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Constructor Detail |
public TranslatedDistribution(ReversibleTranslationTable table, Distribution other, DistributionFactory distFact) throws IllegalAlphabetException
Method Detail |
public Alphabet getAlphabet()
Distribution
getAlphabet
in interface Distribution
public double getWeight(Symbol sym) throws IllegalSymbolException
Distribution
Return the probability that Symbol s is emited 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.
getWeight
in interface Distribution
sym
- the Symbol emitted
IllegalSymbolException
- if s is not from this state's alphabetpublic void setWeight(Symbol sym, double weight) throws IllegalSymbolException, ChangeVetoException
Distribution
setWeight
in interface Distribution
sym
- the Symbol emittedweight
- the probability of emitting that symbol
IllegalSymbolException
- if s is not from this state's alphabet, or
if it is an ambiguity symbol and the implementation can't handle
this case
ChangeVetoException
- if this state does not allow weights
to be tampered with, or if one of the listeners vetoed this changepublic Symbol sampleSymbol()
Distribution
sampleSymbol
in interface Distribution
public Distribution getNullModel()
Distribution
getNullModel
in interface Distribution
public void setNullModel(Distribution dist) throws IllegalAlphabetException, ChangeVetoException
Distribution
setNullModel
in interface Distribution
dist
- the new null model Distribution
IllegalAlphabetException
- if the null model has the wrong alphabet
ChangeVetoException
- if this Distirbution doesn't support setting
the null model, or if one of its listeners objectspublic ReversibleTranslationTable getTable()
public void registerWithTrainer(DistributionTrainerContext dtc)
Distribution
Register 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.
registerWithTrainer
in interface Distribution
dtc
- the DistributionTrainerContext with witch to register a trainerprotected ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
getChangeSupport
in class AbstractChangeable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |