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