Exemple #1
0
////////////////////////////////////////////////////////////////////////////////
// print all monositopic peak cluster along the LC profile:
  void LCElutionPeak::createConsensIsotopPattern()
  {

    //////////////
    // go through the different isotopes and
    // constructe a consensus patterns:
    isotopePattern = new ConsensusIsotopePattern();

    multimap<int, MSPeak>::iterator R = intens_signals.begin();
    while (R != intens_signals.end())
    {

      MSPeak * peak = &(*R).second;
      // map<double, double> isotopeCluster; // unused variable

      vector<CentroidPeak>::iterator p = peak->get_isotopic_peaks_start();
      while (p != peak->get_isotopic_peaks_end())
      {
        isotopePattern->addIsotopeTrace((*p).getMass(), (*p).getFittedIntensity());
        ++p;
      }

      ++R;
    }

    // create the pattern:
    isotopePattern->constructConsusPattern();

  }
////////////////////////////////////////////////////////
// function to add the elution profile to the feature:
  void FTPeakDetectController::addLCelutionProfile(SHFeature * inF, LCElutionPeak * PEAK)
  {

    ////////////////////////////////
    // get parameters of the peak:
    // apex:
    int apex_scan = PEAK->get_scan_apex();
    double apex_MZ = PEAK->get_apex_MZ();
    double apex_TR = PEAK->get_apex_retention_time();
    float apex_Intensity = (float) PEAK->get_apex_intensity();

    // peak shape:
    float peak_area = (float) PEAK->get_total_peak_area();
    int charge_state = PEAK->get_charge_state();

    // create the class:
    FeatureLCProfile * myProfile = new FeatureLCProfile(apex_MZ, apex_TR, apex_Intensity, apex_scan, charge_state,
                                                        peak_area);

    // add the raw individual mono isotopic peaks peaks:
    SIGNAL_iterator P = PEAK->get_signal_list_start();
    while (P != PEAK->get_signal_list_end())
    {

      MSPeak * MSpeak = &(*P).second;
      myProfile->addMS1elutionSignal(MSpeak->get_MZ(), MSpeak->get_intensity(), MSpeak->get_scan_number(),
                                     MSpeak->get_charge_state(), MSpeak->get_retention_time());
      P++;

    }

    inF->setLCelutionProfile(myProfile);

    myProfile = NULL;
  }
Exemple #3
0
//////////////////////////////////////////////////////////////////
// determine the intensity background baseline based on S/N
// value:
  void LCElutionPeak::setSNIntensityThreshold()
  {

    fSignalToNoise = 0;
    fSNIntensityThreshold = 0;

    double TotArea = 0;
    SIGNAL_iterator P = get_signal_list_start();
    while (P != get_signal_list_end())
    {
      MSPeak * peak = &(P->second);
      fSignalToNoise += peak->getSignalToNoise() * peak->get_intensity();
      fSNIntensityThreshold += peak->get_intensity() * (peak->get_intensity() / peak->getSignalToNoise());
      TotArea += peak->get_intensity();
      P++;
    }

    // set the signal to noise:
    fSignalToNoise /= TotArea;
    // set the noise threshold:
    fSNIntensityThreshold /= TotArea;

  }
Exemple #4
0
//////////////////////////////////////////////////////////////////
// Compute a varietiy of parameters for the LC elution peak
  void LCElutionPeak::computeLCElutionPeakParameters()
  {

    double TOT_AREA = 0;
    double apexScan = 0;
    double apexTr = 0;
    MSPeak * endPeak = NULL;
    MSPeak * startPeak = NULL;

    // find the first peaks above the background intensity:
    SIGNAL_iterator P = get_signal_list_start();
    fScanNumberStart = (*P).second.get_scan_number();
    fStartTR = (*P).second.get_retention_time();

    // set start et first scan in the LC_peak:
    while (P != get_signal_list_end())
    {
      if ((*P).second.get_intensity() >= fSNIntensityThreshold)
      {
        break;
      }
      P++;
    }

    // FLO: On windows, there is an error when we try to de-reference P when
    // P refers to get_signal_list_end() - the case is quite obvious when we
    // see that P is incremented afterwards. Without knowing I just introduce
    // a check whether P is equal to get_signal_list_end().
    if (P != get_signal_list_end())
    {
      startPeak = &((*P).second);

      // to compute some other parameters at the same time:
      update_CHRGMAP(&(*P).second);

      P++;
    }

    // go through all peaks in the LC elution profile:
    while (P != get_signal_list_end())
    {

      if ((*P).second.get_intensity() >= fSNIntensityThreshold)
      {
        if (startPeak != NULL)
        {
          endPeak = &((*P).second);
        }
        else
        {
          startPeak = &((*P).second);
        }
      }
      else
      {
        endPeak = NULL;
        startPeak = NULL;
      }

      if ((endPeak != NULL) && (startPeak != NULL))
      {

        // to compute some other parameters at the same time:
        update_CHRGMAP(endPeak);

        ///////////////////////////////////////////////////
        // compute an area between local start / end ms peak:
        double area = compute_delta_area(startPeak->get_retention_time(),
                                         startPeak->get_intensity() - fSNIntensityThreshold, endPeak->get_retention_time(),
                                         endPeak->get_intensity() - fSNIntensityThreshold);

        TOT_AREA += area;
        apexScan += (double) (P->first) * area;
        apexTr += startPeak->get_retention_time() * area;

        // next scan:
        startPeak = endPeak;
      }

      P++;
    }

    // if contained only one peak!
    if (get_nb_ms_peaks() == 1)
    {
      TOT_AREA = startPeak->get_intensity();
      fScanNumberEnd = fScanNumberStart;
      fEndTR = startPeak->get_retention_time();
    }
    else
    {

      P--;
      fScanNumberEnd = (*P).second.get_scan_number();
      fEndTR = (*P).second.get_retention_time();
      fpeak_area = TOT_AREA;
      apexScan /= TOT_AREA;
      apexTr /= TOT_AREA;
      fRT = apexTr;
    }

    // set the apex ms peak:
    MSPeak * APEX = find_true_peak((float) apexScan); // TODO : this may be a bug, maybe this should not declare a new APEX
    if (!APEX->getExtraPeakInfo().empty())
    {
      setElutionPeakExtraInfo(APEX->getExtraPeakInfo());
    }

    // find retention time and intensity of apex:
    fScanNumberApex = APEX->get_scan_number();
    fapex_intensity = APEX->get_intensity();

  }