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


C++ DNA::addSeq方法代码示例

本文整理汇总了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;
}
开发者ID:jcvitorino,项目名称:repositorio,代码行数:66,代码来源:OligoAnalisys.cpp


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