本文整理汇总了C++中SeqVect::GetSeqCount方法的典型用法代码示例。如果您正苦于以下问题:C++ SeqVect::GetSeqCount方法的具体用法?C++ SeqVect::GetSeqCount怎么用?C++ SeqVect::GetSeqCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SeqVect
的用法示例。
在下文中一共展示了SeqVect::GetSeqCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AlignSubFam
void AlignSubFam(SeqVect &vAll, const Tree &GuideTree, unsigned uNodeIndex,
MSA &msaOut)
{
const unsigned uSeqCount = vAll.GetSeqCount();
const char *InTmp = "asf_in.tmp";
const char *OutTmp = "asf_out.tmp";
unsigned *Leaves = new unsigned[uSeqCount];
unsigned uLeafCount;
GetLeaves(GuideTree, uNodeIndex, Leaves, &uLeafCount);
SeqVect v;
for (unsigned i = 0; i < uLeafCount; ++i)
{
unsigned uLeafNodeIndex = Leaves[i];
unsigned uId = GuideTree.GetLeafId(uLeafNodeIndex);
Seq &s = vAll.GetSeqById(uId);
v.AppendSeq(s);
}
#if TRACE
{
Log("Align subfam[node=%d, size=%d] ", uNodeIndex, uLeafCount);
for (unsigned i = 0; i < uLeafCount; ++i)
Log(" %s", v.GetSeqName(i));
Log("\n");
}
#endif
TextFile fIn(InTmp, true);
v.ToFASTAFile(fIn);
fIn.Close();
char CmdLine[4096];
sprintf(CmdLine, "probcons %s > %s 2> /dev/null", InTmp, OutTmp);
// sprintf(CmdLine, "muscle -in %s -out %s -maxiters 1", InTmp, OutTmp);
system(CmdLine);
TextFile fOut(OutTmp);
msaOut.FromFile(fOut);
for (unsigned uSeqIndex = 0; uSeqIndex < uLeafCount; ++uSeqIndex)
{
const char *Name = msaOut.GetSeqName(uSeqIndex);
unsigned uId = vAll.GetSeqIdFromName(Name);
msaOut.SetSeqId(uSeqIndex, uId);
}
unlink(InTmp);
unlink(OutTmp);
delete[] Leaves;
}
示例2: MakeRootMSA
void MakeRootMSA(const SeqVect &v, const Tree &GuideTree, ProgNode Nodes[],
MSA &a)
{
#if TRACE
Log("MakeRootMSA Tree=");
GuideTree.LogMe();
#endif
const unsigned uSeqCount = v.GetSeqCount();
unsigned uColCount = uInsane;
unsigned uSeqIndex = 0;
const unsigned uTreeNodeCount = GuideTree.GetNodeCount();
const unsigned uRootNodeIndex = GuideTree.GetRootNodeIndex();
const PWPath &RootPath = Nodes[uRootNodeIndex].m_Path;
const unsigned uRootColCount = RootPath.GetEdgeCount();
const unsigned uEstringSize = uRootColCount + 1;
short *Estring1 = new short[uEstringSize];
short *Estring2 = new short[uEstringSize];
SetProgressDesc("Root alignment");
unsigned uTreeNodeIndex = GetFirstNodeIndex(GuideTree);
do
{
Progress(uSeqIndex, uSeqCount);
unsigned uId = GuideTree.GetLeafId(uTreeNodeIndex);
const Seq &s = *(v[uId]);
Seq sRootE;
short *es = MakeRootSeqE(s, GuideTree, uTreeNodeIndex, Nodes, sRootE,
Estring1, Estring2);
Nodes[uTreeNodeIndex].m_EstringL = EstringNewCopy(es);
#if VALIDATE
Seq sRoot;
MakeRootSeq(s, GuideTree, uTreeNodeIndex, Nodes, sRoot);
if (!sRoot.Eq(sRootE))
{
Log("sRoot=");
sRoot.LogMe();
Log("sRootE=");
sRootE.LogMe();
Quit("Root seqs differ");
}
#if TRACE
Log("MakeRootSeq=\n");
sRoot.LogMe();
#endif
#endif
if (uInsane == uColCount)
{
uColCount = sRootE.Length();
a.SetSize(uSeqCount, uColCount);
}
else
{
assert(uColCount == sRootE.Length());
}
a.SetSeqName(uSeqIndex, s.GetName());
a.SetSeqId(uSeqIndex, uId);
for (unsigned uColIndex = 0; uColIndex < uColCount; ++uColIndex)
a.SetChar(uSeqIndex, uColIndex, sRootE[uColIndex]);
++uSeqIndex;
uTreeNodeIndex = GetNextNodeIndex(GuideTree, uTreeNodeIndex);
}
while (NULL_NEIGHBOR != uTreeNodeIndex);
delete[] Estring1;
delete[] Estring2;
ProgressStepsDone();
assert(uSeqIndex == uSeqCount);
}