T
- the type of this MultiDimensionalSequence
public abstract class MultiDimensionalSequence<T> extends Sequence<T>
Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>
Modifier and Type | Field and Description |
---|---|
protected Sequence[] |
content
The internally used sequences.
|
alphabetCon, annotation, rc
Constructor and Description |
---|
MultiDimensionalSequence(SequenceAnnotation[] seqAn,
Sequence... sequence)
This constructor creates an
MultiDimensionalSequence from a set of individual Sequence s. |
Modifier and Type | Method and Description |
---|---|
protected void |
addToRepresentation(Object representation,
int pos,
String delim)
This method adds the information of one position to the representation using the specified delimiter
|
MultiDimensionalSequence<T> |
complement(int start,
int end)
|
double |
continuousVal(int pos)
Returns the continuous value at position
pos of the
Sequence . |
int |
discreteVal(int pos)
Returns the discrete value at position
pos of the
Sequence . |
protected MultiDimensionalSequence<T> |
flatCloneWithoutAnnotation()
Works in analogy to
Object.clone() , but does not clone the
annotation. |
SequenceAnnotation[][] |
getAnnotations()
This method returns the
SequenceAnnotation [] for each dimension of this multidimensional sequence. |
protected Object |
getEmptyRepresentation()
Returns an empty representation which is used to create the
String representation of this instance in the method Sequence.toString(String, int, int) . |
protected abstract MultiDimensionalSequence<T> |
getInstance(SequenceAnnotation[] seqAn,
Sequence... seqs)
Returns a new instance of a
MultiDimensionalSequence with given SequenceAnnotation s and given Sequence s. |
int |
getLength()
Returns the length of the
Sequence . |
int |
getNumberOfSequences()
This method returns the number of internal sequences.
|
Sequence |
getSequence(int index)
This method returns the internal sequence with index
index . |
protected String |
getStringRepresentation(Object representation)
This method creates a String representation from the given representation.
|
protected int |
hashCodeForPos(int pos)
This method is used in
Sequence.hashCode() and the hash code for one specific position. |
boolean |
isMultiDimensional()
The method returns
true if the sequence is multidimensional, otherwise false . |
MultiDimensionalSequence<T> |
reverseComplement(int start,
int end)
|
annotate, compareTo, compareTo, complement, create, create, create, equals, fillContainer, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getEmptyContainer, getHammingDistance, getNumberOfSequenceAnnotationsByType, getSequenceAnnotationByType, getSequenceAnnotationByTypeAndIdentifier, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, matches, reverse, reverse, reverseComplement, toDiscrete, toString, toString, toString, toString
protected Sequence[] content
public MultiDimensionalSequence(SequenceAnnotation[] seqAn, Sequence... sequence) throws WrongLengthException, WrongAlphabetException
MultiDimensionalSequence
from a set of individual Sequence
s.seqAn
- the annotations for the aligned sequencessequence
- the individual sequences that have been alignedWrongLengthException
- if the sequences have different lengthsWrongAlphabetException
- if the sequences have different AlphabetContainer
spublic double continuousVal(int pos)
Sequence
pos
of the
Sequence
.continuousVal
in class Sequence<T>
pos
- the position of the Sequence
pos
of the
Sequence
public int discreteVal(int pos)
Sequence
pos
of the
Sequence
.discreteVal
in class Sequence<T>
pos
- the position of the Sequence
pos
of the
Sequence
protected abstract MultiDimensionalSequence<T> getInstance(SequenceAnnotation[] seqAn, Sequence... seqs) throws WrongLengthException, WrongAlphabetException
MultiDimensionalSequence
with given SequenceAnnotation
s and given Sequence
s.seqAn
- the sequence annotationsseqs
- the sequence buidl9ing the new MultiDimensionalSequence
MultiDimensionalSequence
with given SequenceAnnotation
s and given Sequence
sWrongLengthException
- if the sequences have different lengthsWrongAlphabetException
- if the sequences have different AlphabetContainer
sflatCloneWithoutAnnotation()
,
Sequence.complement()
,
Sequence.reverseComplement()
protected MultiDimensionalSequence<T> 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 annotationprotected Object getEmptyRepresentation()
Sequence
String
representation of this instance in the method Sequence.toString(String, int, int)
.getEmptyRepresentation
in class Sequence<T>
String
representationSequence.toString(String, int, int)
protected void addToRepresentation(Object representation, int pos, String delim)
Sequence
addToRepresentation
in class Sequence<T>
representation
- the representationpos
- the positiondelim
- the delimiter separating the information for different positionsSequence.getEmptyRepresentation()
,
Sequence.toString(String, int, int)
protected String getStringRepresentation(Object representation)
Sequence
getStringRepresentation
in class Sequence<T>
representation
- the representation instance (which should be created by Sequence.getEmptyContainer()
and filled by Sequence.addToRepresentation(Object, int, String)
)Sequence.getEmptyRepresentation()
,
Sequence.addToRepresentation(Object, int, String)
,
Sequence.toString(String, int, int)
public int getLength()
Sequence
Sequence
.public boolean isMultiDimensional()
Sequence
true
if the sequence is multidimensional, otherwise false
.isMultiDimensional
in class Sequence<T>
true
if the sequence is multidimensional, otherwise false
public MultiDimensionalSequence<T> complement(int start, int end) throws OperationNotSupportedException
Sequence
Sequence
containing a part
of the complementary current Sequence
.
AlphabetContainer
on
DNAAlphabet
returns "ATTAT".complement
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 based on a
ComplementableDiscreteAlphabet
ComplementableDiscreteAlphabet
public MultiDimensionalSequence<T> 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 int hashCodeForPos(int pos)
Sequence
Sequence.hashCode()
and the hash code for one specific position.hashCodeForPos
in class Sequence<T>
pos
- the positionpublic SequenceAnnotation[][] getAnnotations()
SequenceAnnotation
[] for each dimension of this multidimensional sequence.SequenceAnnotation
array for each dimension of this multidimensional sequenceSequence.getAnnotation()
public int getNumberOfSequences()
content
public Sequence getSequence(int index)
index
.index
- the index of the internal sequenceindex