本文整理汇总了C++中Samples::find方法的典型用法代码示例。如果您正苦于以下问题:C++ Samples::find方法的具体用法?C++ Samples::find怎么用?C++ Samples::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Samples
的用法示例。
在下文中一共展示了Samples::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
}
// 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;
}
Sample& sample = samples[sampleName];
vector<Genotype>& genotypes = genotypesByPloidy[parser->currentSamplePloidy(sampleName)];
vector<Genotype*> genotypesWithObs;
for (vector<Genotype>::iterator g = genotypes.begin(); g != genotypes.end(); ++g) {
if (parameters.excludePartiallyObservedGenotypes) {
if (g->sampleHasSupportingObservationsForAllAlleles(sample)) {
genotypesWithObs.push_back(&*g);
}
} else if (parameters.excludeUnobservedGenotypes && usingNull) {
if (g->sampleHasSupportingObservations(sample)) {
//cerr << sampleName << " has suppporting obs for " << *g << endl;
genotypesWithObs.push_back(&*g);
} else if (g->hasNullAllele() && g->homozygous) {
// this genotype will never be added if we are running in observed-only mode, but
// we still need it for consistency
genotypesWithObs.push_back(&*g);
}
} else {
genotypesWithObs.push_back(&*g);
}
}
// skip this sample if we have no observations supporting any of the genotypes we are going to evaluate
if (genotypesWithObs.empty()) {
continue;
}
vector<pair<Genotype*, long double> > probs