|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.data.Sequence
de.jstacs.data.sequences.DiscreteSequence
de.jstacs.data.sequences.SparseSequence
public final class SparseSequence
This class is an implementation for sequences on one alphabet with length 4.
This implementation can be used for instance for DNA sequences.
The symbols are encoded in the bits of the primitive type long,
which allows to save 32 symbols in one long. On the one hand an
instance of this class is more memory efficient than any other
DiscreteSequence, e.g. ByteSequence. But on the other hand
this class will be a little bit slower when accessing single positions.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.jstacs.data.Sequence |
|---|
Sequence.CompositeSequence, Sequence.SubSequence |
| Field Summary |
|---|
| Fields inherited from class de.jstacs.data.Sequence |
|---|
alphabetCon, annotation, rc |
| Constructor Summary | |
|---|---|
SparseSequence(AlphabetContainer alphCon,
String seq)
This constructor creates an instance from a String. |
|
SparseSequence(AlphabetContainer alphCon,
SymbolExtractor se)
This constructor creates an instance from a SymbolExtractor. |
|
| Method Summary | |
|---|---|
SparseSequence |
complement(int start,
int end)
This method returns a new instance of sequence containing a part of the complementary current sequence. |
int |
discreteVal(int pos)
Returns the discrete value of position pos. |
protected Sequence |
flatCloneWithoutAnnotation()
Works in analogy to Object.clone(), but does not clone the annotation. |
int |
getLength()
Returns the length of the sequence |
SparseSequence |
reverse(int start,
int end)
This method returns a new instance of sequence containing a part of the reverse current sequence. |
SparseSequence |
reverseComplement(int start,
int end)
This method returns a new sequence instance containing a part of the complementary current sequence. |
| Methods inherited from class de.jstacs.data.sequences.DiscreteSequence |
|---|
continuousVal |
| Methods inherited from class de.jstacs.data.Sequence |
|---|
annotate, compareTo, complement, create, create, create, equals, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, reverse, reverseComplement, toDiscrete, toString, toString, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SparseSequence(AlphabetContainer alphCon,
String seq)
throws WrongSequenceTypeException,
WrongAlphabetException
String.
alphCon - the AlphabetContainerseq - the sequence as String
WrongSequenceTypeException - if the AlphabetContainer is not simple or the
internal Alphabet has more than 4
symbols
WrongAlphabetException - if the AlphabetContainer is not discrete
public SparseSequence(AlphabetContainer alphCon,
SymbolExtractor se)
throws WrongSequenceTypeException,
WrongAlphabetException
SymbolExtractor.
alphCon - the AlphabetContainerse - the SymbolExtractor
WrongSequenceTypeException - if the AlphabetContainer is not simple or the
internal Alphabet has more than 4
symbols
WrongAlphabetException - if the AlphabetContainer is not discrete| Method Detail |
|---|
public int discreteVal(int pos)
Sequencepos.
discreteVal in class Sequencepos - the position
pospublic int getLength()
Sequence
getLength in class Sequence
public SparseSequence complement(int start,
int end)
throws OperationNotSupportedException
SequenceAlphabetContainer on
DNAAlphabet returns "ATTAT".
complement in class Sequencestart - the start position (inclusive) in the original sequenceend - the end position (exclusive) in the original sequence
OperationNotSupportedException - if the current sequence is not based on a ComplementableDiscreteAlphabetComplementableDiscreteAlphabet
public SparseSequence reverse(int start,
int end)
throws OperationNotSupportedException
Sequence
reverse in class Sequencestart - the start position (inclusive) in the original sequenceend - the end position (exclusive) in the original sequence
OperationNotSupportedException - if the current sequence is based on an AlphabetContainer that is not simple.
public SparseSequence reverseComplement(int start,
int end)
throws OperationNotSupportedException
Sequencereverse() and complement().
reverseComplement in class Sequencestart - the start position (inclusive) in the original sequenceend - the end position (exclusive) in the original sequence
OperationNotSupportedException - if the current sequence is not discrete and simpleSequence.reverse(),
Sequence.complement(),
ComplementableDiscreteAlphabetprotected Sequence flatCloneWithoutAnnotation()
SequenceObject.clone(), but does not clone the annotation. This method is used in Sequence.annotate(boolean, SequenceAnnotation...).
flatCloneWithoutAnnotation in class SequenceSequence.CompositeSequence without annotation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||