public class MappedDiscreteSequence extends SimpleDiscreteSequence
Sequence
to an new Sequence
using some DiscreteAlphabetMapping
s.Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>
Modifier and Type | Field and Description |
---|---|
protected SimpleDiscreteSequence |
original
The original
Sequence . |
protected AlphabetContainer |
originalAlphabetContainer
The original
AlphabetContainer . |
protected DiscreteAlphabetMapping[] |
transformation
The
DiscreteAlphabetMapping s used for mapping the original Sequence . |
alphabetCon, annotation, rc
Modifier | Constructor and Description |
---|---|
protected |
MappedDiscreteSequence(AlphabetContainer originalAlphabetContainer,
SequenceAnnotation[] seqAn,
DiscreteAlphabetMapping... transformation)
This method allows to create an empty
MappedDiscreteSequence . |
|
MappedDiscreteSequence(SimpleDiscreteSequence original,
DiscreteAlphabetMapping... transformation)
This method allows to create a
MappedDiscreteSequence from a given Sequence and some given DiscreteAlphabetMapping s. |
Modifier and Type | Method and Description |
---|---|
int |
discreteVal(int pos)
Returns the discrete value at position
pos of the
Sequence . |
void |
fillContainer(int[] container,
int pos)
The method fills the content of a specific position in to the container.
|
protected MappedDiscreteSequence |
flatCloneWithoutAnnotation()
Works in analogy to
Object.clone() , but does not clone the
annotation. |
int[] |
getEmptyContainer()
The method returns a container that can be used for accessing the symbols for each position.
|
int |
getLength()
Returns the length of the
Sequence . |
double |
getLogNumberOfPossibleOriginalSequences()
|
double |
getLogNumberOfPossibleOriginalSequences(int start,
int end)
|
static AlphabetContainer |
getNewAlphabetContainer(AlphabetContainer original,
DiscreteAlphabetMapping... transformation)
This method allows to create a new
AlphabetContainer given an old AlphabetContainer and some DiscreteAlphabetMapping s. |
addToRepresentation, compareTo, continuousVal, getEmptyRepresentation, getStringRepresentation, hashCodeForPos, isMultiDimensional, shuffle
annotate, compareTo, complement, complement, create, create, create, equals, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getHammingDistance, getNumberOfSequenceAnnotationsByType, getSequenceAnnotationByType, getSequenceAnnotationByTypeAndIdentifier, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, matches, reverse, reverse, reverseComplement, reverseComplement, toDiscrete, toString, toString, toString, toString
protected SimpleDiscreteSequence original
Sequence
.protected AlphabetContainer originalAlphabetContainer
AlphabetContainer
.protected DiscreteAlphabetMapping[] transformation
DiscreteAlphabetMapping
s used for mapping the original Sequence
.protected MappedDiscreteSequence(AlphabetContainer originalAlphabetContainer, SequenceAnnotation[] seqAn, DiscreteAlphabetMapping... transformation) throws WrongAlphabetException
MappedDiscreteSequence
. That is a MappedDiscreteSequence
that contains no original Sequence
.originalAlphabetContainer
- the original AlphabetContainer
seqAn
- the SequenceAnnotation
s for the MappedDiscreteSequence
transformation
- the DiscreteAlphabetMapping
defining the mappingWrongAlphabetException
- if the mapped AlphabetContainer
is not discrete (should never happen)public MappedDiscreteSequence(SimpleDiscreteSequence original, DiscreteAlphabetMapping... transformation) throws WrongAlphabetException
MappedDiscreteSequence
from a given Sequence
and some given DiscreteAlphabetMapping
s.original
- the original Sequence
transformation
- the DiscreteAlphabetMapping
defining the mappingWrongAlphabetException
- if the mapped AlphabetContainer
is not discrete (should never happen)public static final AlphabetContainer getNewAlphabetContainer(AlphabetContainer original, DiscreteAlphabetMapping... transformation)
AlphabetContainer
given an old AlphabetContainer
and some DiscreteAlphabetMapping
s.original
- the original AlphabetContainer
transformation
- the DiscreteAlphabetMapping
s defining the mappingAlphabetContainer
public int discreteVal(int pos)
Sequence
pos
of the
Sequence
.discreteVal
in class Sequence<int[]>
pos
- the position of the Sequence
pos
of the
Sequence
protected MappedDiscreteSequence flatCloneWithoutAnnotation()
Sequence
Object.clone()
, but does not clone the
annotation. This method is used in
Sequence.annotate(boolean, SequenceAnnotation...)
.flatCloneWithoutAnnotation
in class Sequence<int[]>
Sequence
without annotationpublic int getLength()
Sequence
Sequence
.public double getLogNumberOfPossibleOriginalSequences()
public double getLogNumberOfPossibleOriginalSequences(int start, int end)
public final int[] getEmptyContainer()
Sequence
getEmptyContainer
in class SimpleDiscreteSequence
Sequence.fillContainer(Object, int)
,
Sequence.isMultiDimensional()
public final void fillContainer(int[] container, int pos)
Sequence
fillContainer
in class SimpleDiscreteSequence
container
- the container which is used for filling the content.pos
- the positionSequence.getEmptyContainer()
,
Sequence.isMultiDimensional()