本文整理汇总了C++中adcontrols::MassSpectrum::calibration方法的典型用法代码示例。如果您正苦于以下问题:C++ MassSpectrum::calibration方法的具体用法?C++ MassSpectrum::calibration怎么用?C++ MassSpectrum::calibration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类adcontrols::MassSpectrum
的用法示例。
在下文中一共展示了MassSpectrum::calibration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assigner
bool
DataprocHandler::doMSCalibration( adcontrols::MSCalibrateResult& res
, adcontrols::MassSpectrum& centroid
, const adcontrols::MSCalibrateMethod& m )
{
using adcontrols::MSProperty;
res.calibration( centroid.calibration() );
res.references( m.references() );
double tolerance = m.massToleranceDa();
double threshold = adcontrols::segments_helper::max_intensity( centroid ) * m.minimumRAPercent() / 100;
res.tolerance( tolerance );
res.threshold( threshold );
assign_masses assigner( tolerance, threshold );
adcontrols::MSAssignedMasses assignedMasses;
adcontrols::segment_wrapper< adcontrols::MassSpectrum > segments( centroid );
int n = 0;
for ( auto seg: segments )
assigner( assignedMasses, seg, res.references(), seg.mode(), n++ );
res.assignedMasses( assignedMasses ); // set peak assign result
// annotate each peak on spectrum
doAnnotateAssignedPeaks( centroid, assignedMasses );
mass_calibrator calibrator( assignedMasses, centroid.getMSProperty() );
adcontrols::MSCalibration calib;
if ( calibrator.polfit( calib, m.polynomialDegree() + 1 ) ) {
for ( auto it: assignedMasses ) {
double mass = calibrator.compute_mass( it.time(), it.mode(), calib );
it.mass( mass );
}
res.calibration( calib );
// res.assignedMasses( assignedMasses );
#if defined _DEBUG && 0
calibresult_validation( res, centroid, threshold );
#endif
return true;
}
return false;
}