Next version of JABA
[jabaws.git] / binaries / src / muscle / stabilize.cpp
1 #include "muscle.h"\r
2 #include "msa.h"\r
3 \r
4 void Stabilize(const MSA &msa, MSA &msaStable)\r
5         {\r
6         const unsigned uSeqCount = msa.GetSeqCount();\r
7         const unsigned uColCount = msa.GetColCount();\r
8 \r
9         msaStable.SetSize(uSeqCount, uColCount);\r
10         for (unsigned uId = 0; uId < uSeqCount; ++uId)\r
11                 {\r
12                 const unsigned uSeqIndex = msa.GetSeqIndex(uId);\r
13                 msaStable.SetSeqName(uId, msa.GetSeqName(uSeqIndex));\r
14                 msaStable.SetSeqId(uSeqIndex, uId);\r
15                 for (unsigned uColIndex = 0; uColIndex < uColCount; ++uColIndex)\r
16                         {\r
17                         const char c = msa.GetChar(uSeqIndex, uColIndex);\r
18                         msaStable.SetChar(uId, uColIndex, c);\r
19                         }\r
20                 }\r
21         }\r