本文整理汇总了C++中SeqVect::GetSeqById方法的典型用法代码示例。如果您正苦于以下问题:C++ SeqVect::GetSeqById方法的具体用法?C++ SeqVect::GetSeqById怎么用?C++ SeqVect::GetSeqById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SeqVect
的用法示例。
在下文中一共展示了SeqVect::GetSeqById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}