Interface Sequence<C extends Compound>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int countCompounds​(C... compounds)
      Returns the number of times we found a compound in the Sequence
      java.util.List<C> getAsList()
      Returns the Sequence as a List of compounds
      C getCompoundAt​(int position)
      Returns the Compound at the given biological index
      CompoundSet<C> getCompoundSet()
      Gets the compound set used to back this Sequence
      int getIndexOf​(C compound)
      Scans through the Sequence looking for the first occurrence of the given compound
      SequenceView<C> getInverse()
      Does the right thing to get the inverse of the current Sequence.
      int getLastIndexOf​(C compound)
      Scans through the Sequence looking for the last occurrence of the given compound
      int getLength()
      Returns the length of the Sequence
      java.lang.String getSequenceAsString()
      Returns the String representation of the Sequence
      SequenceView<C> getSubSequence​(java.lang.Integer start, java.lang.Integer end)
      Returns a portion of the sequence from the different positions.
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • getLength

        int getLength()
        Returns the length of the Sequence
      • getCompoundAt

        C getCompoundAt​(int position)
        Returns the Compound at the given biological index
        Parameters:
        position - Biological index (1 to n)
        Returns:
        Compound at the specified position
      • getIndexOf

        int getIndexOf​(C compound)
        Scans through the Sequence looking for the first occurrence of the given compound
        Parameters:
        compound - Compounds to look for
        Returns:
        Index of the first position of the compound in the sequence (1 to n)
      • getLastIndexOf

        int getLastIndexOf​(C compound)
        Scans through the Sequence looking for the last occurrence of the given compound
        Parameters:
        compound - Compounds to look for
        Returns:
        Index of the last position of the compound in the sequence (1 to n)
      • getSequenceAsString

        java.lang.String getSequenceAsString()
        Returns the String representation of the Sequence
      • getAsList

        java.util.List<C> getAsList()
        Returns the Sequence as a List of compounds
      • getSubSequence

        SequenceView<C> getSubSequence​(java.lang.Integer start,
                                       java.lang.Integer end)
        Returns a portion of the sequence from the different positions. This is indexed from 1
        Parameters:
        start - Biological index start; must be greater than 0
        end - Biological end; must be less than length + 1
        Returns:
        A SequenceView of the offset
      • getCompoundSet

        CompoundSet<C> getCompoundSet()
        Gets the compound set used to back this Sequence
      • countCompounds

        int countCompounds​(C... compounds)
        Returns the number of times we found a compound in the Sequence
        Parameters:
        compounds - Vargs of the compounds to count
        Returns:
        Number of times a compound was found
      • getInverse

        SequenceView<C> getInverse()
        Does the right thing to get the inverse of the current Sequence. This means either reversing the Sequence and optionally complementing the Sequence.