Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
void
MSLockDialog::setContents( const adcontrols::MSLockMethod& cm )
{
    if ( auto table = findChild< MolTable * >() )
        table->setContents( cm.molecules() );

    if ( auto form = findChild< MSLockForm * >() )
        form->setContents( cm );
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
bool
MSLockDialog::getContents( adcontrols::MSLockMethod& cm ) const
{
    if ( auto form = findChild< MSLockForm * >() ) {
        if ( form->getContents( cm ) ) {
            if ( auto table = findChild< MolTable * >() ) 
                table->getContents( cm.molecules() );
            return true;
        }
    }
    return false;
}
Exemplo n.º 5
0
bool
MSLockForm::getContents( adcontrols::MSLockMethod& m )
{
    m.setEnabled( ui->groupBox->isChecked() );
    if ( ui->radioButtonDa->isChecked() )
        m.setToleranceMethod( adcontrols::idToleranceDaltons );
    else
        m.setToleranceMethod( adcontrols::idTolerancePpm );

    m.setTolerance( adcontrols::idToleranceDaltons, ui->doubleSpinBoxDa->value() );
    m.setTolerance( adcontrols::idTolerancePpm, ui->doubleSpinBoxPpm->value() );

    m.setAlgorithm( ui->radioButtonAlgo0->isChecked() ? adcontrols::idFindLargest : adcontrols::idFindClosest );
    m.setPeakIntensityThreshold( ui->doubleSpinBoxThreshold->value() );
    m.setEnablePeakThreshold( ui->checkBoxThreshold->isChecked() );

    return true;
}
Exemplo n.º 6
0
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;
}