+++ /dev/null
-#include "muscle.h"\r
-#include "seqvect.h"\r
-#include "msa.h"\r
-\r
-/***\r
-Methionine hack.\r
-Most proteins start with M.\r
-This results in odd-looking alignments with the terminal Ms aligned followed\r
-immediately by gaps.\r
-Hack this by treating terminal M like X.\r
-***/\r
-\r
-static bool *M;\r
-\r
-void MHackStart(SeqVect &v)\r
- {\r
- if (ALPHA_Amino != g_Alpha)\r
- return;\r
-\r
- const unsigned uSeqCount = v.Length();\r
- M = new bool[uSeqCount];\r
- memset(M, 0, uSeqCount*sizeof(bool));\r
- for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex)\r
- {\r
- Seq &s = v.GetSeq(uSeqIndex);\r
- if (0 == s.Length())\r
- continue;\r
- unsigned uId = s.GetId();\r
- if (s[0] == 'M' || s[0] == 'm')\r
- {\r
- M[uId] = true;\r
- s[0] = 'X';\r
- }\r
- }\r
- }\r
-\r
-void MHackEnd(MSA &msa)\r
- {\r
- if (ALPHA_Amino != g_Alpha)\r
- return;\r
- if (0 == M)\r
- return;\r
-\r
- const unsigned uSeqCount = msa.GetSeqCount();\r
- const unsigned uColCount = msa.GetColCount();\r
- for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex)\r
- {\r
- unsigned uId = msa.GetSeqId(uSeqIndex);\r
- if (M[uId])\r
- {\r
- for (unsigned uColIndex = 0; uColIndex < uColCount; ++uColIndex)\r
- {\r
- if (!msa.IsGap(uSeqIndex, uColIndex))\r
- {\r
- msa.SetChar(uSeqIndex, uColIndex, 'M');\r
- break;\r
- }\r
- }\r
- }\r
- }\r
-\r
- delete[] M;\r
- M = 0;\r
- }\r