public class ShortSequence extends SimpleDiscreteSequence
shorts
s and can therefore be used for discrete
AlphabetContainer
s with alphabets that use many different symbols.Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>
alphabetCon, annotation, rc
Constructor and Description |
---|
ShortSequence(AlphabetContainer alphabetContainer,
SequenceAnnotation[] annotation,
String sequence,
String delim)
|
ShortSequence(AlphabetContainer alphabetContainer,
SequenceAnnotation[] annotation,
SymbolExtractor extractor)
Creates a new
ShortSequence from a SymbolExtractor . |
ShortSequence(AlphabetContainer alphabetContainer,
short[] content)
Creates a new
ShortSequence from an array of short -
encoded alphabet symbols. |
ShortSequence(AlphabetContainer alphabetContainer,
String sequence)
Creates a new
ShortSequence from a String representation
using the default delimiter. |
Modifier and Type | Method and Description |
---|---|
int |
discreteVal(int pos)
Returns the discrete value at position
pos of the
Sequence . |
protected ShortSequence |
flatCloneWithoutAnnotation()
Works in analogy to
Object.clone() , but does not clone the
annotation. |
int |
getLength()
Returns the length of the
Sequence . |
addToRepresentation, compareTo, continuousVal, fillContainer, getEmptyContainer, 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
public ShortSequence(AlphabetContainer alphabetContainer, short[] content) throws WrongAlphabetException, WrongSequenceTypeException
ShortSequence
from an array of short
-
encoded alphabet symbols. This constructor is designed for the method
StatisticalModel.emitDataSet(int, int...)
.alphabetContainer
- the AlphabetContainer
for the sequencecontent
- an array containing the encoded symbolsWrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with short
sStatisticalModel.emitDataSet(int, int...)
,
SimpleDiscreteSequence.SimpleDiscreteSequence(AlphabetContainer, SequenceAnnotation[])
public ShortSequence(AlphabetContainer alphabetContainer, String sequence) throws WrongAlphabetException, WrongSequenceTypeException
ShortSequence
from a String
representation
using the default delimiter.alphabetContainer
- the AlphabetContainer
for the sequencesequence
- a String
representation of the sequenceWrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with short
sShortSequence(AlphabetContainer, SequenceAnnotation[],
String, String)
public ShortSequence(AlphabetContainer alphabetContainer, SequenceAnnotation[] annotation, String sequence, String delim) throws WrongAlphabetException, WrongSequenceTypeException
ShortSequence
from a String
representation
using the delimiter delim
. Annotations for this sequence are
considered by annotation
.alphabetContainer
- the AlphabetContainer
for the sequenceannotation
- the annotation for this sequencesequence
- a String
representation of the sequencedelim
- the delimiter, a String
that separates the symbolsWrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with short
sShortSequence(AlphabetContainer, SequenceAnnotation[],
SymbolExtractor)
public ShortSequence(AlphabetContainer alphabetContainer, SequenceAnnotation[] annotation, SymbolExtractor extractor) throws WrongAlphabetException, WrongSequenceTypeException
ShortSequence
from a SymbolExtractor
.
Annotations for this sequence are considered by annotation
.alphabetContainer
- the AlphabetContainer
for the sequenceannotation
- the annotation for this sequenceextractor
- the SymbolExtractor
WrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with short
sSimpleDiscreteSequence.SimpleDiscreteSequence(AlphabetContainer, SequenceAnnotation[])
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
public int getLength()
Sequence
Sequence
.protected ShortSequence 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 annotation