Next version of JABA
[jabaws.git] / binaries / src / muscle / aligntwoprofs.cpp
1 #include "muscle.h"\r
2 #include "msa.h"\r
3 #include "profile.h"\r
4 #include "pwpath.h"\r
5 \r
6 SCORE GlobalAlign4(ProfPos *PA, unsigned uLengthA, ProfPos *PB,\r
7   unsigned uLengthB, PWPath &Path);\r
8 \r
9 SCORE AlignTwoProfs(\r
10   const ProfPos *PA, unsigned uLengthA, WEIGHT wA,\r
11   const ProfPos *PB, unsigned uLengthB, WEIGHT wB,\r
12   PWPath &Path, ProfPos **ptrPout, unsigned *ptruLengthOut)\r
13         {\r
14         assert(uLengthA < 100000);\r
15         assert(uLengthB < 100000);\r
16 \r
17         float r = (float) uLengthA/ (float) (uLengthB + 1); // +1 to prevent div 0\r
18         if (r < 1)\r
19                 r = 1/r;\r
20 \r
21         SCORE Score = GlobalAlign(PA, uLengthA, PB, uLengthB, Path);\r
22 \r
23         AlignTwoProfsGivenPath(Path, PA, uLengthB, wA/(wA + wB), PB, uLengthB, wB/(wA + wB),\r
24           ptrPout, ptruLengthOut);\r
25 \r
26 #if     HYDRO\r
27         if (ALPHA_Amino == g_Alpha)\r
28                 Hydro(*ptrPout, *ptruLengthOut);\r
29 #endif\r
30         return Score;\r
31         }\r