本文整理汇总了C++中PeakMap::getChromatogram方法的典型用法代码示例。如果您正苦于以下问题:C++ PeakMap::getChromatogram方法的具体用法?C++ PeakMap::getChromatogram怎么用?C++ PeakMap::getChromatogram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PeakMap
的用法示例。
在下文中一共展示了PeakMap::getChromatogram方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main_
ExitCodes main_(int, const char **)
{
//-------------------------------------------------------------
// parameter handling
//-------------------------------------------------------------
in = getStringOption_("in");
out = getStringOption_("out");
String process_option = getStringOption_("processOption");
Param filter_param = getParam_().copy("algorithm:", true);
writeDebug_("Parameters passed to filter", filter_param, 3);
SavitzkyGolayFilter sgolay;
sgolay.setLogType(log_type_);
sgolay.setParameters(filter_param);
if (process_option == "lowmemory")
{
return doLowMemAlgorithm(sgolay);
}
//-------------------------------------------------------------
// loading input
//-------------------------------------------------------------
MzMLFile mz_data_file;
mz_data_file.setLogType(log_type_);
PeakMap exp;
mz_data_file.load(in, exp);
if (exp.empty() && exp.getChromatograms().size() == 0)
{
LOG_WARN << "The given file does not contain any conventional peak data, but might"
" contain chromatograms. This tool currently cannot handle them, sorry.";
return INCOMPATIBLE_INPUT_DATA;
}
//check for peak type (profile data required)
if (!exp.empty() && PeakTypeEstimator().estimateType(exp[0].begin(), exp[0].end()) == SpectrumSettings::PEAKS)
{
writeLog_("Warning: OpenMS peak type estimation indicates that this is not profile data!");
}
//check if spectra are sorted
for (Size i = 0; i < exp.size(); ++i)
{
if (!exp[i].isSorted())
{
writeLog_("Error: Not all spectra are sorted according to peak m/z positions. Use FileFilter to sort the input!");
return INCOMPATIBLE_INPUT_DATA;
}
}
//check if chromatograms are sorted
for (Size i = 0; i < exp.getChromatograms().size(); ++i)
{
if (!exp.getChromatogram(i).isSorted())
{
writeLog_("Error: Not all chromatograms are sorted according to peak m/z positions. Use FileFilter to sort the input!");
return INCOMPATIBLE_INPUT_DATA;
}
}
//-------------------------------------------------------------
// calculations
//-------------------------------------------------------------
sgolay.filterExperiment(exp);
//-------------------------------------------------------------
// writing output
//-------------------------------------------------------------
//annotate output with data processing info
addDataProcessing_(exp, getProcessingInfo_(DataProcessing::SMOOTHING));
mz_data_file.store(out, exp);
return EXECUTION_OK;
}