(Generate patch)
# Line 7 | Line 7
7   #include "GList.hh"
8   #include <string.h>
9
10 < #define GDEBUG 1
10 > //#define GDEBUG 1
11
12   enum {
13      gxEDIT_OP_MASK = 0x3,
# Line 215 | Line 215
215
216   };
217
218 < #define GREEDY_MAX_COST_FRACTION 5
218 > #define GREEDY_MAX_COST_FRACTION 8
219   /* (was 2) sequence_length / (this number) is a measure of how hard the
220    alignment code will work to find the optimal alignment; in fact
221    this gives a worst case bound on the number of loop iterations */
# Line 588 | Line 588
588   class GXBandSet:public GList<GXBand> {
589    public:
590     GXSeed* qmatch; //long match (mismatches allowed) if a very good match was extended well
591 +   GXSeed* tmatch; //terminal match to be used if there is no better alignment
592     int idxoffset; //global anti-diagonal->index offset (a_len-1)
593     //used to convert a diagonal to an index
594     //diagonal is always b_ofs-a_ofs, so the minimum value is -a_len+1
# Line 601 | Line 602
602     GXBandSet(int a_len, int b_len):GList<GXBand>(a_len+b_len-1, false, true, false) {
603        idxoffset=a_len-1;
604        qmatch=NULL;
605 +      tmatch=NULL; //terminal match to be used if everything else fails
606            //diag will range from -a_len+1 to b_len-1, so after adjustment
607            //by idxoffset we get a max of a_len+b_len-2
608        int bcount=a_len+b_len-1;
# Line 683 | Line 685
685    bool validate(int sl, int sr, int alnpid, int adist) {
686     int alnlen=sr-sl+1;
687     sl--;sr--; //boundary is 0-based
688 <   int badj=0;
689 <   int admax=3;
690 <   if (alnlen<11) {
688 >   int badj=0; //default boundary is 3 bases distance to end
689 >   int admax=1;
690 >   if (alnlen<13) {
691        //stricter boundary check
692 +      if (alnpid<90) return false;
694 >      if (alnlen<=7) { badj++; admax=0; }
695        }
697     if (type==galn_TrimRight) {
699        }
700     else {
701 <      //left side should be more stringent
702 <      if (alnpid<91) {
703 <        if (alnlen<11) return false;
701 >      //left match should be more stringent (5')
702 >      if (alnpid<93) {
703 >        if (alnlen<13) return false;