Class AbstractMatrixAligner<S extends Sequence<C>,​C extends Compound>

    • Field Detail

      • xyStart

        protected int[] xyStart
        Start position of the aligned sequence in the query and target respectively
      • xyMax

        protected int[] xyMax
        End position of the aligned sequence in the query and target respectively
      • max

        protected int max
      • min

        protected int min
      • score

        protected int score
      • scores

        protected int[][][] scores
        Dynamic programming score matrix The first dimension has the length of the first (query) sequence + 1 The second has the length of the second (target) sequence + 1 The third has length 1 for linear gap penalty and 3 for affine/constant gap (one each for match/substitution, deletion, insertion)
      • time

        protected long time
    • Method Detail

      • getGapPenalty

        public GapPenalty getGapPenalty()
        Returns the gap penalties.
        Returns:
        the gap penalties used during alignment
      • isLocal

        public boolean isLocal()
        Returns whether alignment finds a region of similarity rather than aligning every compound.
        Returns:
        true if alignment finds a region of similarity rather than aligning every compound
      • isStoringScoreMatrix

        public boolean isStoringScoreMatrix()
        Returns choice to cache the score matrix or to save memory by deleting score matrix after alignment.
        Returns:
        choice to cache the score matrix
      • setGapPenalty

        public void setGapPenalty​(GapPenalty gapPenalty)
        Sets the gap penalties.
        Parameters:
        gapPenalty - the gap penalties used during alignment
      • setSubstitutionMatrix

        public void setSubstitutionMatrix​(SubstitutionMatrix<C> subMatrix)
        Sets the substitution matrix.
        Parameters:
        subMatrix - the set of substitution scores used during alignment
      • setStoringScoreMatrix

        public void setStoringScoreMatrix​(boolean storingScoreMatrix)
        Sets choice to cache the score matrix or to save memory by deleting score matrix after alignment.
        Parameters:
        storingScoreMatrix - choice to cache the score matrix
      • getScoreMatrix

        public int[][][] getScoreMatrix()
        Description copied from interface: MatrixAligner
        Returns the entire score matrix built during alignment. The first dimension has the length of the first (query) sequence + 1; the second has the length of the second (target) sequence + 1; the third has length equal to the number of scores stored per pairing of an element from each Sequence.
        Specified by:
        getScoreMatrix in interface MatrixAligner<S extends Sequence<C>,​C extends Compound>
        Returns:
        the score matrix
      • getMaxScore

        public double getMaxScore()
        Description copied from interface: Scorer
        Returns maximum possible score.
        Specified by:
        getMaxScore in interface Scorer
        Returns:
        maximum possible score
      • getMinScore

        public double getMinScore()
        Description copied from interface: Scorer
        Returns minimum possible score.
        Specified by:
        getMinScore in interface Scorer
        Returns:
        minimum possible score
      • align

        protected void align()
        Performs alignment
      • getSubstitutionScoreVector

        protected int[] getSubstitutionScoreVector​(int queryColumn)
        Returns score for the alignment of the query column to all target columns
        Parameters:
        queryColumn -
        Returns:
      • getSubstitutionScoreVector

        protected int[] getSubstitutionScoreVector​(int queryColumn,
                                                   AlignerHelper.Subproblem subproblem)
        Returns score for the alignment of the query column to all target columns
        Parameters:
        queryColumn -
        subproblem -
        Returns:
      • reset

        protected void reset()
        Resets output fields; should be overridden to set max and min
      • getSubstitutionScore

        protected abstract int getSubstitutionScore​(int queryColumn,
                                                    int targetColumn)
      • isReady

        protected abstract boolean isReady()