本文整理汇总了C++中boom::String::substring方法的典型用法代码示例。如果您正苦于以下问题:C++ String::substring方法的具体用法?C++ String::substring怎么用?C++ String::substring使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boom::String
的用法示例。
在下文中一共展示了String::substring方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scoreSingleBase
double IMM::scoreSingleBase(const Sequence &seq,const BOOM::String &str,
int index,Symbol s,char c)
{
const char *p=str.c_str();
switch(getStrand())
{
case PLUS_STRAND:
{
int maxOrder=(index>N ? N : index);
for(int order=maxOrder ; order>=0 ; --order)
{
BOOM::StringMap<double> &model=*(*models)[order];
if(model.isDefined(p,index-order,order+1))
return model.lookup(p,index-order,order+1);
}
throw BOOM::String("IMM::scoreSingleBase('+',")+
index+",strlen="+strlen(p)+",str="+
str.substring(index,maxOrder)+")";
}
case MINUS_STRAND:
{
/*
On the minus strand we have to take our contexts from the
right (but only because we trained the model that way)
*/
int seqLen=str.length();
int maxOrder=seqLen-index-1;
if(maxOrder>N) maxOrder=N;
for(int order=maxOrder ; order>=0 ; --order)
{
BOOM::StringMap<double> &model=*(*models)[order];
if(model.isDefined(p,index,order+1))
return model.lookup(p,index,order+1);
}
throw BOOM::Stacktrace(
BOOM::String("IMM::scoreSingleBase('-',")+
index+",strlen="+strlen(p)+",str="+
str.substring(index,maxOrder)+")");
}
default: throw BOOM::String(__FILE__)+__LINE__;
}
}
示例2: getSequence
BOOM::String SignalPeptide::getSequence()
{
BOOM::String sequence;
int n=exons.size();
for(int i=0 ; i<n ; ++i)
sequence+=exons[i].getSequence();
if(sequence[0]=='M')
sequence=sequence.substring(1,sequence.length()-1);
return sequence;
}
示例3: loadSequence
void PeptideExon::loadSequence(const BOOM::String &substrate)
{
sequence=substrate.substring(begin,end-begin);
}