ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gclib/GAlnExtend.h
(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 466 | Line 466
466    bool operator<(GXAlnInfo& d) {
467      return ((score==d.score)? pid>d.pid : score>d.score);
468      }
469  bool operator>(GXAlnInfo& d) {
470    return ((score==d.score)? pid<d.pid : score<d.score);
471    }
469    bool operator==(GXAlnInfo& d) {
470      return (score==d.score && pid==d.pid);
471      }
# Line 484 | Line 481
481     bool operator<(GXSeed& d){
482        return ((b_ofs==d.b_ofs) ? a_ofs<d.a_ofs : b_ofs<d.b_ofs);
483        }
487   bool operator>(GXSeed& d){
488      return ((b_ofs==d.b_ofs) ? a_ofs>d.a_ofs : b_ofs>d.b_ofs);
489      }
484     bool operator==(GXSeed& d){
485        return (b_ofs==d.b_ofs && a_ofs==d.a_ofs); //should never be the case, seeds are uniquely constructed
486        }
# Line 554 | Line 548
548          int a_gap=scur.a_ofs-sprev.a_ofs-sprev.len;
549          int max_gap=b_gap;
550          int min_gap=a_gap;
551 <        if (min_gap>max_gap) swap(max_gap, min_gap);
551 >        if (min_gap>max_gap) Gswap(max_gap, min_gap);
552          int _penalty=0;
553          if (min_gap<0) { //overlap
554                 if (max_gap>0) { _penalty=GMAX((-min_gap), max_gap); }
# Line 574 | Line 568
568       //return ((score==d.score) ? seeds.Count()>d.seeds.Count() : score>d.score);
569       return ((score==d.score) ? w_min_b<d.w_min_b : score>d.score);
570       }
577  bool operator>(GXBand& d){
578     //return ((score==d.score) ? seeds.Count()<d.seeds.Count() : score<d.score);
579    return ((score==d.score) ? w_min_b>d.w_min_b : score<d.score);
580     }
571    bool operator==(GXBand& d){
572      //return (score==d.score && seeds.Count()==d.seeds.Count());
573       return (score==d.score && w_min_b==d.w_min_b);
# Line 685 | Line 675
675    bool validate(int sl, int sr, int alnpid, int adist) {
676     int alnlen=sr-sl+1;
677     sl--;sr--; //boundary is 0-based
678 <   int badj=0;
679 <   int admax=3;
680 <   if (alnlen<11) {
678 >   int badj=0; //default boundary is 3 bases distance to end
679 >   int admax=1;
680 >   if (alnlen<13) {
681        //stricter boundary check
682 +      if (alnpid<90) return false;
683        badj=2;
684 <      admax=1;
694 <      if (alnlen<=6) badj++;
684 >      if (alnlen<=7) { badj++; admax=0; }
685        }
686     if (adist>admax) return false;
687     if (type==galn_TrimRight) {
688        return (sr>=boundary+badj);
689        }
690     else {
691 <      //left side should be more stringent
692 <      if (alnpid<91) {
693 <        if (alnlen<11) return false;
691 >      //left match should be more stringent (5')
692 >      if (alnpid<93) {
693 >        if (alnlen<13) return false;
694 >        admax=0;
695          badj++;
696          }
697        return (sl<=boundary-badj);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines