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


C++ SpectrumPtr::getMSScanType方法代码示例

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


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

示例1: test

void test(const string& rawpath)
{
    cout << "Testing " << rawpath << endl;
    MassHunterDataPtr dataReader = MassHunterData::create(rawpath);
    cout << dataReader->getDeviceType() << endl;
    cout << dataReader->getDeviceName(dataReader->getDeviceType()) << endl;
    cout << dataReader->getAcquisitionTime().to_string() << endl;
    cout << dataReader->getIonModes() << endl;
    cout << dataReader->getScanTypes() << endl;
    cout << dataReader->getSpectraFormat() << endl;
    cout << dataReader->getTotalScansPresent() << endl;

    if (dataReader->getTotalScansPresent() == 0)
        throw runtime_error("[MassHunterDataTest] No spectra detected in test data at: " + rawpath);

    SpectrumPtr s1 = dataReader->getProfileSpectrumByRow(0);
    cout << s1->getTotalDataPoints() << endl;
    automation_vector<double> masses;
    automation_vector<float> intensities;
    s1->getXArray(masses);
    s1->getYArray(intensities);
    if (!masses.empty())
        cout << "Masses (" << masses.size() << ") [" << masses.front() << "-" << masses.back() << "]" << endl;

    MSStorageMode storageMode = s1->getMSStorageMode();
    bool hasProfile = storageMode == MSStorageMode_ProfileSpectrum ||
                      storageMode == MSStorageMode_Mixed;
    cout << storageMode << endl;
    cout << hasProfile << endl;

    if (dataReader->getScanTypes() & MSScanType_ProductIon)
    {
        for (size_t i=0, end=dataReader->getTotalScansPresent(); i < end; ++i)
        {
            SpectrumPtr sMSMS;
            if (!hasProfile)
                sMSMS = dataReader->getPeakSpectrumByRow(i);
            else
                sMSMS = dataReader->getProfileSpectrumByRow(i);
            if (!(sMSMS->getMSScanType() & MSScanType_ProductIon))
                continue;

            if (sMSMS->getParentScanId() > 0)
            {
                cout << "ParentScanId " << sMSMS->getParentScanId() << flush;
                SpectrumPtr sParent = dataReader->getProfileSpectrumById(sMSMS->getParentScanId());
                cout << " (" << sParent->getTotalDataPoints() << ")" << endl;
            }

            std::vector<double> mzs;
            sMSMS->getPrecursorIons(mzs);
            if (!mzs.empty())
                cout << "PrecursorIons (" << mzs.size() << ") [" << mzs.front() << "]" << endl;
            break;
        }
    }

    ChromatogramPtr c1 = dataReader->getChromatogram(0, ChromatogramType_TotalIon);
    c1->getXArray(masses);
    c1->getYArray(intensities);
    if (!masses.empty())
        cout << "Times (" << masses.size() << ") [" << masses.front() << "-" << masses.back() << "]" << endl;
}
开发者ID:zjjyyang,项目名称:ftdr,代码行数:63,代码来源:MassHunterDataTest.cpp


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