本文整理汇总了C++中Samples::estimatedAlleleFrequencies方法的典型用法代码示例。如果您正苦于以下问题:C++ Samples::estimatedAlleleFrequencies方法的具体用法?C++ Samples::estimatedAlleleFrequencies怎么用?C++ Samples::estimatedAlleleFrequencies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Samples
的用法示例。
在下文中一共展示了Samples::estimatedAlleleFrequencies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
DEBUG("no alternate genotype alleles passed filters at " << parser->currentSequenceName << ":" << parser->currentPosition);
continue;
}
DEBUG("genotype alleles: " << genotypeAlleles);
// add the null genotype
bool usingNull = false;
if (parameters.excludeUnobservedGenotypes && genotypeAlleles.size() > 2) {
genotypeAlleles.push_back(nullAllele);
usingNull = true;
}
++processed_sites;
// generate possible genotypes
// for each possible ploidy in the dataset, generate all possible genotypes
vector<int> ploidies = parser->currentPloidies(samples);
map<int, vector<Genotype> > genotypesByPloidy = getGenotypesByPloidy(ploidies, genotypeAlleles);
int numCopiesOfLocus = parser->copiesOfLocus(samples);
DEBUG2("generated all possible genotypes:");
if (parameters.debug2) {
for (map<int, vector<Genotype> >::iterator s = genotypesByPloidy.begin(); s != genotypesByPloidy.end(); ++s) {
vector<Genotype>& genotypes = s->second;
for (vector<Genotype>::iterator g = genotypes.begin(); g != genotypes.end(); ++g) {
DEBUG2(*g);
}
}
}
// get estimated allele frequencies using sum of estimated qualities
map<string, double> estimatedAlleleFrequencies = samples.estimatedAlleleFrequencies();
double estimatedMaxAlleleFrequency = 0;
double estimatedMaxAlleleCount = 0;
double estimatedMajorFrequency = estimatedAlleleFrequencies[referenceBase];
if (estimatedMajorFrequency < 0.5) estimatedMajorFrequency = 1-estimatedMajorFrequency;
double estimatedMinorFrequency = 1-estimatedMajorFrequency;
//cerr << "num copies of locus " << numCopiesOfLocus << endl;
int estimatedMinorAllelesAtLocus = max(1, (int) ceil((double) numCopiesOfLocus * estimatedMinorFrequency));
//cerr << "estimated minor frequency " << estimatedMinorFrequency << endl;
//cerr << "estimated minor count " << estimatedMinorAllelesAtLocus << endl;
Results results;
map<string, vector<vector<SampleDataLikelihood> > > sampleDataLikelihoodsByPopulation;
map<string, vector<vector<SampleDataLikelihood> > > variantSampleDataLikelihoodsByPopulation;
map<string, vector<vector<SampleDataLikelihood> > > invariantSampleDataLikelihoodsByPopulation;
map<string, int> inputAlleleCounts;
int inputLikelihoodCount = 0;
DEBUG2("calculating data likelihoods");
// calculate data likelihoods
//for (Samples::iterator s = samples.begin(); s != samples.end(); ++s) {
for (vector<string>::iterator n = parser->sampleList.begin(); n != parser->sampleList.end(); ++n) {
//string sampleName = s->first;
string& sampleName = *n;
//DEBUG2("sample: " << sampleName);
//Sample& sample = s->second;
if (samples.find(sampleName) == samples.end()
&& !(parser->hasInputVariantAllelesAtCurrentPosition()
|| parameters.reportMonomorphic)) {
continue;