本文整理汇总了C++中adcontrols::MassSpectrum::getMaxIntensity方法的典型用法代码示例。如果您正苦于以下问题:C++ MassSpectrum::getMaxIntensity方法的具体用法?C++ MassSpectrum::getMaxIntensity怎么用?C++ MassSpectrum::getMaxIntensity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类adcontrols::MassSpectrum
的用法示例。
在下文中一共展示了MassSpectrum::getMaxIntensity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calibrator
bool
DataprocHandler::doMSCalibration( adcontrols::MSCalibrateResult& res
, adcontrols::MassSpectrum& centroid
, const adcontrols::MSCalibrateMethod& m
, const adcontrols::MSAssignedMasses& assigned )
{
using adcontrols::MSProperty;
const double tolerance = m.massToleranceDa();
const double threshold = centroid.getMaxIntensity() * m.minimumRAPercent() / 100;
res.tolerance( tolerance ); // set tolerance in result
res.threshold( threshold ); // set threshold in result
std::map< size_t, size_t > mode_map;
for ( adcontrols::MSAssignedMasses::vector_type::const_iterator it = assigned.begin(); it != assigned.end(); ++it )
mode_map[ it->mode() ]++;
// std::map<size_t, size_t>::iterator itMax = std::max_element( mode_map.begin(), mode_map.end() );
// int mode = static_cast<int>(itMax->first);
mass_calibrator calibrator( assigned, centroid.getMSProperty() );
adcontrols::MSCalibration calib;
if ( ! calibrator.polfit( calib, m.polynomialDegree() + 1 ) )
return false;
res.references( m.references() );
res.calibration( calib );
centroid.setCalibration( calib, true ); // m/z assign based on manually determined peaks
// continue auto-assign
assign_masses assign( tolerance, threshold );
adcontrols::MSAssignedMasses assignedMasses;
adcontrols::segment_wrapper< adcontrols::MassSpectrum > segments( centroid );
for ( size_t n = 0; n < segments.size(); ++n ) {
assign( assignedMasses, segments[n], m.references(), 0, static_cast<int>(n) );
}
mass_calibrator calibrator2( assignedMasses, centroid.getMSProperty() );
if ( calibrator2.polfit( calib, m.polynomialDegree() + 1 ) ) {
for ( auto it: assignedMasses )
it.mass( calibrator2.compute_mass( it.time(), it.mode(), calib ) );
centroid.setCalibration( calib, true );
res.calibration( calib );
res.assignedMasses( assignedMasses );
return true;
}
return false;
}