本文整理汇总了C++中DeBruijnNode::best5pLink方法的典型用法代码示例。如果您正苦于以下问题:C++ DeBruijnNode::best5pLink方法的具体用法?C++ DeBruijnNode::best5pLink怎么用?C++ DeBruijnNode::best5pLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeBruijnNode
的用法示例。
在下文中一共展示了DeBruijnNode::best5pLink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findBestLinks
void AssemblyJobSsDeBruijn::findBestLinks(DeBruijnGraph* graph){
char nucs[] = {'A','T','C','G'};
for (DeBruijnGraph::Iterator nodeIt = graph->begin(); nodeIt != graph->end(); ++nodeIt){
DeBruijnNode* currentNode = *nodeIt;
DeBruijnNode* best5pLink = 0;
float best5pLinkScore = 0;
DeBruijnNode* best3pLink = 0;
float best3pLinkScore = 0;
for (int n = 0; n < 4; ++n){
DeBruijnNode* cand5pLink = currentNode->get5pLink(nucs[n]);
if (cand5pLink != 0){
// take the worse of the two linkage scores
float next5pLinkScore;
if (currentNode->get5pLinkScore(nucs[n]) > cand5pLink->get3pLinkScore(currentNode->get3pNuc()) ){
next5pLinkScore = cand5pLink->get3pLinkScore(currentNode->get3pNuc());
} else { next5pLinkScore = currentNode->get5pLinkScore(nucs[n]); }
if (next5pLinkScore > best5pLinkScore){
best5pLinkScore = next5pLinkScore;
best5pLink = cand5pLink;
}
}
DeBruijnNode* cand3pLink = currentNode->get3pLink(nucs[n]);
if (cand3pLink != 0){
// take the worse of the two linkage scores
float next3pLinkScore;
if (currentNode->get3pLinkScore(nucs[n]) > cand3pLink->get5pLinkScore(currentNode->get5pNuc()) ){
next3pLinkScore = cand3pLink->get5pLinkScore(currentNode->get5pNuc());
} else { next3pLinkScore = currentNode->get3pLinkScore(nucs[n]); }
if (next3pLinkScore > best3pLinkScore){
best3pLinkScore = next3pLinkScore;
best3pLink = cand3pLink;
}
}
}
currentNode->setBest5pLink(best5pLink);
currentNode->setBest3pLink(best3pLink);
}
// FOURTH resolve best-edge conflicts
for (DeBruijnGraph::Iterator nodeIt = graph->begin(); nodeIt != graph->end(); ++nodeIt){
DeBruijnNode* currentNode = *nodeIt;
DeBruijnNode* best5pLink = currentNode->best5pLink();
if (best5pLink != 0 and best5pLink->best3pLink() != currentNode){
DeBruijnNode* bestRecip = best5pLink->best3pLink();
if (bestRecip == 0){ best5pLink->setBest3pLink(currentNode); }
else { currentNode->setBest5pLink( 0 ); }
}
DeBruijnNode* best3pLink = currentNode->best3pLink();
if (best3pLink != 0 and best3pLink->best5pLink() != currentNode){
DeBruijnNode* bestRecip = best3pLink->best5pLink();
if (bestRecip == 0){ best3pLink->setBest5pLink(currentNode); }
else { currentNode->setBest3pLink( 0 ); }
}
}
}