de.jstacs.data
Class Sequence.CompositeSequence

java.lang.Object
  extended by de.jstacs.data.Sequence
      extended by de.jstacs.data.sequences.RecursiveSequence
          extended by de.jstacs.data.Sequence.CompositeSequence
All Implemented Interfaces:
Comparable<Sequence>
Enclosing class:
Sequence

protected static class Sequence.CompositeSequence
extends RecursiveSequence

The class handles composite sequences. A composite sequence consists of several (partial) sequences. A biological example are promoters like in eucaryots (-10 and -35-box).

Author:
Jens Keilwagen

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.sequences.RecursiveSequence
content
 
Fields inherited from class de.jstacs.data.Sequence
alphabetCon, annotation, rc
 
Constructor Summary
Sequence.CompositeSequence(AlphabetContainer abc, Sequence seq, int[] starts, int[] lengths)
          This constructor should be used if one wants to create a sample of composite sequences.
Sequence.CompositeSequence(Sequence seq, int[] starts, int[] lengths)
          This is an very effient way to create a composite sequence 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)
          Return the index in the internal sequence
 int getLength()
          Returns the length of the sequence
 
Methods inherited from class de.jstacs.data.sequences.RecursiveSequence
continuousVal, discreteVal
 
Methods inherited from class de.jstacs.data.Sequence
annotate, compareTo, complement, complement, create, create, create, equals, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, 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 an very effient way to create a composite sequence for sequences with a simple AlphabetContainer.

Parameters:
seq - the original sequence
starts - the index of the start position
lengths - the length of the new sequence

Sequence.CompositeSequence

public Sequence.CompositeSequence(AlphabetContainer abc,
                                  Sequence seq,
                                  int[] starts,
                                  int[] lengths)
This constructor should be used if one wants to create a sample of composite sequences. With this constructor you are enabled to create a Sample where every sequence has the same AlphabetContainer-instance.

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

Parameters:
abc - the new AlphabetContainer
seq - the original sequence
starts - the array of indices of the start position
lengths - the array of (sub)length of the new sequence
Method Detail

getIndex

protected int getIndex(int pos)
Description copied from class: RecursiveSequence
Return the index in the internal sequence

Specified by:
getIndex in class RecursiveSequence
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
Returns:
the length

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
Returns:
the cloned Sequence.CompositeSequence without annotation