|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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 MultiDimensionalSequence
public 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 Sequence s. |
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 Sequence
s.
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 AlphabetContainer
sMethod Detail |
---|
public 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
WrongLengthException
WrongAlphabetException
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
.
getLength
in class Sequence<T>
Sequence
public boolean isMultiDimensional()
Sequence
true
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
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 part
OperationNotSupportedException
- 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 part
OperationNotSupportedException
- 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 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()
content
public Sequence getSequence(int index)
index
.
index
- the index of the internal sequence
index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |