Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.data.sequences
Class ArbitrarySequence

    java.lang.Object
      de.jstacs.data.Sequence<double[]>
          de.jstacs.data.sequences.ArbitrarySequence

All Implemented Interfaces:
  Comparable<Sequence<double[]>>

    public class ArbitrarySequence

extends Sequence<double[]>

This class is for any continuous or hybrid sequence.

Author:
  Jens Keilwagen

Nested Class Summary

Nested classes/interfaces inherited from class de.jstacs.data.Sequence
`Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T>`

Field Summary

Fields inherited from class de.jstacs.data.Sequence
`alphabetCon, annotation, rc`

Constructor Summary
`ArbitrarySequence(AlphabetContainer alphabetContainer, double[] content)` Creates a new `ArbitrarySequence` from an array of `double`-encoded alphabet symbols.
`ArbitrarySequence(AlphabetContainer alphabetContainer, SequenceAnnotation[] annotation, String sequence, String delim)` Creates a new `ArbitrarySequence` from a `String` representation using the delimiter `delim`.
`ArbitrarySequence(AlphabetContainer alphabetContainer, SequenceAnnotation[] annotation, SymbolExtractor extractor)` Creates a new `ArbitrarySequence` from a `SymbolExtractor`.
`ArbitrarySequence(AlphabetContainer alphabetContainer, String sequence)` Creates a new `ArbitrarySequence` from a `String` representation using the default delimiter.

Method Summary
`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(double[] t1, double[] 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`.
`int` | `discreteVal(int pos)` Returns the discrete value at position `pos` of the `Sequence`.
`void` | `fillContainer(double[] container, int pos)` The method fills the content of a specific position in to the container.
`protected ArbitrarySequence` | `flatCloneWithoutAnnotation()` Works in analogy to `Object.clone()`, but does not clone the annotation.
`double[]` | `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)`.
`int` | `getLength()` Returns the length of the `Sequence`.
`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 .

Methods inherited from class de.jstacs.data.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

### ArbitrarySequence

    public ArbitrarySequence(AlphabetContainer alphabetContainer,
                             double[] content)
                      throws WrongAlphabetException,
                             WrongSequenceTypeException

  Creates a new `ArbitrarySequence` from an array of `double`-encoded alphabet symbols. This constructor is designed for the method `AbstractModel.emitSample(int, int...)`.

  Parameters:
    `alphabetContainer` - the `AlphabetContainer` for the sequence
    `content` - an array containing the encoded symbols
  Throws:
    `WrongAlphabetException` - if the sequence is not defined over `alphabetContainer`
    `WrongSequenceTypeException` - if `alphabetContainer` contains alphabets that can not be encoded with `double`s
  See Also:
    `AbstractModel.emitSample(int, int...)`, `Sequence.Sequence(AlphabetContainer, SequenceAnnotation[])`

### ArbitrarySequence

    public ArbitrarySequence(AlphabetContainer alphabetContainer,
                             String sequence)
                      throws WrongAlphabetException,
                             WrongSequenceTypeException

  Creates a new `ArbitrarySequence` from a `String` representation using the default delimiter.

  Parameters:
    `alphabetContainer` - the `AlphabetContainer` for the sequence
    `sequence` - a `String` representation of the sequence
  Throws:
    `WrongAlphabetException` - if the sequence is not defined over `alphabetContainer`
    `WrongSequenceTypeException` - if `alphabetContainer` contains alphabets that can not be encoded with `double`s
  See Also:
    `ArbitrarySequence(AlphabetContainer, SequenceAnnotation[], SymbolExtractor)`

### ArbitrarySequence

    public ArbitrarySequence(AlphabetContainer alphabetContainer,
                             SequenceAnnotation[] annotation,
                             String sequence,
                             String delim)
                      throws WrongAlphabetException,
                             WrongSequenceTypeException,
                             IllegalArgumentException

  Creates a new `ArbitrarySequence` from a `String` representation using the delimiter `delim`. Annotations for this sequence are considered by `annotation`.

  Parameters:
    `alphabetContainer` - the `AlphabetContainer` for the sequence
    `annotation` - the annotation for this sequence
    `sequence` - a `String` representation of the sequence
    `delim` - the delimiter, a `String` that separates the symbols
  Throws:
    `WrongAlphabetException` - if the sequence is not defined over `alphabetContainer`
    `WrongSequenceTypeException` - if `alphabetContainer` contains alphabets that can not be encoded with `double`s
    `IllegalArgumentException` - if the delimiter is empty and the alphabet container is not discrete
  See Also:
    `ArbitrarySequence(AlphabetContainer, SequenceAnnotation[], SymbolExtractor)`

### ArbitrarySequence

    public ArbitrarySequence(AlphabetContainer alphabetContainer,
                             SequenceAnnotation[] annotation,
                             SymbolExtractor extractor)
                      throws WrongAlphabetException,
                             WrongSequenceTypeException

  Creates a new `ArbitrarySequence` from a `SymbolExtractor`. Annotations for this sequence are considered by `annotation`.

  Parameters:
    `alphabetContainer` - the alphabet container for the sequence
    `annotation` - the annotation for this sequence
    `extractor` - the `SymbolExtractor`
  Throws:
    `WrongAlphabetException` - if the sequence is not defined over `alphabetContainer`
    `WrongSequenceTypeException` - if `alphabetContainer` contains alphabets that can not be encoded with `double`s
  See Also:
    `Sequence.Sequence(AlphabetContainer, SequenceAnnotation[])`

Method Detail

### continuousVal

    public double continuousVal(int pos)

  Description copied from class: `Sequence`
  Returns the continuous value at position `pos` of the `Sequence`.

  Specified by:
    `continuousVal` in class `Sequence<double[]>`
  Parameters:
    `pos` - the position of the `Sequence`
  Returns:
    the continuous value at position `pos` of the `Sequence`

### discreteVal

    public int discreteVal(int pos)

  Description copied from class: `Sequence`
  Returns the discrete value at position `pos` of the `Sequence`.

  Specified by:
    `discreteVal` in class `Sequence<double[]>`
  Parameters:
    `pos` - the position of the `Sequence`
  Returns:
    the discrete value at position `pos` of the `Sequence`

### getLength

    public int getLength()

  Description copied from class: `Sequence`
  Returns the length of the `Sequence`.

  Specified by:
    `getLength` in class `Sequence<double[]>`
  Returns:
    the length of the `Sequence`

### flatCloneWithoutAnnotation

    protected ArbitrarySequence 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<double[]>`
  Returns:
    the cloned `Sequence` without annotation

