Interface Profile<S extends Sequence<C>,​C extends Compound>

    • Method Detail

      • getCompoundAt

        C getCompoundAt​(int listIndex,
                        int alignmentIndex)
        Returns the Compound at row of given sequence and column of alignment index. If the given sequence has overlap, this will return the Compound from the top row of the sequence.
        Parameters:
        listIndex - index of sequence in profile
        alignmentIndex - column index within an alignment
        Returns:
        the sequence element
        Throws:
        IndexOutOfBoundsException - if listIndex < 1, listIndex > number of sequences, alignmentIndex < 1, or alignmentIndex > getLength()
      • getCompoundAt

        C getCompoundAt​(S sequence,
                        int alignmentIndex)
        Returns the Compound at row of given sequence and column of alignment index. If the given sequence has overlap, this will return the Compound from the top row of the sequence.
        Parameters:
        sequence - either an AlignedSequence or an original Sequence
        alignmentIndex - column index within an alignment
        Returns:
        the sequence element
        Throws:
        IndexOutOfBoundsException - if alignmentIndex < 1 or alignmentIndex > getLength()
      • getCompoundCountsAt

        int[] getCompoundCountsAt​(int alignmentIndex,
                                  List<C> compounds)
        Returns the number of each Compound in the given column only for compounds in the given list.
        Parameters:
        alignmentIndex - column index within an alignment
        compounds - list of compounds to count
        Returns:
        corresponding list of counts
        Throws:
        IndexOutOfBoundsException - if alignmentIndex < 1 or alignmentIndex > getLength()
      • getCompoundWeightsAt

        float[] getCompoundWeightsAt​(int alignmentIndex,
                                     List<C> compounds)
        Returns the fraction of each Compound in the given column only for compounds in the given list.
        Parameters:
        alignmentIndex - column index within an alignment
        compounds - list of compounds to count
        Returns:
        corresponding list of fractional weights
        Throws:
        IndexOutOfBoundsException - if alignmentIndex < 1 or alignmentIndex > getLength()
      • getIndicesAt

        int[] getIndicesAt​(int alignmentIndex)
        Returns the indices in the original Sequences corresponding to the given column. All indices are 1-indexed and inclusive.
        Parameters:
        alignmentIndex - column index within an alignment
        Returns:
        the sequence indices
        Throws:
        IndexOutOfBoundsException - if alignmentIndex < 1 or alignmentIndex > getLength()
      • getIndexOf

        int getIndexOf​(C compound)
        Searches for the given Compound within this alignment profile. Returns column index nearest to the start of the alignment profile, or -1 if not found.
        Parameters:
        compound - search element
        Returns:
        index of column containing search element nearest to the start of the alignment profile
      • getLastIndexOf

        int getLastIndexOf​(C compound)
        Searches for the given Compound within this alignment profile. Returns column index nearest to the end of the alignment profile, or -1 if not found.
        Parameters:
        compound - search element
        Returns:
        index of column containing search element nearest to the end of the alignment profile
      • getLength

        int getLength()
        Returns the number of columns in the alignment profile.
        Returns:
        the number of columns
      • getSize

        int getSize()
        Returns the number of rows in this profile. If any AlignedSequences are circular and overlap within the alignment, the returned size will be greater than the number of sequences, otherwise the numbers will be equal.
        Returns:
        number of rows
      • isCircular

        boolean isCircular()
        Returns true if any AlignedSequence is circular. If so, sequences may simply wrap around from the end to the start of the alignment or they may contribute multiple overlapping lines to the profile.
        Returns:
        true if any AlignedSequence is circular
      • toString

        String toString()
        Returns a simple view of the alignment profile. This shows each sequence on a separate line (or multiple lines, if circular) and nothing more. This should result in getSize() lines with getLength() Compounds per line.
        Overrides:
        toString in class Object
        Returns:
        a simple view of the alignment profile
      • toString

        String toString​(int width)
        Returns a formatted view of the alignment profile. This shows the start and end indices of the profile and each sequence for each group of lines of the given width. Each line may also be labeled.
        Parameters:
        width - limit on the line length
        Returns:
        a formatted view of the alignment profile
      • toString

        String toString​(Profile.StringFormat format)
        Returns a formatted view of the alignment profile. Details depend on the format given.
        Parameters:
        format - output format
        Returns:
        a formatted view of the alignment profile