本文整理汇总了C++中Sequence::asInt方法的典型用法代码示例。如果您正苦于以下问题:C++ Sequence::asInt方法的具体用法?C++ Sequence::asInt怎么用?C++ Sequence::asInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sequence
的用法示例。
在下文中一共展示了Sequence::asInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: convertNmerCode
unsigned convertNmerCode(unsigned rawCode,int seqLength,const Alphabet &alphabet)
{
Sequence S;
S.resize(seqLength);
unsigned base=alphabet.size();
for(int i=seqLength-1 ; i>=0 ; --i) {
unsigned digit=rawCode%base;
Symbol s=(int)digit;
S[i]=s;
rawCode/=base;
}
return S.asInt(alphabet,0,S.getLength());
}
示例3: 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());
}
示例4: setNmerEqFreq
void NmerRateMatrix::setNmerEqFreq(const Sequence &nmer,double nmerFreq)
{
int index=nmer.asInt(alphabetMap);
eq[index]=nmerFreq;
}