T - the type of this MultiDimensionalSequencepublic 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 Sequences. |
| 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) |
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 . |
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, toStringprotected Sequence[] content
public MultiDimensionalSequence(SequenceAnnotation[] seqAn, Sequence... sequence) throws WrongLengthException, WrongAlphabetException
MultiDimensionalSequence from a set of individual Sequences.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 AlphabetContainerspublic double continuousVal(int pos)
Sequencepos of the
Sequence.continuousVal in class Sequence<T>pos - the position of the Sequencepos of the
Sequencepublic int discreteVal(int pos)
Sequencepos of the
Sequence.discreteVal in class Sequence<T>pos - the position of the Sequencepos of the
Sequenceprotected abstract MultiDimensionalSequence<T> getInstance(SequenceAnnotation[] seqAn, Sequence... seqs) throws WrongLengthException, WrongAlphabetException
protected MultiDimensionalSequence<T> flatCloneWithoutAnnotation()
SequenceObject.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()
SequenceString 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)
SequenceaddToRepresentation 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)
SequencegetStringRepresentation 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()
SequenceSequence.public boolean isMultiDimensional()
Sequencetrue if the sequence is multidimensional, otherwise .isMultiDimensional in class Sequence<T>true if the sequence is multidimensional, otherwise public MultiDimensionalSequence<T> complement(int start, int end) throws OperationNotSupportedException
SequenceSequence 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
Sequenceend - the end position (exclusive) in the original SequenceSequence of the partOperationNotSupportedException - if the current Sequence is not based on a
ComplementableDiscreteAlphabetComplementableDiscreteAlphabetpublic MultiDimensionalSequence<T> reverseComplement(int start, int end) throws OperationNotSupportedException
SequenceSequence 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
Sequenceend - the end position (exclusive) in the original SequenceSequence of the partOperationNotSupportedException - if the current Sequence is not discrete and simple
((not based on a ComplementableDiscreteAlphabet)Sequence.reverse(),
Sequence.complement(),
ComplementableDiscreteAlphabetprotected int hashCodeForPos(int pos)
SequenceSequence.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()
contentpublic Sequence getSequence(int index)
index.index - the index of the internal sequenceindex