T
- the type of each positionpublic static class Sequence.SubSequence<T> extends Sequence.RecursiveSequence<T>
Sequence.SubSequence
s are often used to
extract the Sequence
of a sliding window on a long
Sequence
. The class is implemented in such a way that it avoids
chains of Sequence.SubSequence
s.Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>
content
alphabetCon, annotation, rc
Constructor and Description |
---|
SubSequence(AlphabetContainer abc,
Sequence seq,
int start,
int length)
This constructor should be used if one wants to create a
DataSet of Sequence.SubSequence s of defined length. |
SubSequence(Sequence seq,
int start,
int length)
This is a very efficient way to create a
Sequence.SubSequence of
defined length for Sequence s with a simple
AlphabetContainer . |
Modifier and Type | Method and Description |
---|---|
int |
discreteVal(int pos)
Returns the discrete value at position
pos of the
Sequence . |
protected Sequence |
flatCloneWithoutAnnotation()
Works in analogy to
Object.clone() , but does not clone the
annotation. |
protected int |
getIndex(int pos)
Returns the index in the internal sequence.
|
int |
getLength()
Returns the length of the
Sequence . |
Sequence<T> |
getOriginal()
Returns the original sequence, this sequence is a sub-sequence of.
|
int |
getStart()
Returns the start of this sub-sequence in the original sequence.
|
Sequence |
reverseComplement(int start,
int end)
|
addToRepresentation, compareTo, continuousVal, fillContainer, getEmptyContainer, getEmptyRepresentation, getStringRepresentation, hashCodeForPos, isMultiDimensional
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, toDiscrete, toString, toString, toString, toString
public SubSequence(AlphabetContainer abc, Sequence seq, int start, int length)
DataSet
of Sequence.SubSequence
s of defined length. With this
constructor you are enabled to create a DataSet
where every
Sequence
has the same AlphabetContainer
instance.
AlphabetContainer
matches
with the one of the Sequence.SubSequence
.abc
- the new AlphabetContainer
seq
- the original Sequence
start
- the index of the start positionlength
- the length of the new sequencepublic SubSequence(Sequence seq, int start, int length)
Sequence.SubSequence
of
defined length for Sequence
s with a simple
AlphabetContainer
.public Sequence reverseComplement(int start, int end) throws OperationNotSupportedException
Sequence
Sequence
containing a
reverse part of the complementary current Sequence
. For more
details see the methods Sequence.reverse()
and Sequence.complement()
.reverseComplement
in class Sequence<T>
start
- the start position (inclusive) in the original
Sequence
end
- the end position (exclusive) in the original Sequence
Sequence
of the partOperationNotSupportedException
- if the current Sequence
is not discrete and simple
((not based on a ComplementableDiscreteAlphabet
)Sequence.reverse()
,
Sequence.complement()
,
ComplementableDiscreteAlphabet
protected final int getIndex(int pos)
Sequence.RecursiveSequence
getIndex
in class Sequence.RecursiveSequence<T>
pos
- the index in the external sequencepublic Sequence<T> getOriginal()
public int getStart()
public final int discreteVal(int pos)
Sequence
pos
of the
Sequence
.discreteVal
in class Sequence.RecursiveSequence<T>
pos
- the position of the Sequence
pos
of the
Sequence
public int getLength()
Sequence
Sequence
.protected Sequence flatCloneWithoutAnnotation()
Sequence
Object.clone()
, but does not clone the
annotation. This method is used in
Sequence.annotate(boolean, SequenceAnnotation...)
.flatCloneWithoutAnnotation
in class Sequence<T>
Sequence
without annotation