public abstract class SimpleDiscreteSequence extends Sequence<int[]>
Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>
alphabetCon, annotation, rc
Constructor and Description |
---|
SimpleDiscreteSequence(AlphabetContainer container,
SequenceAnnotation[] annotation)
This constructor creates a new
SimpleDiscreteSequence with the
AlphabetContainer container and the annotation
annotation but without the content. |
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(int[] t1,
int[] t2)
This method compares to container and is used in
Sequence.compareTo(Sequence) . |
double |
continuousVal(int pos)
Returns the continuous value at position
pos of the
Sequence . |
void |
fillContainer(int[] container,
int pos)
The method fills the content of a specific position in to the container.
|
int[] |
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) . |
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 . |
static SimpleDiscreteSequence |
shuffle(SimpleDiscreteSequence original,
int k)
This method implements the algorithm of D.
|
annotate, compareTo, complement, complement, create, create, create, discreteVal, equals, flatCloneWithoutAnnotation, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getHammingDistance, getLength, getNumberOfSequenceAnnotationsByType, getSequenceAnnotationByType, getSequenceAnnotationByTypeAndIdentifier, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, matches, reverse, reverse, reverseComplement, reverseComplement, toDiscrete, toString, toString, toString, toString
public SimpleDiscreteSequence(AlphabetContainer container, SequenceAnnotation[] annotation) throws WrongAlphabetException
SimpleDiscreteSequence
with the
AlphabetContainer
container
and the annotation
annotation
but without the content. The content has to be
set by the constructor of the subclass.container
- the AlphabetContainer
of the sequenceannotation
- the annotation of the sequenceWrongAlphabetException
- if the AlphabetContainer
is not discreteSequence.Sequence(AlphabetContainer, SequenceAnnotation[])
public static SimpleDiscreteSequence shuffle(SimpleDiscreteSequence original, int k) throws Exception
original
- the original sequencek
- the value for the k-mers, k should be larger than (or equal to) 1Exception
- if the shuffled sequence could not be createdpublic final double continuousVal(int pos)
Sequence
pos
of the
Sequence
.continuousVal
in class Sequence<int[]>
pos
- the position of the Sequence
pos
of the
Sequence
public boolean isMultiDimensional()
Sequence
true
if the sequence is multidimensional, otherwise false
.isMultiDimensional
in class Sequence<int[]>
true
if the sequence is multidimensional, otherwise false
public int[] getEmptyContainer()
Sequence
getEmptyContainer
in class Sequence<int[]>
Sequence.fillContainer(Object, int)
,
Sequence.isMultiDimensional()
public void fillContainer(int[] container, int pos)
Sequence
fillContainer
in class Sequence<int[]>
container
- the container which is used for filling the content.pos
- the positionSequence.getEmptyContainer()
,
Sequence.isMultiDimensional()
protected Object getEmptyRepresentation()
Sequence
String
representation of this instance in the method Sequence.toString(String, int, int)
.getEmptyRepresentation
in class Sequence<int[]>
String
representationSequence.toString(String, int, int)
protected void addToRepresentation(Object representation, int pos, String delim)
Sequence
addToRepresentation
in class Sequence<int[]>
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<int[]>
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)
Sequence
Sequence.hashCode()
and the hash code for one specific position.hashCodeForPos
in class Sequence<int[]>
pos
- the positionpublic int compareTo(int[] t1, int[] t2)
Sequence
Sequence.compareTo(Sequence)
.compareTo
in class Sequence<int[]>
t1
- the first containert2
- the second containerSequence.getEmptyContainer()
,
Sequence.fillContainer(Object, int)
,
Comparable.compareTo(java.lang.Object)