public abstract class AbstractManyToOneTranslationTable extends Object implements ManyToOneTranslationTable
The mapping between the alphabets can be either one-to-one or many-to one.
ALT_YEAST_NUC, ASCID_MITO, BACTERIAL, BLEPH_MNUC, CHLORO_MITO, CILIATE_NUC, ECHIN_MITO, EUPL_NUC, FWORM_MITO, INVERT_MITO, MOLD_MITO, SCENE_MITO, TREMA_MITO, UNIVERSAL, VERT_MITO, YEAST_MITO
Constructor and Description |
---|
AbstractManyToOneTranslationTable() |
Modifier and Type | Method and Description |
---|---|
protected abstract Symbol |
doTranslate(Symbol sym)
this method is expected to translate any symbol
in the source alphabet.
|
protected abstract Set |
doUntranslate(Symbol sym)
this method is expected to reverse-translate any symbol
in the source alphabet.
|
abstract Alphabet |
getSourceAlphabet()
The alphabet of Symbols that can be translated.
|
abstract Alphabet |
getTargetAlphabet()
The alphabet of Symbols that will be produced.
|
Symbol |
translate(Symbol sym)
Translate a single symbol from source alphabet to the target alphabet.
|
Set |
untranslate(Symbol sym)
returns a Set of Atomic Symbols that are the reverse translation
of the specified Symbol in the target alphabet.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
translate
public AbstractManyToOneTranslationTable()
public abstract Alphabet getSourceAlphabet()
TranslationTable
getSourceAlphabet
in interface TranslationTable
public abstract Alphabet getTargetAlphabet()
TranslationTable
getTargetAlphabet
in interface TranslationTable
protected abstract Set doUntranslate(Symbol sym) throws IllegalSymbolException
As an optimisation, if your method is capable of immediately translating an ambiguity Symbol, just return it and the alternate route of establishing the translation through doing an ambiguity lookup will be avoided.
IllegalSymbolException
public Set untranslate(Symbol sym) throws IllegalSymbolException
untranslate
in interface ManyToOneTranslationTable
sym
- the Symbol to reverse-translate (member of target alphabet)IllegalSymbolException
- if sym is not a member of the target
alphabetprotected abstract Symbol doTranslate(Symbol sym) throws IllegalSymbolException
As an optimisation, if your method is capable of immediately translating an ambiguity Symbol, just return it and the alternate route of establishing the translation through doing an ambiguity lookup will be avoided.
IllegalSymbolException
public Symbol translate(Symbol sym) throws IllegalSymbolException
TranslationTable
translate
in interface TranslationTable
sym
- the Symbol to translate (member of source alphabet)IllegalSymbolException
- if sym is not a member of the source
alphabetCopyright © 2014 BioJava. All rights reserved.