|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.data.sequences.Sequence<T>
de.jstacs.data.sequences.MultiDimensionalSequence<T>
T - the type of this MultiDimensionalSequencepublic abstract class MultiDimensionalSequence<T>
This class is for multidimensional sequences that can be used, for instance, for phylogenetic footprinting.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.jstacs.data.sequences.Sequence |
|---|
Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T> |
| Field Summary | |
|---|---|
protected Sequence[] |
content
The internally used sequences. |
| Fields inherited from class de.jstacs.data.sequences.Sequence |
|---|
alphabetCon, annotation, rc |
| Constructor Summary | |
|---|---|
MultiDimensionalSequence(SequenceAnnotation[] seqAn,
Sequence... sequence)
This constructor creates an MultiDimensionalSequence from a set of individual Sequences. |
|
| Method Summary | |
|---|---|
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)
This method returns a new instance of Sequence containing a part
of the complementary current Sequence. |
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)
This method returns a new instance of Sequence containing a
reverse part of the complementary current Sequence. |
| Methods inherited from class de.jstacs.data.sequences.Sequence |
|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Sequence[] content
| Constructor Detail |
|---|
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 aligned
WrongLengthException - if the sequences have different lengths
WrongAlphabetException - if the sequences have different AlphabetContainers| Method Detail |
|---|
public double continuousVal(int pos)
Sequencepos of the
Sequence.
continuousVal in class Sequence<T>pos - the position of the Sequence
pos of the
Sequencepublic int discreteVal(int pos)
Sequencepos 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
WrongLengthException
WrongAlphabetExceptionprotected 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)
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()
SequenceSequence.
getLength in class Sequence<T>Sequencepublic boolean isMultiDimensional()
Sequencetrue if the sequence is multidimensional, otherwise .
- Specified by:
isMultiDimensional in class Sequence<T>
- Returns:
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 Sequence
Sequence of the part
OperationNotSupportedException - if the current Sequence is not based on a
ComplementableDiscreteAlphabetComplementableDiscreteAlphabet
public 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 Sequence
Sequence of the part
OperationNotSupportedException - 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 position
public 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 sequence
index
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||