本文整理汇总了C++中DNA::addSeq方法的典型用法代码示例。如果您正苦于以下问题:C++ DNA::addSeq方法的具体用法?C++ DNA::addSeq怎么用?C++ DNA::addSeq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DNA
的用法示例。
在下文中一共展示了DNA::addSeq方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeTotalFrequency
list<CalculatedOligo> OligoAnalisys::performAnalysis(DNA seq, DNA learningSeq,
double n, int oligoLength) {
list<CalculatedOligo> calOlig;
map<string, kmerFreq> freq;
map<string, kmerFreq>::iterator it;
map<string, Prefix> matrix;
CalculatedOligo olig;
int S = seq.chain.size();
int learningSeqSize = 0;
int T = 0;
int L = 0;
int seqTotalsize = 0;
for (int i = 0; i < learningSeq.chain.size(); ++i) {
learningSeqSize = learningSeqSize + learningSeq.chain[i].length();
}
for (int i = 0; i < S; ++i) {
L = L + (seq.chain[i].length() - oligoLength + 1);
}
T = 2 * L;
for (int m = 0; m < S; ++m) {
seq.addSeq(seq.chain[m].reverse_compliment());
}
for (int k = 0; k < (2 * S); ++k) {
seqTotalsize = seqTotalsize + seq.chain[k].length();
}
cout << " L " << L << endl;
cout << " T " << T << endl;
cout << " learningSeqSize " << learningSeqSize << endl;
cout << " seqTotalsize " << seqTotalsize << endl;
freq = computeTotalFrequency(learningSeq, 3, learningSeqSize);
matrix = buildTransitionTable(freq);
freq = computeTotalFrequency(seq, 6, seqTotalsize);
for (it = freq.begin(); it != freq.end(); ++it) {
olig.setOlig(it->second.getOlig());
olig.setFreq(it->second.getFreq());
olig.setOccurrences(it->second.getOccurrences());
olig.setExpFreq(scoreSeqMarkov(it->second.getOlig(), 2, matrix));
olig.setExpOcc(olig.getExpFreq() * T);
olig.setOccP(
binomialPValue(T, olig.getExpFreq(),
it->second.getOccurrences()));
olig.setOccE(
probOccBGreater(olig.getExpFreq(), T,
it->second.getOccurrences()));
olig.setOccSig(sigValue(olig.getOccE(), oligoLength));
calOlig.push_back(olig);
/*
cout << "Seq " << olig.getOlig().seq
<< " freq " << olig.getFreq()
<< " exp_freq " << olig.getExpFreq() << " occ "
<< olig.getOccurrences() << " exp_occ " << olig.getExpOcc()
<< " Binomial " << olig.getOccP() << " Occ_E " << olig.getOccE()
<< " sig " << olig.getOccSig() << endl;
*/
}
calOlig.sort(compareOccSig);
return calOlig;
}