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


C++ Spectrum::getMz方法代码示例

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


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

示例1: runSearch

// assumes at least one spectrum in allRefs
void SearchLibrary::runSearch(Spectrum& s)
{
    scoreMatches(s, cachedSpectra_, targetMatches_);
    scoreMatches(s, cachedDecoySpectra_, decoyMatches_);

    // keep scores from all target psms for estimating Weibull parameters
    vector<double> allScores;
    if(compute_pvalues_){
        for(size_t i=0; i < targetMatches_.size(); i++){
            double dotp = targetMatches_[i].getScore(DOTP);
            allScores.push_back(dotp);
        }
    }

    // there may have been spectra in cachedSpectra_ but none at the
    // correct charge state.  Check again
    if( targetMatches_.size() == 0 ){
        Verbosity::warn("No library spectra found for query %d "
                        "(precursor m/z %.2f).", s.getScanNumber(), s.getMz());
        return;
    }
    if( compute_pvalues_ ){
        addNullScores(s, allScores);
    }

    // sort the matches descending
    sort(targetMatches_.begin(), targetMatches_.end(), compMatchDotScore); 
    sort(decoyMatches_.begin(), decoyMatches_.end(), compMatchDotScore); 

    setRank();
    
    if( printAll_ ){
        cout << "spec " << s.getScanNumber() << endl;
    }

    if( compute_pvalues_ ){
        weibullEstimator_.estimateParams(allScores);
        
        // print params to file
        if( weibullParamFile_.is_open() ){
            weibullParamFile_ << s.getScanNumber() << "\t"
                              << weibullEstimator_.getEta() << "\t"
                              << weibullEstimator_.getBeta() << "\t"
                              << weibullEstimator_.getShift() << "\t"
                              << weibullEstimator_.getCorrelation() << "\t"
                              << weibullEstimator_.getNumPointsFit() 
                //(int)(allScores.size() * fraction_to_fit_)
                              << endl;
        }
        setMatchesPvalues(allScores.size());
    }
}
开发者ID:wolski,项目名称:bibliospec2.0,代码行数:53,代码来源:SearchLibrary.cpp

示例2: if

RefSpectrum::RefSpectrum(const Spectrum& s)
{
    length = 0;
    annot = -1;
    copies = 1;
    id = -1;
    //or could do data = s.data and then change type and peaks
    data.type = REFERENCE;
    data.scanNumber = s.getScanNum();
    data.mz = s.getMz();
    data.numPeaks = s.getNumPeaks();
    if(data.numPeaks)
        {
            data.peaks = new PEAK_T[data.numPeaks];  //add if(data.numPeaks?)
            s.getPeaks(data.peaks, data.numPeaks);
        }
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:17,代码来源:original-RefSpectrum.cpp

示例3: initLibraries

/**
 * Before searching each spectrum, set the appropriate precursor m/z
 * range and charge states.
 */
void SearchLibrary::initLibraries(Spectrum& querySpec){
    // TODO: for cache, set min as max(cacheMax, searchMin)
    //       max is still searchMax. charge is all charges
    // set the precursor m/z range  and charge states in each library
    double minMZ = querySpec.getMz() - mzWindow_;
    double maxMZ = querySpec.getMz() + mzWindow_;
    for(size_t i = 0; i < libraries_.size(); i++){
        LibReader* curLibrary = libraries_.at(i);

        curLibrary->setLowMZ(minMZ);
        curLibrary->setHighMZ(maxMZ);

        // set min and max charges to look for either by the query
        // charge or by the given parameters
        /* if( ignoreQueryCharge ){ ...use current else clause } else if*/
        //if( querySpec.sizeZ() == 1 ){
        const vector<int>& charges = querySpec.getPossibleCharges();
        if( charges.size() == 1 ){
            curLibrary->setCharge(charges.front());
        } else { // TODO instead use min and max charge of query as range
            curLibrary->setLowChg(minSpecCharge_);
            curLibrary->setHighChg(maxSpecCharge_);
            curLibrary->setCharge(-1); // hack to say there is no one
                                       // charge
        } /* else {

            int min = 100;
            int max = 0;
            for(i=0; i < querySpec.sizeZ(); i++){
            if( querySpec.atZ(i).z > max )
                max = querySpec.atZ(i).z; 
            }
            if( querySpec.atZ(i).z < min )
                min = querySpec.atZ(i).z; 
            }
            curLibrary->setLowChg(min);
            curLibrary->setHighChg(max);
        } */
    }
}
开发者ID:wolski,项目名称:bibliospec2.0,代码行数:44,代码来源:SearchLibrary.cpp

示例4:

 bool Spectrum::operator< (Spectrum otherSpec) {
     return data.mz < otherSpec.getMz();
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:3,代码来源:original-Spectrum.cpp


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