本文整理汇总了C++中PWPath::AssertEqual方法的典型用法代码示例。如果您正苦于以下问题:C++ PWPath::AssertEqual方法的具体用法?C++ PWPath::AssertEqual怎么用?C++ PWPath::AssertEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PWPath
的用法示例。
在下文中一共展示了PWPath::AssertEqual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProfileFromMSA
//.........这里部分代码省略.........
Parent.m_Path,
&Parent.m_Prof, &Parent.m_uLength);
#if TRACE_LENGTH_DELTA
{
unsigned L = Node1.m_uLength;
unsigned R = Node2.m_uLength;
unsigned P = Parent.m_Path.GetEdgeCount();
unsigned Max = L > R ? L : R;
unsigned d = P - Max;
Log("LD%u;%u;%u;%u\n", L, R, P, d);
}
#endif
PathToEstrings(Parent.m_Path, &Parent.m_EstringL, &Parent.m_EstringR);
Parent.m_Weight = Node1.m_Weight + Node2.m_Weight;
#if VALIDATE
{
#if TRACE
Log("AlignTwoMSAs:\n");
#endif
PWPath TmpPath;
AlignTwoMSAs(Node1.m_MSA, Node2.m_MSA, Parent.m_MSA, TmpPath);
ProfPos *P1 = ProfileFromMSA(Node1.m_MSA, true);
ProfPos *P2 = ProfileFromMSA(Node2.m_MSA, true);
unsigned uLength = Parent.m_MSA.GetColCount();
ProfPos *TmpProf = ProfileFromMSA(Parent.m_MSA, true);
#if TRACE
Log("Node1 MSA=\n");
Node1.m_MSA.LogMe();
Log("Node1 prof=\n");
ListProfile(Node1.m_Prof, Node1.m_MSA.GetColCount(), &Node1.m_MSA);
Log("Node1 prof (from MSA)=\n");
ListProfile(P1, Node1.m_MSA.GetColCount(), &Node1.m_MSA);
AssertProfsEq(Node1.m_Prof, Node1.m_uLength, P1, Node1.m_MSA.GetColCount());
Log("Node2 prof=\n");
ListProfile(Node2.m_Prof, Node2.m_MSA.GetColCount(), &Node2.m_MSA);
Log("Node2 MSA=\n");
Node2.m_MSA.LogMe();
Log("Node2 prof (from MSA)=\n");
ListProfile(P2, Node2.m_MSA.GetColCount(), &Node2.m_MSA);
AssertProfsEq(Node2.m_Prof, Node2.m_uLength, P2, Node2.m_MSA.GetColCount());
TmpPath.AssertEqual(Parent.m_Path);
Log("Parent MSA=\n");
Parent.m_MSA.LogMe();
Log("Parent prof=\n");
ListProfile(Parent.m_Prof, Parent.m_uLength, &Parent.m_MSA);
Log("Parent prof (from MSA)=\n");
ListProfile(TmpProf, Parent.m_MSA.GetColCount(), &Parent.m_MSA);
#endif // TRACE
AssertProfsEq(Parent.m_Prof, Parent.m_uLength,
TmpProf, Parent.m_MSA.GetColCount());
delete[] P1;
delete[] P2;
delete[] TmpProf;
}
#endif // VALIDATE
Node1.m_MSA.Clear();
Node2.m_MSA.Clear();
// Don't delete profiles, may need them for tree refinement.
//delete[] Node1.m_Prof;
//delete[] Node2.m_Prof;
//Node1.m_Prof = 0;
//Node2.m_Prof = 0;
}
uTreeNodeIndex = GuideTree.NextDepthFirstNode(uTreeNodeIndex);
}
while (NULL_NEIGHBOR != uTreeNodeIndex);
ProgressStepsDone();
if (g_bBrenner)
MakeRootMSABrenner((SeqVect &) v, GuideTree, ProgNodes, a);
else
MakeRootMSA(v, GuideTree, ProgNodes, a);
#if VALIDATE
{
unsigned uRootNodeIndex = GuideTree.GetRootNodeIndex();
const ProgNode &RootProgNode = ProgNodes[uRootNodeIndex];
AssertMSAEq(a, RootProgNode.m_MSA);
}
#endif
delete[] Weights;
return ProgNodes;
}
示例2: PathToEstrings
//.........这里部分代码省略.........
case c2('D', 'I'):
++iA;
esA[iA] = -1;
break;
case c2('I', 'I'):
--(esA[iA]);
break;
default:
assert(false);
}
cPrevEdgeType = cEdgeType;
}
assert(iA == iLengthA - 1);
esA[iLengthA] = 0;
*ptresA = esA;
}
{
// Pass2 for seq B
short *esB = new short[iLengthB+1];
unsigned iB = 0;
switch (Path.GetEdge(0).cType)
{
case 'M':
case 'I':
esB[0] = 1;
break;
case 'D':
esB[0] = -1;
break;
default:
assert(false);
}
char cPrevEdgeType = cFirstEdgeType;
for (unsigned uEdgeIndex = 1; uEdgeIndex < uEdgeCount; ++uEdgeIndex)
{
const PWEdge &Edge = Path.GetEdge(uEdgeIndex);
char cEdgeType = Edge.cType;
switch (c2(cPrevEdgeType, cEdgeType))
{
case c2('M', 'M'):
case c2('I', 'I'):
case c2('I', 'M'):
case c2('M', 'I'):
++(esB[iB]);
break;
case c2('D', 'I'):
case c2('D', 'M'):
++iB;
esB[iB] = 1;
break;
case c2('M', 'D'):
case c2('I', 'D'):
++iB;
esB[iB] = -1;
break;
case c2('D', 'D'):
--(esB[iB]);
break;
default:
assert(false);
}
cPrevEdgeType = cEdgeType;
}
assert(iB == iLengthB - 1);
esB[iLengthB] = 0;
*ptresB = esB;
}
#if DEBUG
{
const PWEdge &LastEdge = Path.GetEdge(uEdgeCount - 1);
unsigned uSymbols;
unsigned uIndels;
EstringCounts(*ptresA, &uSymbols, &uIndels);
assert(uSymbols == LastEdge.uPrefixLengthA);
assert(uSymbols + uIndels == uEdgeCount);
EstringCounts(*ptresB, &uSymbols, &uIndels);
assert(uSymbols == LastEdge.uPrefixLengthB);
assert(uSymbols + uIndels == uEdgeCount);
PWPath TmpPath;
EstringsToPath(*ptresA, *ptresB, TmpPath);
TmpPath.AssertEqual(Path);
}
#endif
}