当前位置: 首页>>代码示例>>C++>>正文


C++ DeBruijnNode::get5pNuc方法代码示例

本文整理汇总了C++中DeBruijnNode::get5pNuc方法的典型用法代码示例。如果您正苦于以下问题:C++ DeBruijnNode::get5pNuc方法的具体用法?C++ DeBruijnNode::get5pNuc怎么用?C++ DeBruijnNode::get5pNuc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DeBruijnNode的用法示例。


在下文中一共展示了DeBruijnNode::get5pNuc方法的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 ); }
    }
  }
}
开发者ID:ccls,项目名称:sequencing,代码行数:55,代码来源:AssemblyJobSsDeBruijn.cpp


注:本文中的DeBruijnNode::get5pNuc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。