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


C++ Sequence::getSubsequence方法代码示例

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


在下文中一共展示了Sequence::getSubsequence方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: jointProb

  // jointProb() precodition: neither nmer is degenerate!
  double jointProb(Sequence &parentNmer,Sequence &childNmer,
		   NthOrdSubstMatrix &noPt) {
    double logP=0;
    Sequence parentContext, childContext;
    for(int i=0 ; i<numCols ; ++i) {
      Symbol parentSymbol=parentNmer[i], childSymbol=childNmer[i];
      parentNmer.getSubsequence(0,i,parentContext);
      childNmer.getSubsequence(0,i,childContext);
      SubstitutionMatrix &Pt=*noPt.lookup(parentContext);
      logP+=Pt(parentSymbol,childSymbol);
    }
    return logP;
  }
开发者ID:bmajoros,项目名称:PhyLib,代码行数:14,代码来源:ACO_Felsenstein.C

示例2: A

  RCO_Likelihooder(int numNodes,int numAlpha,Alphabet &alpha,
		   MultSeqAlignment &A,int column,
		   RootNode *root,int order,AlphabetMap &alphabetMap,
		   const BitSet &gapSymbols)
    : A(A), numNodes(numNodes), numAlpha(numAlpha),
      alpha(alpha), L(numNodes,numAlpha), column(column),
      alphabetMap(alphabetMap), gapSymbols(gapSymbols)
  {
    // ctor
    
    // Get the root's left-context for this column (for RCO)
    int rootID=root->getID();
    AlignmentSeq &rootTrack=A.getIthTrack(rootID);
    int contextBegin=column-order;
    if(contextBegin<0) contextBegin=0;
    int contextLen=column-contextBegin;
    rootTrack.getSeq().getSubsequence(contextBegin,contextLen,
				      rootContext);
    int pos=MultSeqAlignment::rightmostGapPos(rootContext,gapSymbols);
    if(pos>=0) {
      Sequence temp;
      rootContext.getSubsequence(pos+1,contextLen-pos-1,temp);
      rootContext=temp;
    }
    rootContextCode=rootContext.asInt(alphabetMap);
    rootContextLength=contextLen;
  }
开发者ID:bmajoros,项目名称:PhyLib,代码行数:27,代码来源:RCO_Felsenstein.C

示例3: processInternalChild

  double processInternalChild(Symbol parentSymbol,int parentID,int child,
			      NthOrdSubstMatrix &noPt) {
    AlignmentSeq &track=A.getIthTrack(parentID);
    AlignmentSeq &childTrack=A.getIthTrack(child);
    int contextBegin=column-order;
    if(contextBegin<0) contextBegin=0;
    int contextLen=column-contextBegin;
    Sequence context;
    track.getSeq().getSubsequence(contextBegin,contextLen,context);//ACO
    //A.getIthTrack(root->getID()).getSeq().getSubsequence(contextBegin,contextLen,context);//TRCO
    int pos=MultSeqAlignment::rightmostGapPos(context,gapSymbols);
    if(pos>=0) {
      throw "this should not happen (FitchFelsenstein)::processInternalChild";
      Sequence temp;
      context.getSubsequence(pos+1,contextLen-pos-1,temp);
      context=temp;
    }
    SubstitutionMatrix &Pt=*noPt.lookup(context,0,-1);
    Array2D<double>::RowIn2DArray<double> row=L[child];
    Symbol childSym=childTrack.getSeq()[column];
    double ll;
    if(gapSymbols.isMember(childSym)){
      V.setAllTo(NEGATIVE_INFINITY);
      for(Symbol a=0 ; a<numAlpha ; ++a) {
	if(!gapSymbols.isMember(a)) {
	  V[(int)a]=safeAdd(row[a],Pt(parentSymbol,a));
	}
      }
      ll=sumLogProbs(V);
    }
    else {
      ll=safeAdd(row[childSym],Pt(parentSymbol,childSym));
    }
    return ll;
  }
开发者ID:bmajoros,项目名称:PhyLib,代码行数:35,代码来源:FitchFelsenstein.C

示例4: getContext

  void getContext(PhylogenyNode *node,int &contextCode,int &contextLength)
  {
    int ID=node->getID();
    AlignmentSeq &track=A.getIthTrack(ID);
    int contextBegin=column-order;
    if(contextBegin<0) contextBegin=0;
    contextLength=column-contextBegin;
    if(contextLength==0) {contextCode=0;return;}
    Sequence context;
    track.getSeq().getSubsequence(contextBegin,contextLength,context);
    int pos=MultSeqAlignment::rightmostGapPos(context,gapSymbols);
    if(pos>=0) {
      Sequence temp;
      int begin=pos+1, len=contextLength-pos-1;
      if(begin<order && len>0)
	context.getSubsequence(pos+1,contextLength-pos-1,temp);
      context=temp;
      contextLength=context.getLength();
    }
    contextCode=context.asInt(*alphabetMap.getRange());
  }
开发者ID:bmajoros,项目名称:PhyLib,代码行数:21,代码来源:LCO_Felsenstein.C

示例5: initSeq

void GenomeFeature::initSeq(const Sequence &from)
{
  from.getSubsequence(begin,end-begin,seq);
}
开发者ID:bmajoros,项目名称:EGGS,代码行数:4,代码来源:GenomeFeature.C


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