T - the type of the internal sequencepublic class CyclicSequenceAdaptor<T> extends Sequence<T>
Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>alphabetCon, annotation, rc| Constructor and Description |
|---|
CyclicSequenceAdaptor(Sequence<T> seq)
Creates a new cyclic sequence of the length of the original sequence.
|
CyclicSequenceAdaptor(Sequence<T> seq,
int extLength)
Creates a new cyclic sequence of given virtual length (i.e., the length reported by
getLength()). |
| 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
|
int |
compareTo(Sequence<T> s) |
protected int |
compareTo(T t1,
T t2)
This method compares to container and is used in
Sequence.compareTo(Sequence). |
CyclicSequenceAdaptor<T> |
complement()
|
CyclicSequenceAdaptor<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. |
void |
fillContainer(T container,
int pos)
The method fills the content of a specific position in to the container.
|
protected CyclicSequenceAdaptor<T> |
flatCloneWithoutAnnotation()
Works in analogy to
Object.clone(), but does not clone the
annotation. |
T |
getEmptyContainer()
The method returns a container that can be used for accessing the symbols for each position.
|
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). |
int |
getLength()
Returns the length of the
Sequence. |
protected String |
getStringRepresentation(Object representation)
This method creates a String representation from the given representation.
|
CyclicSequenceAdaptor<T> |
getSuperSequence(int length)
Returns a new cyclic sequence using the internal sequence of this
CyclicSequenceAdaptor but with
the supplied virtual length |
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 . |
CyclicSequenceAdaptor<T> |
reverse(int start,
int end)
|
CyclicSequenceAdaptor<T> |
reverseComplement()
|
CyclicSequenceAdaptor<T> |
reverseComplement(int start,
int end)
|
annotate, create, create, create, equals, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getHammingDistance, getNumberOfSequenceAnnotationsByType, getSequenceAnnotationByType, getSequenceAnnotationByTypeAndIdentifier, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, matches, reverse, toDiscrete, toString, toString, toString, toStringpublic CyclicSequenceAdaptor(Sequence<T> seq, int extLength)
getLength()).seq - the original sequenceextLength - the virtual lengthpublic 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 CyclicSequenceAdaptor<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 annotationpublic int getLength()
SequenceSequence.protected int compareTo(T t1, T t2)
SequenceSequence.compareTo(Sequence).compareTo in class Sequence<T>t1 - the first containert2 - the second containerSequence.getEmptyContainer(),
Sequence.fillContainer(Object, int),
Comparable.compareTo(java.lang.Object)protected 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)protected int hashCodeForPos(int pos)
SequenceSequence.hashCode() and the hash code for one specific position.hashCodeForPos in class Sequence<T>pos - the positionpublic boolean isMultiDimensional()
Sequencetrue if the sequence is multidimensional, otherwise .isMultiDimensional in class Sequence<T>true if the sequence is multidimensional, otherwise public T getEmptyContainer()
SequencegetEmptyContainer in class Sequence<T>Sequence.fillContainer(Object, int),
Sequence.isMultiDimensional()public void fillContainer(T container, int pos)
SequencefillContainer in class Sequence<T>container - the container which is used for filling the content.pos - the positionSequence.getEmptyContainer(),
Sequence.isMultiDimensional()public CyclicSequenceAdaptor<T> reverse(int start, int end) throws OperationNotSupportedException
Sequencereverse 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 based on an
AlphabetContainer that is not simplepublic CyclicSequenceAdaptor<T> complement() throws OperationNotSupportedException
SequenceSequence containing the
complementary current Sequence.
AlphabetContainer on
DNAAlphabet returns "ATTAT".complement in class Sequence<T>SequenceOperationNotSupportedException - if the current Sequence is not based on a
ComplementableDiscreteAlphabetComplementableDiscreteAlphabet,
Sequence.complement(int, int)public CyclicSequenceAdaptor<T> reverseComplement() throws OperationNotSupportedException
SequenceSequence containing the
reverse complementary current Sequence. For more details see the
methods Sequence.reverse() and Sequence.complement().reverseComplement in class Sequence<T>SequenceOperationNotSupportedException - if the current Sequence is not discrete and simple
(not based on a ComplementableDiscreteAlphabet)Sequence.reverse(),
Sequence.complement(),
Sequence.reverseComplement(int, int),
ComplementableDiscreteAlphabetpublic CyclicSequenceAdaptor<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 CyclicSequenceAdaptor<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(),
ComplementableDiscreteAlphabetpublic CyclicSequenceAdaptor<T> getSuperSequence(int length)
CyclicSequenceAdaptor but with
the supplied virtual lengthlength - the virtual lengthCyclicSequenceAdaptor(Sequence, int)