### isMultiDimensional

    public boolean isMultiDimensional()

  Description copied from class: `Sequence`
  The method returns `true` if the sequence is multidimensional, otherwise .

  Specified by:
    `isMultiDimensional` in class `Sequence<double[]>`
  Returns:
    `true` if the sequence is multidimensional, otherwise

### getEmptyContainer

    public double[] getEmptyContainer()

  Description copied from class: `Sequence`
  The method returns a container that can be used for accessing the symbols for each position. This is especially of interest for multidimensional sequences.

  Specified by:
    `getEmptyContainer` in class `Sequence<double[]>`
  Returns:
    a container that can be used for accessing the symbols for each position
  See Also:
    `Sequence.fillContainer(Object, int)`, `Sequence.isMultiDimensional()`

### fillContainer

    public void fillContainer(double[] container,
                              int pos)

  Description copied from class: `Sequence`
  The method fills the content of a specific position in to the container. This is especially of interest for multidimensional sequences.

  Specified by:
    `fillContainer` in class `Sequence<double[]>`
  Parameters:
    `container` - the container which is used for filling the content.
    `pos` - the position
  See Also:
    `Sequence.getEmptyContainer()`, `Sequence.isMultiDimensional()`

### compareTo

    public int compareTo(double[] t1,
                         double[] t2)

  Description copied from class: `Sequence`
  This method compares to container and is used in `Sequence.compareTo(Sequence)`.

  Specified by:
    `compareTo` in class `Sequence<double[]>`
  Parameters:
    `t1` - the first container
    `t2` - the second container
  Returns:
    zero if arguments are equal
  See Also:
    `Sequence.getEmptyContainer()`, `Sequence.fillContainer(Object, int)`, `Comparable.compareTo(java.lang.Object)`

### getEmptyRepresentation

    protected Object getEmptyRepresentation()

  Description copied from class: `Sequence`
  Returns an empty representation which is used to create the `String` representation of this instance in the method `Sequence.toString(String, int, int)`.

  Specified by:
    `getEmptyRepresentation` in class `Sequence<double[]>`
  Returns:
    an empty representation which is used to create the `String` representation
  See Also:
    `Sequence.toString(String, int, int)`

### addToRepresentation

    protected void addToRepresentation(Object representation,
                                       int pos,
                                       String delim)

  Description copied from class: `Sequence`
  This method adds the information of one position to the representation using the specified delimiter

  Specified by:
    `addToRepresentation` in class `Sequence<double[]>`
  Parameters:
    `representation` - the representation
    `pos` - the position
    `delim` - the delimiter separating the information for different positions
  See Also:
    `Sequence.getEmptyRepresentation()`, `Sequence.toString(String, int, int)`

### getStringRepresentation

    protected String getStringRepresentation(Object representation)

  Description copied from class: `Sequence`
  This method creates a String representation from the given representation.

  Specified by:
    `getStringRepresentation` in class `Sequence<double[]>`
  Parameters:
    `representation` - the representation instance (which should be created by `Sequence.getEmptyContainer()` and filled by `Sequence.addToRepresentation(Object, int, String)`)
  Returns:
    a String representation
  See Also:
    `Sequence.getEmptyRepresentation()`, `Sequence.addToRepresentation(Object, int, String)`, `Sequence.toString(String, int, int)`

### hashCodeForPos

    protected int hashCodeForPos(int pos)

  Description copied from class: `Sequence`
  This method is used in `Sequence.hashCode()` and the hash code for one specific position.

  Specified by:
    `hashCodeForPos` in class `Sequence<double[]>`
  Parameters:
    `pos` - the position
  Returns:
    the hash code for the position

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD