bool QuanSampleProcessor::doMSLock( adcontrols::MSPeakInfo& pkInfo // will override , adcontrols::MassSpectrum& centroid // will override , const adcontrols::MSLockMethod& m , const adcontrols::QuanCompounds& compounds ) { // find reference peak by mass window adcontrols::lockmass::mslock mslock; // TODO: consider how to handle segmented spectrum -- current impl is always process first adcontrols::MSFinder find( m.tolerance( m.toleranceMethod() ), m.algorithm(), m.toleranceMethod() ); for ( auto& compound : compounds ) { if ( compound.isLKMSRef() ) { double exactMass = cformula_->getMonoIsotopicMass( compound.formula() ); size_t idx = find( centroid, exactMass ); if ( idx != adcontrols::MSFinder::npos ) { // add found peaks into mslock mslock << adcontrols::lockmass::reference( compound.formula(), exactMass, centroid.getMass( idx ), centroid.getTime( idx ) ); } } } if ( mslock.fit() ) { mslock( centroid, true ); mslock( pkInfo, true ); return true; } return false; }
bool MSChromatogramExtractor::impl::doMSLock( adcontrols::lockmass::mslock& mslock , const adcontrols::MassSpectrum& centroid , const adcontrols::MSLockMethod& m ) { // TODO: consider how to handle segmented spectrum -- current impl is always process first adcontrols::MSFinder find( m.tolerance( m.toleranceMethod() ), m.algorithm(), m.toleranceMethod() ); for ( auto& msref : msrefs_ ) { size_t idx = find( centroid, msref.second ); if ( idx != adcontrols::MSFinder::npos ) mslock << adcontrols::lockmass::reference( msref.first, msref.second, centroid.getMass( idx ), centroid.getTime( idx ) ); } if ( mslock.fit() ) { // mslock( centroid, true ); return true; } return false; }
bool MSLockForm::setContents( const adcontrols::MSLockMethod& m ) { setChecked( m.enabled() ); if ( m.toleranceMethod() == adcontrols::idToleranceDaltons ) { ui->radioButtonDa->setChecked( true ); } else { ui->radioButtonPpm->setChecked( true ); } ui->doubleSpinBoxDa->setValue( m.tolerance( adcontrols::idToleranceDaltons ) ); ui->doubleSpinBoxPpm->setValue( m.tolerance( adcontrols::idTolerancePpm ) ); if ( m.algorithm() == adcontrols::idFindLargest ) ui->radioButtonAlgo0->setChecked( true ); else ui->radioButtonAlgo1->setChecked( true ); ui->checkBoxThreshold->setChecked( m.enablePeakThreshold() ); ui->doubleSpinBoxThreshold->setValue( m.peakIntensityThreshold() ); return true; }