本文整理汇总了C++中SeqVect::GetSeqIdFromName方法的典型用法代码示例。如果您正苦于以下问题:C++ SeqVect::GetSeqIdFromName方法的具体用法?C++ SeqVect::GetSeqIdFromName怎么用?C++ SeqVect::GetSeqIdFromName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SeqVect
的用法示例。
在下文中一共展示了SeqVect::GetSeqIdFromName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: DoMuscle
//.........这里部分代码省略.........
if (uSeqCount > 1)
MHackStart(v);
// First iteration
Tree GuideTree;
if (0 != g_pstrUseTreeFileName.get())
{
// Discourage users...
if (!g_bUseTreeNoWarn.get())
fprintf(stderr, g_strUseTreeWarning);
// Read tree from file
TextFile TreeFile(g_pstrUseTreeFileName.get());
GuideTree.FromFile(TreeFile);
// Make sure tree is rooted
if (!GuideTree.IsRooted())
Quit("User tree must be rooted");
if (GuideTree.GetLeafCount() != uSeqCount)
Quit("User tree does not match input sequences");
const unsigned uNodeCount = GuideTree.GetNodeCount();
for (unsigned uNodeIndex = 0; uNodeIndex < uNodeCount; ++uNodeIndex)
{
if (!GuideTree.IsLeaf(uNodeIndex))
continue;
const char *LeafName = GuideTree.GetLeafName(uNodeIndex);
unsigned uSeqIndex;
bool SeqFound = v.FindName(LeafName, &uSeqIndex);
if (!SeqFound)
Quit("Label %s in tree does not match sequences", LeafName);
unsigned uId = v.GetSeqIdFromName(LeafName);
GuideTree.SetLeafId(uNodeIndex, uId);
}
}
else
TreeFromSeqVect(v, GuideTree, g_Cluster1.get(), g_Distance1.get(), g_Root1.get(),
g_pstrDistMxFileName1.get());
const char *Tree1 = ValueOpt("Tree1");
if (0 != Tree1)
{
TextFile f(Tree1, true);
GuideTree.ToFile(f);
if (g_bClusterOnly.get())
return;
}
SetMuscleTree(GuideTree);
ValidateMuscleIds(GuideTree);
MSA msa;
ProgNode *ProgNodes = 0;
if (g_bLow.get())
ProgNodes = ProgressiveAlignE(v, GuideTree, msa);
else
ProgressiveAlign(v, GuideTree, msa);
SetCurrentAlignment(msa);
if (0 != g_pstrComputeWeightsFileName.get())
{
extern void OutWeights(const char *FileName, const MSA &msa);
SetMSAWeightsMuscle(msa);
OutWeights(g_pstrComputeWeightsFileName.get(), msa);
示例3: DoMuscle
//.........这里部分代码省略.........
if (uSeqCount > 1)
MHackStart(v);
// First iteration
Tree GuideTree;
if (0 != g_pstrUseTreeFileName)
{
// Discourage users...
if (!g_bUseTreeNoWarn)
fprintf(stderr, "%s", g_strUseTreeWarning);
// Read tree from file
TextFile TreeFile(g_pstrUseTreeFileName);
GuideTree.FromFile(TreeFile);
// Make sure tree is rooted
if (!GuideTree.IsRooted())
Quit("User tree must be rooted");
if (GuideTree.GetLeafCount() != uSeqCount)
Quit("User tree does not match input sequences");
const unsigned uNodeCount = GuideTree.GetNodeCount();
for (unsigned uNodeIndex = 0; uNodeIndex < uNodeCount; ++uNodeIndex)
{
if (!GuideTree.IsLeaf(uNodeIndex))
continue;
const char *LeafName = GuideTree.GetLeafName(uNodeIndex);
unsigned uSeqIndex;
bool SeqFound = v.FindName(LeafName, &uSeqIndex);
if (!SeqFound)
Quit("Label %s in tree does not match sequences", LeafName);
unsigned uId = v.GetSeqIdFromName(LeafName);
GuideTree.SetLeafId(uNodeIndex, uId);
}
}
else
TreeFromSeqVect(v, GuideTree, g_Cluster1, g_Distance1, g_Root1,
g_pstrDistMxFileName1);
const char *Tree1 = ValueOpt("Tree1");
if (0 != Tree1)
{
TextFile f(Tree1, true);
GuideTree.ToFile(f);
if (g_bClusterOnly)
return;
}
SetMuscleTree(GuideTree);
ValidateMuscleIds(GuideTree);
MSA msa;
msa.SetCompositeVector(CVLocation);
ProgNode *ProgNodes = 0;
if (g_bLow)
ProgNodes = ProgressiveAlignE(v, GuideTree, msa);
else
ProgressiveAlign(v, GuideTree, msa);
SetCurrentAlignment(msa);
if (0 != g_pstrComputeWeightsFileName)
{
extern void OutWeights(const char *FileName, const MSA &msa);
SetMSAWeightsMuscle(msa);