+++ /dev/null
-#include "muscle.h"\r
-#include "pwpath.h"\r
-#include "timing.h"\r
-#include "textfile.h"\r
-#include "msa.h"\r
-#include "profile.h"\r
-\r
-#if !VER_3_52\r
-\r
-#define COMPARE_SIMPLE 0\r
-\r
-#if TIMING\r
-TICKS g_ticksDP = 0;\r
-#endif\r
-\r
-#if 1\r
-extern bool g_bKeepSimpleDP;\r
-SCORE NWSmall(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path);\r
-SCORE NWDASmall(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path);\r
-SCORE NWDASimple(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path);\r
-SCORE NWDASimple2(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path);\r
-SCORE GlobalAlignSimple(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path);\r
-\r
-SCORE GlobalAlignNoDiags(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path)\r
- {\r
- return GlobalAlign(PA, uLengthA, PB, uLengthB, Path);\r
- }\r
-\r
-#if COMPARE_SIMPLE\r
-\r
-SCORE GlobalAlign(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path)\r
- {\r
-#if TIMING\r
- TICKS t1 = GetClockTicks();\r
-#endif\r
- g_bKeepSimpleDP = true;\r
- PWPath SimplePath;\r
- GlobalAlignSimple(PA, uLengthA, PB, uLengthB, SimplePath);\r
-\r
- SCORE Score = NWSmall(PA, uLengthA, PB, uLengthB, Path);\r
-\r
- if (!Path.Equal(SimplePath))\r
- {\r
- Log("Simple:\n");\r
- SimplePath.LogMe();\r
- Log("Small:\n");\r
- Path.LogMe();\r
- Quit("Paths differ");\r
- }\r
-\r
-#if TIMING\r
- TICKS t2 = GetClockTicks();\r
- g_ticksDP += (t2 - t1);\r
-#endif\r
- return Score;\r
- }\r
-\r
-#else // COMPARE_SIMPLE\r
-\r
-SCORE GlobalAlign(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path)\r
- {\r
-#if TIMING\r
- TICKS t1 = GetClockTicks();\r
-#endif\r
- SCORE Score = NWSmall(PA, uLengthA, PB, uLengthB, Path);\r
-#if TIMING\r
- TICKS t2 = GetClockTicks();\r
- g_ticksDP += (t2 - t1);\r
-#endif\r
- return Score;\r
- }\r
-\r
-#endif\r
-\r
-#else // 1\r
-\r
-static void AllInserts(PWPath &Path, unsigned uLengthB)\r
- {\r
- Path.Clear();\r
- PWEdge Edge;\r
- Edge.cType = 'I';\r
- Edge.uPrefixLengthA = 0;\r
- for (unsigned uPrefixLengthB = 1; uPrefixLengthB <= uLengthB; ++uPrefixLengthB)\r
- {\r
- Edge.uPrefixLengthB = uPrefixLengthB;\r
- Path.AppendEdge(Edge);\r
- }\r
- }\r
-\r
-static void AllDeletes(PWPath &Path, unsigned uLengthA)\r
- {\r
- Path.Clear();\r
- PWEdge Edge;\r
- Edge.cType = 'D';\r
- Edge.uPrefixLengthB = 0;\r
- for (unsigned uPrefixLengthA = 1; uPrefixLengthA <= uLengthA; ++uPrefixLengthA)\r
- {\r
- Edge.uPrefixLengthA = uPrefixLengthA;\r
- Path.AppendEdge(Edge);\r
- }\r
- }\r
-\r
-SCORE GlobalAlign(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path)\r
- {\r
-#if TIMING\r
- TICKS t1 = GetClockTicks();\r
-#endif\r
- if (0 == uLengthA)\r
- {\r
- AllInserts(Path, uLengthB);\r
- return 0;\r
- }\r
- else if (0 == uLengthB)\r
- {\r
- AllDeletes(Path, uLengthA);\r
- return 0;\r
- }\r
-\r
- SCORE Score = 0;\r
- if (g_bDiags)\r
- Score = GlobalAlignDiags(PA, uLengthA, PB, uLengthB, Path);\r
- else\r
- Score = GlobalAlignNoDiags(PA, uLengthA, PB, uLengthB, Path);\r
-#if TIMING\r
- TICKS t2 = GetClockTicks();\r
- g_ticksDP += (t2 - t1);\r
-#endif\r
- return Score;\r
- }\r
-\r
-SCORE GlobalAlignNoDiags(const ProfPos *PA, unsigned uLengthA, const ProfPos *PB,\r
- unsigned uLengthB, PWPath &Path)\r
- {\r
- if (g_bDimer)\r
- return GlobalAlignDimer(PA, uLengthA, PB, uLengthB, Path);\r
-\r
- switch (g_PPScore)\r
- {\r
- case PPSCORE_LE:\r
- return GlobalAlignLE(PA, uLengthA, PB, uLengthB, Path);\r
-\r
- case PPSCORE_SP:\r
- case PPSCORE_SV:\r
- return GlobalAlignSP(PA, uLengthA, PB, uLengthB, Path);\r
-\r
- case PPSCORE_SPN:\r
- return GlobalAlignSPN(PA, uLengthA, PB, uLengthB, Path);\r
- }\r
-\r
- Quit("Invalid PP score (GlobalAlignNoDiags)");\r
- return 0;\r
- }\r
-\r
-#endif\r
-\r
-#endif // !VER_3_52\r