Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

LCElutionPeak.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Florian Zeller $
00032 // $Authors: Lukas Mueller, Markus Mueller $
00033 // --------------------------------------------------------------------------
00034 //
00036 //
00037 //  PEAK DETECTION OF FOURIER TRANSFORME MS INSTRUMENT DATA
00038 //
00039 //  written by Markus Mueller, markus.mueller@imsb.biol.ethz.ch
00040 //  and Lukas Mueller, Lukas.Mueller@imsb.biol.ethz.ch
00041 //  October 2005
00042 //
00043 //  Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
00044 //  December 2010
00045 //
00046 //  Group of Prof. Ruedi Aebersold, IMSB, ETH Hoenggerberg, Zurich
00047 //
00048 //
00049 
00050 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCELUTIONPEAK_H
00051 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCELUTIONPEAK_H
00052 
00053 #include <vector>
00054 #include <map>
00055 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/ConsensusIsotopePattern.h>
00056 
00057 namespace OpenMS
00058 {
00059 
00060   typedef std::multimap<int, MSPeak> elution_peak;
00061   typedef std::vector<elution_peak> MZ_series;
00062   typedef std::vector<elution_peak>::iterator MZ_series_ITERATOR;
00063   typedef std::multimap<int, MSPeak>::iterator SIGNAL_iterator;
00064 
00065   class OPENMS_DLLAPI LCElutionPeak
00066   {
00067 
00069     // declaration of the private members:
00070 
00071 private:
00072 
00073     // isotopic pattern:
00074     ConsensusIsotopePattern * isotopePattern;
00075     int fNrIsotopes;
00076     double f_observed_Mass;
00077     double fIsotopMass;
00078 
00079 protected:
00080 
00081     double fMonoMass;
00082     double fVolume;
00083     int fCharge;
00084     int fScanNumberStart;
00085     int fScanNumberApex;
00086     int fScanNumberEnd;
00087     double fapex_intensity;
00088     double fRT;
00089     double fStartTR;
00090     double fEndTR;
00091     double fpeak_area;
00092     double fSignalToNoise;
00093     double fSNIntensityThreshold;
00094     MSPeak * APEX;
00095 
00096     std::string elutionPeakExtraInfo;
00097 
00098     // the raw signals assigned to this peak
00099     std::multimap<int, MSPeak> intens_signals;
00100     //multimap<int, MSPeak> raw_intens_signals;
00101     std::multimap<int, int> CHRG_MAP;
00102 
00104     // declaration of the public members:
00105 
00106 public:
00107 
00108     // parameters to debug a ceratain mass range
00109     static double DEBUG_MASS_START;
00110     static double DEBUG_MASS_END;
00111 
00112     // cut off, where everything small than this precentile of the
00113     // apex is discarded
00114     // static float intensity_apex_percentil_cutoff;
00115 
00116     // resolution of the retention time, for peak area copmuting:
00117     //  static float TR_RESOLUTION;
00118 
00119     // class destructor
00120     ~LCElutionPeak();
00121 
00122     // class constructor
00123     LCElutionPeak();
00124     // class constructor
00125     LCElutionPeak(MZ_series_ITERATOR, double);
00126     // class copy constructor
00127     LCElutionPeak(const LCElutionPeak &);
00128     // constructor for the object feature:
00129     LCElutionPeak(const LCElutionPeak *);
00130 
00132     // Analyze the LC elution peak
00133     void analyzeLCElutionPeak()
00134     {
00135 
00136       if (get_nb_ms_peaks() > 1)
00137       {
00138 
00139         CHRG_MAP.clear();
00140 
00141         // determine the intensity background baseline based on S/N
00142         // value:
00143         setSNIntensityThreshold();
00144 
00145         // Compute a varietiy of parameters for the LC elution peak
00146         computeLCElutionPeakParameters();
00147 
00148         // define parameters such as chrg, score
00149         compute_CHRG();
00150 
00151         // create the consensus pattern:
00152         createConsensIsotopPattern();
00153       }
00154       else
00155       {
00156         defineLCElutionPeakParametersFromMSPeak();
00157       }
00158     }
00159 
00161     // determine the intensity background baseline based on S/N
00162     // value:
00163     void setSNIntensityThreshold();
00164 
00166     // Compute a varietiy of parameters for the LC elution peak
00167     void computeLCElutionPeakParameters();
00168 
00169     // removes background peaks and computes the total peak area:
00170     // void compute_LC_peak_area();
00171     // computes the area of between 2 peaks:
00172     double compute_delta_area(double, double, double, double);
00173     // define the apex into the elution profile::
00174     // void define_apex();
00175     // removes peaks which have lower intensity than x percentile
00176     // of the apex:
00177     void remove_background_peak();
00178     // compute the charge state of the LC peak
00179     void compute_CHRG();
00180     // compute the score of the LC peak:
00181     //void compute_SCORE_and_SN();
00182     // define all required peak parameters from a single MS peak:
00183     void defineLCElutionPeakParametersFromMSPeak();
00185 
00187     // print all monositopic peak cluster along the LC profile:
00188     void createConsensIsotopPattern();
00189 
00190     // print the elution profile from a peak:
00191     void print_profile(std::ofstream *);
00192     // find the closest existing mz peak in the elution profile:
00193     MSPeak * find_true_peak(float);
00194     // print the elution profile from a peak:
00195     void show_info();
00196 
00198     // overload operators:
00199     LCElutionPeak & operator=(const LCElutionPeak &);
00200     LCElutionPeak & operator<=(const LCElutionPeak &);
00201     LCElutionPeak & operator>=(const LCElutionPeak &);
00202     LCElutionPeak & operator<(const LCElutionPeak &);
00203     LCElutionPeak & operator>(const LCElutionPeak &);
00204 
00206     // print all monositopic peak cluster along the LC profile:
00207     //void printIsotopClusters();
00208     // print the consensus isotope pattern:
00209     //void printConsensIsotopPattern();
00210 
00211     void setElutionPeakExtraInfo(std::string in)
00212     {
00213       elutionPeakExtraInfo = in;
00214     }
00215 
00216     std::string getElutionPeakExtraInfo()
00217     {
00218       return elutionPeakExtraInfo;
00219     }
00220 
00222     // start here all the get / set
00223     // function to access the
00224     // variables of the class
00225 
00227     // access signal_intens map:
00228     SIGNAL_iterator get_signal_list_start()
00229     {
00230       return intens_signals.begin();
00231     }
00232 
00233     SIGNAL_iterator get_signal_list_end()
00234     {
00235       return intens_signals.end();
00236     }
00237 
00239     // access the raw signal intens map:
00240     //SIGNAL_iterator get_raw_signal_list_start(){return raw_intens_signals.begin();};
00241     //SIGNAL_iterator get_raw_signal_list_end(){return raw_intens_signals.end();};
00242 
00243     // update the retention time by the current tmp_scan_apex:
00244     void set_apex_retention_time(double IN)
00245     {
00246       fRT = IN;
00247     }
00248 
00249     // to update the list of score and charge state:
00250     void update_CHRGMAP(MSPeak * IN)
00251     {
00252       std::multimap<int, int>::iterator T = CHRG_MAP.find(IN->get_charge_state());
00253       if (T == CHRG_MAP.end())
00254       {
00255         CHRG_MAP.insert(std::make_pair(IN->get_charge_state(), 1));
00256       }
00257       else
00258       {
00259         (*T).second++;
00260       }
00261     }
00262 
00264     // get scan apex:
00265     int get_scan_apex()
00266     {
00267       return fScanNumberApex;
00268     }
00269 
00270     double get_apex_intensity()
00271     {
00272       return fapex_intensity;
00273     }
00274 
00275     double get_apex_retention_time()
00276     {
00277       return fRT;
00278     }
00279 
00280     double get_apex_MZ()
00281     {
00282       return get_MZ(get_scan_apex());
00283     }
00284 
00286     // get an intensity of a ms_peak
00287     float get_intensity(int IN)
00288     {
00289       return (*(intens_signals.find(IN))).second.get_intensity();
00290     }
00291 
00292     // get the original M/Z of a ms_peak
00293     double get_MZ(int);
00294 
00296     // get the total peak area:
00297     double get_total_peak_area()
00298     {
00299       return fpeak_area;
00300     }
00301 
00303     // get start / end scan:
00304     int get_start_scan()
00305     {
00306       return fScanNumberStart;
00307     }
00308 
00309     int get_end_scan()
00310     {
00311       return fScanNumberEnd;
00312     }
00313 
00314     void set_start_retention_time(double IN)
00315     {
00316       fStartTR = IN;
00317     }
00318 
00319     double get_start_retention_time()
00320     {
00321       return fStartTR;
00322     }
00323 
00324     void set_end_retention_time(double IN)
00325     {
00326       fEndTR = IN;
00327     }
00328 
00329     double get_end_retention_time()
00330     {
00331       return fEndTR;
00332     }
00333 
00335     // get number of peaks in the elution profile:
00336     int get_nb_ms_peaks()
00337     {
00338       return (int) intens_signals.size();
00339     }
00340 
00342     // access teh charge state of the LC elutino peak:
00343     int get_charge_state()
00344     {
00345       return fCharge;
00346     }
00347 
00349     // get signal to noise ratio:
00350     double getSignalToNoise()
00351     {
00352       return fSignalToNoise;
00353     }
00354 
00355     double getSignalToNoiseBackground()
00356     {
00357       return fSNIntensityThreshold;
00358     }
00359 
00360   };
00361 
00362 } // ns
00363 
00364 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCELUTIONPEAK_H

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:40 using doxygen 1.7.1