org.biojava3.alignment.routines
Class AlignerHelper

java.lang.Object
  extended by org.biojava3.alignment.routines.AlignerHelper

public class AlignerHelper
extends Object

Static utility to construct alignment routines from a common library of methods.

Author:
Mark Chapman

Nested Class Summary
static class AlignerHelper.Cut
          Defines a 'cut' row for divide-and-conquer alignment in which a new anchor is found.
static class AlignerHelper.Last
          Defines a traceback pointer for the three edit operations: substitution (match/replacement of a query compound with a target compound), deletion (removal of a query compound leaving a gap in the target sequence), and insertion (addition of a target compound opening a gap in the query sequence).
 
Constructor Summary
AlignerHelper()
           
 
Method Summary
static short addAnchors(AlignerHelper.Cut[] cuts, short[] scores, boolean addScore, int[] anchors)
           
static AlignerHelper.Cut[] getCuts(int k, int[] subproblem, int[] dim, boolean anchor0)
           
static int[] getNextSubproblem(int[] anchors)
          Returns the coordinates for the next subproblem.
static void setCuts(int x, int[] subproblem, AlignerHelper.Last[][] pointers, AlignerHelper.Cut[] cuts)
           
static AlignerHelper.Last setScorePoint(int x, int y, short gep, short sub, short[][][] scores)
           
static AlignerHelper.Last[] setScorePoint(int x, int y, short gop, short gep, short sub, short[][][] scores)
           
static AlignerHelper.Last[][] setScoreVector(int x, int[] subproblem, short gep, short[] subs, boolean storing, short[][][] scores)
           
static AlignerHelper.Last[][] setScoreVector(int x, int[] subproblem, short gop, short gep, short[] subs, boolean storing, short[][][] scores)
           
static AlignerHelper.Last[][] setScoreVector(int x, int xb, int yb, int ye, short gep, short[] subs, boolean storing, short[][][] scores)
           
static AlignerHelper.Last[][] setScoreVector(int x, int xb, int yb, int ye, short gep, short[] subs, boolean storing, short[][][] scores, int[] xyMax, int score)
           
static AlignerHelper.Last[][] setScoreVector(int x, int xb, int yb, int ye, short gop, short gep, short[] subs, boolean storing, short[][][] scores)
           
static AlignerHelper.Last[][] setScoreVector(int x, int xb, int yb, int ye, short gop, short gep, short[] subs, boolean storing, short[][][] scores, int[] xyMax, int score)
           
static AlignerHelper.Last[][] setScoreVector(int x, short gep, short[] subs, boolean storing, short[][][] scores)
           
static AlignerHelper.Last[][] setScoreVector(int x, short gep, short[] subs, boolean storing, short[][][] scores, int[] xyMax, int score)
           
static AlignerHelper.Last[][] setScoreVector(int x, short gop, short gep, short[] subs, boolean storing, short[][][] scores)
           
static AlignerHelper.Last[][] setScoreVector(int x, short gop, short gep, short[] subs, boolean storing, short[][][] scores, int[] xyMax, int score)
           
static int[] setSteps(AlignerHelper.Last[][][] traceback, boolean local, int[] xyMax, AlignerHelper.Last last, List<AlignedSequence.Step> sx, List<AlignedSequence.Step> sy)
           
static int[] setSteps(AlignerHelper.Last[][][] traceback, int[] xyMax, List<AlignedSequence.Step> sx, List<AlignedSequence.Step> sy)
           
static int[] setSteps(AlignerHelper.Last[][][] traceback, short[][][] scores, List<AlignedSequence.Step> sx, List<AlignedSequence.Step> sy)
           
static int[] setSteps(int[] anchors, List<AlignedSequence.Step> sx, List<AlignedSequence.Step> sy)
          Sets the alignment path following the list of anchors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlignerHelper

public AlignerHelper()
Method Detail

addAnchors

public static short addAnchors(AlignerHelper.Cut[] cuts,
                               short[] scores,
                               boolean addScore,
                               int[] anchors)

getCuts

public static AlignerHelper.Cut[] getCuts(int k,
                                          int[] subproblem,
                                          int[] dim,
                                          boolean anchor0)

getNextSubproblem

public static int[] getNextSubproblem(int[] anchors)
Returns the coordinates for the next subproblem. The first element is the starting index in the query sequence. The second element is the starting index in the target sequence. Similarly, the third and fourth elements are the ending indices of the query and target sequences, respectively. When the alignment is finished, there is no next subproblem and this method returns null.

Parameters:
anchors - current list of anchors
Returns:
the coordinates for the next subproblem

setCuts

public static void setCuts(int x,
                           int[] subproblem,
                           AlignerHelper.Last[][] pointers,
                           AlignerHelper.Cut[] cuts)

setScorePoint

public static AlignerHelper.Last[] setScorePoint(int x,
                                                 int y,
                                                 short gop,
                                                 short gep,
                                                 short sub,
                                                 short[][][] scores)

setScorePoint

public static AlignerHelper.Last setScorePoint(int x,
                                               int y,
                                               short gep,
                                               short sub,
                                               short[][][] scores)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    short gop,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    int[] subproblem,
                                                    short gop,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    int xb,
                                                    int yb,
                                                    int ye,
                                                    short gop,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    int[] subproblem,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    int xb,
                                                    int yb,
                                                    int ye,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    short gop,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores,
                                                    int[] xyMax,
                                                    int score)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    int xb,
                                                    int yb,
                                                    int ye,
                                                    short gop,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores,
                                                    int[] xyMax,
                                                    int score)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores,
                                                    int[] xyMax,
                                                    int score)

setScoreVector

public static AlignerHelper.Last[][] setScoreVector(int x,
                                                    int xb,
                                                    int yb,
                                                    int ye,
                                                    short gep,
                                                    short[] subs,
                                                    boolean storing,
                                                    short[][][] scores,
                                                    int[] xyMax,
                                                    int score)

setSteps

public static int[] setSteps(int[] anchors,
                             List<AlignedSequence.Step> sx,
                             List<AlignedSequence.Step> sy)
Sets the alignment path following the list of anchors.

Parameters:
anchors - a complete list of anchors (input)
sx - steps for the query sequence (output)
sy - steps for the target sequence (output)

setSteps

public static int[] setSteps(AlignerHelper.Last[][][] traceback,
                             boolean local,
                             int[] xyMax,
                             AlignerHelper.Last last,
                             List<AlignedSequence.Step> sx,
                             List<AlignedSequence.Step> sy)

setSteps

public static int[] setSteps(AlignerHelper.Last[][][] traceback,
                             short[][][] scores,
                             List<AlignedSequence.Step> sx,
                             List<AlignedSequence.Step> sy)

setSteps

public static int[] setSteps(AlignerHelper.Last[][][] traceback,
                             int[] xyMax,
                             List<AlignedSequence.Step> sx,
                             List<AlignedSequence.Step> sy)