11 #include "alnparams.h"
\r
12 #include "alnheuristics.h"
\r
13 #include "hspfinder.h"
\r
15 typedef void (*OnPathFn)(const string &Path, bool Full);
\r
25 float ViterbiBrute(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
26 unsigned DiagLo, unsigned DiagHi, const AlnParams &AP, PathData &PD);
\r
28 float ViterbiSimple(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
29 const AlnParams &AP, PathData &PD);
\r
31 float ViterbiSimpleBand(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
32 const AlnParams &AP, unsigned DiagLo, unsigned DiagHi, PathData &PD);
\r
34 float ViterbiFast(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
35 const AlnParams &AP, PathData &PD);
\r
37 float ViterbiFastBand(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
38 unsigned DiagLo, unsigned DiagHi, const AlnParams &AP, PathData &PD);
\r
40 float ViterbiFastMainDiag(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
41 unsigned BandRadius, const AlnParams &AP, PathData &PD);
\r
43 float XDropFwdSimple(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
44 const AlnParams &AP, float XDrop, unsigned &Leni, unsigned &Lenj, PathData &PD);
\r
46 float XDropBwdSimple(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
47 const AlnParams &AP, float XDrop, unsigned &Leni, unsigned &Lenj, PathData &PD);
\r
49 float XDropFwdFast(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
50 const AlnParams &AP, float XDrop, unsigned &Leni, unsigned &Lenj, PathData &PD);
\r
52 float XDropBwdFast(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
53 const AlnParams &AP, float XDrop, unsigned &Leni, unsigned &Lenj, PathData &PD);
\r
55 void XDropAlign(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
56 unsigned AncLoi, unsigned AncLoj, unsigned AncLen, const AlnParams &AP,
\r
57 float XDrop, HSPData &HSP, PathData &PD);
\r
59 float SWSimple(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
60 const AlnParams &AP, unsigned &Loi, unsigned &Leni, unsigned &Lenj,
\r
61 unsigned &Hij, PathData &PD);
\r
63 float SWFast(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
64 const AlnParams &AP, unsigned &Loi, unsigned &Leni, unsigned &Lenj,
\r
65 unsigned &Hij, PathData &PD);
\r
67 void SWFast2(const SeqData &SA, const SeqData &SB, const AlnParams &AP,
\r
68 HSPData &HSP, PathData &PD);
\r
70 void SWSimple2(const SeqData &SA, const SeqData &SB, const AlnParams &AP,
\r
71 HSPData &HSP, PathData &PD);
\r
73 float SWUngapped(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
74 const float * const *SubstMx, unsigned &LoA, unsigned &LoB, unsigned &Len);
\r
76 void SWUngapped2(const SeqData &SA, const SeqData &SB, const AlnParams &AP,
\r
79 float SWFastNTB(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
80 const AlnParams &AP);
\r
82 void GlobalAlignBand(const byte *A, unsigned LA, const byte *B, unsigned LB,
\r
83 const AlnParams &AP, unsigned BandRadius, PathData &PD);
\r
85 bool GlobalAlign(const SeqData &Query, const SeqData &Target, const AlnParams &AP,
\r
86 const AlnHeuristics &AH, HSPFinder &HF, float MinFractId, float &HSPFractId,
\r
89 bool GlobalAlign(const SeqData &Query, const SeqData &Target, string &Path);
\r
91 void GetBruteMxs(Mx<float> **M, Mx<float> **D, Mx<float> **I);
\r
92 void GetSimpleDPMxs(Mx<float> **M, Mx<float> **D, Mx<float> **I);
\r
93 void GetSimpleBandMxs(Mx<float> **M, Mx<float> **D, Mx<float> **I);
\r
94 void GetXDropFwdSimpleDPMxs(Mx<float> **M, Mx<float> **D, Mx<float> **I);
\r
96 void GetFastMxs(Mx<float> **M, Mx<float> **D, Mx<float> **I);
\r
97 void GetFastBandMxs(Mx<float> **M, Mx<float> **D, Mx<float> **I);
\r
101 void TraceBackBit(unsigned LA, unsigned LB, char State, PathData &PD);
\r
102 void TraceBackBitSW(unsigned LA, unsigned LB, unsigned Besti, unsigned Bestj,
\r
103 unsigned &Leni, unsigned &Lenj, PathData &PD);
\r
104 void EnumPaths(unsigned L1, unsigned L2, bool SubPaths, OnPathFn OnPath);
\r
105 void AllocBit(unsigned LA, unsigned LB);
\r
107 const byte TRACEBITS_DM = 0x01;
\r
108 const byte TRACEBITS_IM = 0x02;
\r
109 const byte TRACEBITS_MD = 0x04;
\r
110 const byte TRACEBITS_MI = 0x08;
\r
111 const byte TRACEBITS_SM = 0x10;
\r
112 const byte TRACEBITS_UNINIT = ~0x1f;
\r
114 extern Mx<byte> g_Mx_TBBit;
\r
115 extern float *g_DPRow1;
\r
116 extern float *g_DPRow2;
\r
117 extern byte **g_TBBit;
\r
119 static inline void Max_xM(float &Score, float MM, float DM, float IM, byte &State)
\r
136 static inline void Max_xD(float &Score, float MD, float DD, byte &State)
\r
150 static inline void Max_xI(float &Score, float MI, float II, byte &State)
\r