de.jstacs.data.sequences
Class PermutedSequence<T>
java.lang.Object
de.jstacs.data.sequences.Sequence<T>
de.jstacs.data.sequences.Sequence.RecursiveSequence<T>
de.jstacs.data.sequences.PermutedSequence<T>
- Type Parameters:
T
- the type of each position
- All Implemented Interfaces:
- Comparable<Sequence<T>>
public class PermutedSequence<T>
- extends Sequence.RecursiveSequence<T>
This class is for permuted sequences.
- Author:
- Jan Grau
Methods inherited from class de.jstacs.data.sequences.Sequence |
annotate, compareTo, complement, complement, create, create, create, equals, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getHammingDistance, getNumberOfSequenceAnnotationsByType, getSequenceAnnotationByType, getSequenceAnnotationByTypeAndIdentifier, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, matches, reverse, reverse, reverseComplement, reverseComplement, toDiscrete, toString, toString, toString, toString |
PermutedSequence
public PermutedSequence(Sequence<T> seq)
throws WrongAlphabetException
- Creates a new
PermutedSequence
by shuffling the symbols of a
given Sequence
.
- Parameters:
seq
- the initial sequence
- Throws:
WrongAlphabetException
- if the AlphabetContainer
is not simple- See Also:
Sequence.RecursiveSequence.Sequence.RecursiveSequence(de.jstacs.data.AlphabetContainer, de.jstacs.data.sequences.Sequence)
PermutedSequence
public PermutedSequence(Sequence<T> seq,
int[] permutation)
throws WrongAlphabetException,
Exception
- Creates a new
PermutedSequence
for a given permutation
- Parameters:
seq
- the original sequencepermutation
- the permutation of the sequence
- Throws:
WrongAlphabetException
- if the AlphabetContainer
is not simple
Exception
- if the length of the permutation does not match that of the sequence- See Also:
Sequence.RecursiveSequence.Sequence.RecursiveSequence(de.jstacs.data.AlphabetContainer, de.jstacs.data.sequences.Sequence)
getIndex
protected int getIndex(int pos)
- Description copied from class:
Sequence.RecursiveSequence
- Returns the index in the internal sequence.
- Specified by:
getIndex
in class Sequence.RecursiveSequence<T>
- Parameters:
pos
- the index in the external sequence
- Returns:
- the index in the internal sequence
getLength
public int getLength()
- Description copied from class:
Sequence
- Returns the length of the
Sequence
.
- Specified by:
getLength
in class Sequence<T>
- Returns:
- the length of the
Sequence
flatCloneWithoutAnnotation
protected PermutedSequence<T> flatCloneWithoutAnnotation()
- Description copied from class:
Sequence
- Works in analogy to
Object.clone()
, but does not clone the
annotation. This method is used in
Sequence.annotate(boolean, SequenceAnnotation...)
.
- Specified by:
flatCloneWithoutAnnotation
in class Sequence<T>
- Returns:
- the cloned
Sequence
without annotation