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


C++ Samples::find方法代码示例

本文整理汇总了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
开发者ID:a113n,项目名称:freebayes,代码行数:67,代码来源:freebayes.cpp


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