de.jstacs.data.sequences
Class Sequence.CompositeSequence<T>

java.lang.Object
  extended by de.jstacs.data.sequences.Sequence<T>
      extended by de.jstacs.data.sequences.Sequence.RecursiveSequence<T>
          extended by de.jstacs.data.sequences.Sequence.CompositeSequence<T>
Type Parameters:
T - the type of each position
All Implemented Interfaces:
Comparable<Sequence<T>>
Enclosing class:
Sequence<T>

protected static class Sequence.CompositeSequence<T>
extends Sequence.RecursiveSequence<T>

The class handles composite Sequences. A Sequence.CompositeSequence consists of several (partial) Sequence s. A biological example are promoters like in eukaryotes (-10 and -35 box).

Author:
Jens Keilwagen

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
 
Fields inherited from class de.jstacs.data.sequences.Sequence.RecursiveSequence
content
 
Fields inherited from class de.jstacs.data.sequences.Sequence
alphabetCon, annotation, rc
 
Constructor Summary
Sequence.CompositeSequence(AlphabetContainer abc, Sequence<T> seq, int[] starts, int[] lengths)
          This constructor should be used if one wants to create a DataSet of Sequence.CompositeSequences.
Sequence.CompositeSequence(Sequence seq, int[] starts, int[] lengths)
          This is a very efficient way to create a Sequence.CompositeSequence for Sequences with a simple AlphabetContainer.
 
Method Summary
protected  Sequence flatCloneWithoutAnnotation()
          Works in analogy to Object.clone(), but does not clone the annotation.
protected  int getIndex(int pos)
          Returns the index in the internal sequence.
 int getLength()
          Returns the length of the Sequence.
 
Methods inherited from class de.jstacs.data.sequences.Sequence.RecursiveSequence
addToRepresentation, compareTo, continuousVal, discreteVal, fillContainer, getEmptyContainer, getEmptyRepresentation, getStringRepresentation, hashCodeForPos, isMultiDimensional
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sequence.CompositeSequence

public Sequence.CompositeSequence(Sequence seq,
                                  int[] starts,
                                  int[] lengths)
This is a very efficient way to create a Sequence.CompositeSequence for Sequences with a simple AlphabetContainer.

Parameters:
seq - the original Sequence
starts - the start positions of the junks
lengths - the length of each junk

Sequence.CompositeSequence

public Sequence.CompositeSequence(AlphabetContainer abc,
                                  Sequence<T> seq,
                                  int[] starts,
                                  int[] lengths)
This constructor should be used if one wants to create a DataSet of Sequence.CompositeSequences. With this constructor you are enabled to create a DataSet where every Sequence has the same AlphabetContainer instance.

Internally it is checked that the AlphabetContainer matches with the one of the subsequence.

Parameters:
abc - the new AlphabetContainer
seq - the original Sequence
starts - the start positions of the junks
lengths - the length of each junk
Method Detail

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 Sequence 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