ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gclib/GAlnExtend.h
(Generate patch)
# Line 5 | Line 5
5  
6   #include "GBase.h"
7   #include "GList.hh"
8 < #include <string.h>
8 > #include "gdna.h"
9  
10   //#define GDEBUG 1
11  
# Line 98 | Line 98
98  
99          if (GX_EDITOP_GET(oplast) == op) {
100              uint32 l=ops[opnum-1];
101 <            ops[opnum-1]=GX_EDITOP_CONS((GX_EDITOP_GET(l)),
101 >            ops[opnum-1]=GX_EDITOP_CONS((GX_EDITOP_GET(l)),
102                 (GX_EDITOP_VAL(l) + k));
103              }
104          else {
# Line 346 | Line 346
346         a_len=0;
347             b_len=0;
348             if (ed_script==NULL) return;
349 <           for (uint32 i=0; i<ed_script->opnum; i++) {
349 >           for (uint32 i=0; i<ed_script->opnum; i++) {
350                    int num=((ed_script->ops[i]) >> 2);
351                    char op_type = 3 - ( ed_script->ops[i] & gxEDIT_OP_MASK );
352                    if (op_type == 3 || op_type < 0 )
# Line 371 | Line 371
371             }
372  
373   #ifdef GDEBUG
374 <        void printAlignment(FILE* f, const char* sa, int sa_len,
374 >        void printAlignment(FILE* f, const char* sa, int sa_len,
375                       const char* sb, int sb_len) {
376                  //print seq A
377             char al[1024]; //display buffer for seq A
# Line 436 | Line 436
436         }
437   #endif
438    };
439 <  
439 >
440   struct GXAlnInfo {
441   const char *qseq;
442   int ql,qr;
# Line 597 | Line 597
597            //by idxoffset we get a max of a_len+b_len-2
598        int bcount=a_len+b_len-1;
599        for (int i=0;i<bcount;i++)
600 <                   this->Add(new GXBand(i-idxoffset));
600 >              this->Add(new GXBand(i-idxoffset));
601             //unsorted, this should set fList[i]
602        }
603     ~GXBandSet() {
# Line 613 | Line 613
613   };
614  
615  
616 < GXBandSet* collectSeeds_R(GList<GXSeed>& seeds, const char* seqa, int a_len, const char* seqb, int b_len); //for overlap at 3' end of seqb
616 > uint16 get6mer(char* p);
617 > void table6mers(const char* s, int slen, GVec<uint16>* amers[]);
618 >
619 > GXBandSet* collectSeeds_R(GList<GXSeed>& seeds, const char* seqa, int a_len, GVec<uint16>* amers[],
620 >         const char* seqb, int b_len); //for overlap at 3' end of seqb
621  
622 < GXBandSet* collectSeeds_L(GList<GXSeed>& seeds, const char* seqa, int a_len, const char* seqb, int b_len); //for overlap at 5' end of seqb
622 > GXBandSet* collectSeeds_L(GList<GXSeed>& seeds, const char* seqa, int a_len, GVec<uint16>* amers[],
623 >        const char* seqb, int b_len); //for overlap at 5' end of seqb
624  
625   void printEditScript(GXEditScript* ed_script);
626  
# Line 672 | Line 677
677      prepare(trim_type, s, s_len);
678      }
679  
680 <  bool validate(int sl, int sr, int alnpid, int adist) {
680 >  bool validate(int slen, int sl, int sr, int alnpid, int adist) {
681     int alnlen=sr-sl+1;
682 +   if (alnpid>95) {
683 +     if (alnlen>=slen-2 || alnlen>21 ) return true;
684 +     }
685     sl--;sr--; //boundary is 0-based
686     int badj=0; //default boundary is 3 bases distance to end
687     int admax=1;
# Line 713 | Line 721
721   GXAlnInfo* GreedyAlign(const char* q_seq,  int q_alnstart, const char* s_seq, int s_alnstart,
722          bool editscript=false, int reward=2, int penalty=3, int xdrop=8);
723  
724 < GXAlnInfo* match_LeftEnd(const char* seqa, int seqa_len, const char* seqb, int seqb_len,
725 <          CGreedyAlignData* gxmem=NULL, int min_pid=83);
726 < GXAlnInfo* match_RightEnd(const char* seqa, int seqa_len, const char* seqb, int seqb_len,
727 <          CGreedyAlignData* gxmem=NULL, int min_pid=73);
724 > GXAlnInfo* match_LeftEnd(const char* seqa, int seqa_len, GVec<uint16>* amers[],
725 >           const char* seqb, int seqb_len, CGreedyAlignData* gxmem=NULL, int min_pid=83);
726 > GXAlnInfo* match_RightEnd(const char* seqa, int seqa_len, GVec<uint16>* amers[],
727 >           const char* seqb, int seqb_len, CGreedyAlignData* gxmem=NULL, int min_pid=73);
728   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines