de.jstacs.data.alphabets
Class DNAAlphabet
java.lang.Object
de.jstacs.data.Alphabet
de.jstacs.data.alphabets.DiscreteAlphabet
de.jstacs.data.alphabets.ComplementableDiscreteAlphabet
de.jstacs.data.alphabets.DNAAlphabet
- All Implemented Interfaces:
- InstantiableFromParameterSet, Storable, Comparable<Alphabet>
public final class DNAAlphabet
- extends ComplementableDiscreteAlphabet
This class implements the alphabet that is used for DNA.
- Author:
- Jan Grau, Jens Keilwagen
Methods inherited from class de.jstacs.data.alphabets.DiscreteAlphabet |
compareTo, getCode, getMaximalSymbolLength, getMin, getSymbolAt, ignoresCase, isEncodedSymbol, isSymbol, length, toString, toXML |
DNAAlphabet
public DNAAlphabet(StringBuffer representation)
throws NonParsableException
- The constructor for the
Storable
interface.
- Parameters:
representation
- the xml representation
- Throws:
NonParsableException
- if the stream is not parsable
DNAAlphabet
public DNAAlphabet(DNAAlphabet.DNAAlphabetParameterSet parameters)
throws IllegalArgumentException,
DoubleSymbolException
- The constructor for the
InstantiableFromParameterSet
interface.
- Parameters:
parameters
- the ParameterSet
- Throws:
IllegalArgumentException
- is thrown if space or tab will be used as symbols
DoubleSymbolException
- is thrown if one of the symbols occurred more than once
DNAAlphabet
public DNAAlphabet()
throws DoubleSymbolException,
IllegalArgumentException
- The main constructor.
- Throws:
DoubleSymbolException
- is thrown if one of the symbols occurred more than once
IllegalArgumentException
- is thrown if space or tab will be used as symbols
getComplementaryCode
public int getComplementaryCode(int code)
- Description copied from class:
ComplementableDiscreteAlphabet
- This method returns the code of the symbol the is the complement of the symbol encoded by
code
- Specified by:
getComplementaryCode
in class ComplementableDiscreteAlphabet
- Parameters:
code
- the encoded symbol
- Returns:
- the code of the complement
getCurrentParameterSet
public Alphabet.AlphabetParameterSet getCurrentParameterSet()
throws Exception
- Description copied from interface:
InstantiableFromParameterSet
- Returns the
ParameterSet
that has been used to instantiate the current instance of the implementing
class. If the current instance was not created using a ParameterSet
, an equivalent
ParameterSet
should be returned, such that an instance created using this
ParameterSet
would be in principle equal to the current instance.
- Specified by:
getCurrentParameterSet
in interface InstantiableFromParameterSet
- Specified by:
getCurrentParameterSet
in class ComplementableDiscreteAlphabet
- Returns:
- the current
ParameterSet
- Throws:
Exception
- is thrown if the ParameterSet
could not be returned