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


C++ Allele::getCount方法代码示例

本文整理汇总了C++中Allele::getCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Allele::getCount方法的具体用法?C++ Allele::getCount怎么用?C++ Allele::getCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Allele的用法示例。


在下文中一共展示了Allele::getCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

std::vector<Location> Caller::callPoissonDist( double poissonLambda, int minQScore)
{
	std::vector<Location> newCandidateLocations;
	std::unordered_map<std::string, Location>::iterator iter;
	std::string altBase;
	for( iter = locationTable.begin(); iter != locationTable.end(); ++iter)
	{
		Location newLocation = iter->second;

		// Clear the Sample list of the copy of the location
		newLocation.clearSamples();
		bool keepLocation = false;

		std::vector<Sample> sampleList = ( iter->second).getSamples();
		for( int i = 0; i < sampleList.size(); i++)
		{
			ReadcountEntry readcountEntry = sampleList[i].getReadcountEntry();
			Allele mostFreqVariantAllele = readcountEntry.getMostFreqVariantAllele();

			int mostFreqNonRefCount = mostFreqVariantAllele.getCount();
			double lambda = readcountEntry.getReadDepth() * poissonLambda;

			// call illuminaPoissonFilter
			double pValue = Filter::illuminaPoissonFilter( mostFreqNonRefCount, lambda);
			double qScore = -10 * std::log10( pValue);

			// if at least one Sample passes through the filter, keep the location
			if( qScore > minQScore)
			{
				//mostFreqVariantAllele.setPValue( pValue);
				//mostFreqVariantAllele.setQScore( qScore);

				// Add only the called Samples to the emptied list
				newLocation.addSample( sampleList[i]);
				keepLocation = true;
			}
		}

		std::vector<Sample> newSamples = newLocation.getSamples();
		double highestVAP = -1;
		for( int i = 0; i < newSamples.size(); i++)
		{
			ReadcountEntry readcountEntry = newSamples[i].getReadcountEntry();
			Allele variantAllele = readcountEntry.getMostFreqVariantAllele();

			if( variantAllele.getPercentage() > highestVAP)
			{
				highestVAP = variantAllele.getPercentage();
				altBase = variantAllele.getBase();
			}
		}

		( iter->second).setMutatedBase( altBase);
		if( keepLocation)
		{
			newCandidateLocations.push_back( newLocation);
		}
	}
	return newCandidateLocations;
}
开发者ID:sfu-compbio,项目名称:sinvict,代码行数:60,代码来源:Caller.cpp


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