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 discrete 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 standard constructor for the interface
Storable
.
Creates a new DNAAlphabet
out of its XML representation.
- Parameters:
representation
- the XML representation as StringBuffer
- Throws:
NonParsableException
- if the DNAAlphabet
could not be reconstructed out of
the XML representation (the StringBuffer
representation
could not be parsed)- See Also:
ComplementableDiscreteAlphabet.ComplementableDiscreteAlphabet(StringBuffer)
,
Storable
DNAAlphabet
public DNAAlphabet(DNAAlphabet.DNAAlphabetParameterSet parameters)
throws IllegalArgumentException,
DoubleSymbolException
- The constructor for the
InstantiableFromParameterSet
interface. Creates a new DNAAlphabet
from a given parameter set.
- Parameters:
parameters
- the given set of parameters
- Throws:
IllegalArgumentException
- if space or tab will be used as symbols
DoubleSymbolException
- if one of the symbols occurred more than once- See Also:
DNAAlphabet()
DNAAlphabet
public DNAAlphabet()
throws DoubleSymbolException,
IllegalArgumentException
- The main constructor. Creates a new
DNAAlphabet
with the standard
DNA-alphabet ("A", "C", "G", "T").
- Throws:
DoubleSymbolException
- if one of the symbols occurred more than once
IllegalArgumentException
- if space or tab will be used as symbols- See Also:
ComplementableDiscreteAlphabet.ComplementableDiscreteAlphabet(boolean, String...)
getComplementaryCode
public int getComplementaryCode(int code)
- Description copied from class:
ComplementableDiscreteAlphabet
- This method returns the code of the symbol that 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
InstanceParameterSet
that has been used to
instantiate the current instance of the implementing class. If the
current instance was not created using an InstanceParameterSet
,
an equivalent InstanceParameterSet
should be returned, so that an
instance created using this InstanceParameterSet
would be in
principle equal to the current instance.
- Specified by:
getCurrentParameterSet
in interface InstantiableFromParameterSet
- Specified by:
getCurrentParameterSet
in class ComplementableDiscreteAlphabet
- Returns:
- the current
InstanceParameterSet
- Throws:
Exception
- if the InstanceParameterSet
could not be returned