本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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());
}
示例5: initSeq
void GenomeFeature::initSeq(const Sequence &from)
{
from.getSubsequence(begin,end-begin,seq);
}