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

SHFeature.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 //  written by Lukas N Mueller, 30.3.05
00038 //  Lukas.Mueller@imsb.biol.ethz.ch
00039 //  Group of Prof. Ruedi Aebersold, IMSB, ETH Hoenggerberg, Zurich
00040 //
00041 //  Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
00042 //  December 2010
00043 //
00044 
00045 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_SHFEATURE_H
00046 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_SHFEATURE_H
00047 
00048 namespace OpenMS
00049 {
00050 
00051   class OPENMS_DLLAPI SHFeature
00052   {
00053 
00055     // declaration of the private members:
00056 
00057 private:
00058 
00060     // IDENTIFICATION PARAMETERS:
00061     // name of the spectra:
00062     std::map<double, std::vector<MS2Info> > MS2_SCANS;
00064 
00066     // raw MS peak paramaters:
00067     int scan_apex;
00068     int scan_start;
00069     int scan_end;
00070     double total_peak_area;
00071     double apex_peak_intensity;
00072     double PEAK_SCORE;
00073     double SignalToNoise;
00074     double BackgroundNoise;
00075 
00077     // Analysis parameters:
00078     double alignment_error_up;
00079     double alignment_error_down;
00080     double SCORE_HOLDER;
00081     bool feature_match_status;
00082     double PI;
00083 
00085     // LC/MS run ID parameters:
00086     int spectrum_ID;
00087     int MASTER_ID;
00088 
00090     // string to store ms1 feature extra information:
00091     std::string featureExtraInformation;
00092 
00094     // LC elution profile:
00095     FeatureLCProfile * LCprofile;
00096 
00097     // static values:
00098     static double _MONO_H;
00099     static double _MONO_O;
00100 
00102     // LC/MS matching things:
00103     std::map<int, SHFeature> matched_feature_list;
00104 
00105     // ranges of m/z and tr:
00106     double TR_APEX;
00107     double MONO_MZ_START;
00108     double MONO_MZ_END;
00109     double MONO_MZ_ORIGINAL;
00110 
00112     // associated MS2 feature:
00113     MS2Feature * MS2TraceFeature;
00114 
00116     // declaration of the public members:
00117 
00118 public:
00119 
00120     double TR;
00121     double MONO_MZ;
00122     double TR_START;
00123     double TR_END;
00124     int charge_state;
00125     int feature_ID;
00126 
00127     // class destructor
00128     ~SHFeature();
00129 
00130     // copy constructor:
00131     SHFeature(const SHFeature &);
00132 
00133     // class constructor
00134     SHFeature(const SHFeature *);
00135     // constructor for the object SHFeature:
00136     SHFeature(double, double, int, int, int, int, float, float, float);
00137     // constructor for the object SHFeature:
00138     SHFeature(float, int, int);
00139     SHFeature(MS2Feature *);
00140     SHFeature();
00141     // copy constructor:
00142     SHFeature & operator=(const SHFeature &);
00143 
00144     // show the content of the spectra
00145     void show_info();
00146     // show MS/MS spectra info:
00147     void showMS2consensSpectraInfo();
00148 
00150     // comparision operators:
00151     bool operator==(const SHFeature &);
00152 
00153     // add MS/MS info to the SHFeature:
00154     void add_MS2_info(MS2Info *);
00155     void add_MS2_info(std::map<double, std::vector<MS2Info> > *);
00156     bool get_MS2_info();
00157     bool get_MS2_info(double);
00158 
00159     bool check_MS2_empty()
00160     {
00161       return MS2_SCANS.empty();
00162     }
00163 
00164     void removeAllMS2Information()
00165     {
00166       return MS2_SCANS.clear();
00167     }
00168 
00169     int get_MS2_SCANS_SIZE()
00170     {
00171       return (int) MS2_SCANS.size();
00172     }
00173 
00174     std::map<double, std::vector<MS2Info> > * get_MS2_SCAN_MAP()
00175     {
00176       return &MS2_SCANS;
00177     }
00178 
00179     std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCANS_START()
00180     {   return MS2_SCANS.begin(); }
00181     std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCANS_END()
00182     {   return MS2_SCANS.end(); }
00183     // get the best ms2 scan == closest to the apex:
00184     MS2Info * get_best_MS2_SCAN();
00185     MS2Info * get_best_MS2_SCAN(double);
00186 
00187     void setFeatureExtraInformation(std::string in)
00188     {   featureExtraInformation = in; }
00189     std::string getFeatureExtraInformation()
00190     {   return featureExtraInformation; }
00191 
00192     // functions to set/access machted features:
00193     void add_matched_feature(SHFeature *);
00194     std::map<int, SHFeature> * get_match_list_REFERENCE()
00195     {   return &matched_feature_list; }
00196     std::map<int, SHFeature> get_match_list()
00197     {   return matched_feature_list; }
00198     std::map<int, SHFeature>::iterator get_match_list_start()
00199     {   return matched_feature_list.begin(); }
00200     std::map<int, SHFeature>::iterator get_match_list_end()
00201     {   return matched_feature_list.end(); }
00202     std::map<int, SHFeature>::iterator find_match_by_id(int ID)
00203     {   return matched_feature_list.find(ID); }
00204 
00205     // get feature at a certain LC-MS by LC_MS id
00206     SHFeature * get_feature(int);
00207 
00208     // get the total peak are over all matched features:
00209     double get_MATCHED_peak_area();
00210     bool check_match_by_id(int);
00211     void erase_match_list()
00212     {   matched_feature_list.clear(); }
00213     // get the profile over all matched features:
00214     std::map<int, double> get_feature_profile();
00215 
00216     // return number of times this feature has been seen = nb_replicates in list plus 1!
00217     int get_replicate_match_nb()
00218     {   return (int) (matched_feature_list.size() + 1); }
00219     int get_matching_nb()
00220     {   return get_replicate_match_nb(); }
00221     // return the sum of all intensities over replicates:
00222     double get_replicate_intensity_sum();
00223 
00225     // start here all the get / set
00226     // function to access the
00227     // variables of the class
00228 
00229     // access the parent mass of feature, calculated from the SQ
00230     double get_MZ()
00231     {   return MONO_MZ; }
00232     void set_MZ(double in)
00233     {   MONO_MZ = in; }
00234     double get_MZ_START()
00235     {   return MONO_MZ_START; }
00236     void set_MZ_START(double IN)
00237     {   MONO_MZ_START = IN; }
00238     double get_MZ_END()
00239     {   return MONO_MZ_END; }
00240     void set_MZ_END(double IN)
00241     {   MONO_MZ_END = IN; }
00242 
00243     double get_THEO_MZ()
00244     {   return get_best_MS2_SCAN()->get_MONO_MZ(); }
00245     double get_THEO_MZ(double T)
00246     {   return get_best_MS2_SCAN(T)->get_MONO_MZ(); }
00247     std::string get_AC()
00248     {   return get_best_MS2_SCAN()->get_AC(); }
00249     std::string get_AC(double T)
00250     {   return get_best_MS2_SCAN(T)->get_AC(); }
00251     bool check_AC(std::string IN)
00252     {   return get_best_MS2_SCAN()->compare_AC(IN); }
00253     bool check_AC(std::string IN, double T)
00254     {   return get_best_MS2_SCAN(T)->compare_AC(IN); }
00255     std::string get_SQ()
00256     {   return get_best_MS2_SCAN()->get_SQ(); }
00257     std::string get_SQ(double T)
00258     {   return get_best_MS2_SCAN(T)->get_SQ(); }
00259     std::string get_TOTAL_SQ()
00260     {   return get_best_MS2_SCAN()->get_TOTAL_SQ(); }
00261     std::string get_TOTAL_SQ(double T)
00262     {   return get_best_MS2_SCAN(T)->get_TOTAL_SQ(); }
00263     std::string get_MOD_SQ()
00264     {   return get_best_MS2_SCAN()->get_MOD_SQ(); }
00265     std::string get_MOD_SQ(double T)
00266     {   return get_best_MS2_SCAN(T)->get_MOD_SQ(); }
00267     double get_pep_prob()
00268     {   return get_best_MS2_SCAN()->get_PEP_PROB(); }
00269     double get_pep_prob(double T)
00270     {   return get_best_MS2_SCAN(T)->get_PEP_PROB(); }
00271     std::string get_MS2_TYPE_TAG()
00272     {   return get_best_MS2_SCAN()->get_MS2_TYPE_TAG(); }
00273     std::string get_MS2_TYPE_TAG(double T)
00274     {   return get_best_MS2_SCAN(T)->get_MS2_TYPE_TAG(); }
00275     int get_MS2_scan()
00276     {   return get_best_MS2_SCAN()->get_SCAN_START(); }
00277     int get_MS2_scan(double T)
00278     {   return get_best_MS2_SCAN(T)->get_SCAN_START(); }
00279     std::map<double, std::vector<MS2Info> > * get_MS2_SCAN_LIST()
00280     {   return &(MS2_SCANS); }
00281     std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCAN_LIST_START()
00282     {   return MS2_SCANS.begin(); }
00283     std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCAN_LIST_END()
00284     {   return MS2_SCANS.end(); }
00285 
00286     int get_scan_number()
00287     {   return scan_apex; }
00288     void set_scan_number(int IN)
00289     {   scan_apex = IN; }
00290     int get_scan_start()
00291     {   return scan_start; }
00292     void set_scan_start(int IN)
00293     {   scan_start = IN; }
00294     int get_scan_end()
00295     {   return scan_end; }
00296     void set_scan_end(int IN)
00297     {   scan_end = IN; }
00298     int get_charge_state()
00299     {   return charge_state; }
00300     void set_charge_state(int IN)
00301     {   charge_state = IN; }
00302     void set_peak_area(float IN)
00303     {   total_peak_area = IN; }
00304     double get_peak_area()
00305     {   return total_peak_area; }
00306     // get peak area at a certain LC/MS:
00307     double get_peak_area(int);
00308     double get_apex_peak_intensity()
00309     {   return apex_peak_intensity; }
00310     void set_apex_peak_intensity(double in)
00311     {   apex_peak_intensity = in; }
00312     void normalize_peak_area_by_factor(double factor)
00313     {   total_peak_area *= factor; }
00314 
00315     double get_alignment_error_up()
00316     {   return alignment_error_up; }
00317     void set_alignment_error_up(double IN)
00318     {   alignment_error_up = IN; }
00319     double get_alignment_error_down()
00320     {   return alignment_error_down; }
00321     void set_alignment_error_down(double IN)
00322     {   alignment_error_down = IN; }
00323 
00324     void set_SCORE_HOLDER(double IN)
00325     {   SCORE_HOLDER = IN; }
00326     double get_SCORE_HOLDER()
00327     {   return SCORE_HOLDER; }
00328 
00329     double get_retention_time()
00330     {   return TR; }
00331     void set_retention_time(double IN)
00332     {   TR = IN; }
00333     double get_retention_time_START()
00334     {   return TR_START; }
00335     void set_retention_time_START(double IN)
00336     {   TR_START = IN; }
00337     double get_retention_time_END()
00338     {   return TR_END; }
00339     void set_retention_time_END(double IN)
00340     {   TR_END = IN; }
00341 
00342     // original mz and Tr coordinates
00343     double get_raw_retention_time_apex()
00344     {   return TR_APEX; }
00345     void set_raw_retention_time_apex(double IN)
00346     {   TR_APEX = IN; }
00347     double get_raw_MZ()
00348     {   return MONO_MZ_ORIGINAL; }
00349     void set_raw_MZ(double IN)
00350     {   MONO_MZ_ORIGINAL = IN; }
00351 
00352     // feature ID:
00353     void set_feature_ID(int IN)
00354     {   feature_ID = IN; }
00355     int get_feature_ID()
00356     {   return feature_ID; }
00357 
00358     void set_spectrum_ID(int IN)
00359     {
00360       spectrum_ID = IN;
00361       /*
00362        if( MS2TraceFeature != NULL){
00363        MS2TraceFeature.set
00364        }
00365        */
00366     }
00367 
00368     int get_spectrum_ID()
00369     {   return spectrum_ID; }
00370 
00371     void set_MASTER_ID(int IN)
00372     {   MASTER_ID = IN; }
00373     int get_MASTER_ID()
00374     {   return MASTER_ID; }
00375 
00376     // check how many matches
00377     int get_nb_common_match();
00378 
00379     // get/set the peak score
00380     double get_peak_score()
00381     {   return PEAK_SCORE; }
00382     void set_peak_score(double in)
00383     {   PEAK_SCORE = in; }
00384 
00385     // get the molecular mass of the corrsponding peptide!
00386     double get_Molecular_Mass();
00387 
00388     // fetaure PI:
00389     double get_FEATURE_PI()
00390     {   return PI; }
00391     void set_FEATURE_PI(double IN)
00392     {   PI = IN; }
00393 
00394     // check charge states, in cases where a feature was
00395     // created based on a MS2 trace, charge state is unknown ( = -1 )
00396     // -> derivce the charge state from the matched feature (if this is
00397     // also not -1
00398     void deriveChargeStates(SHFeature *);
00399 
00400     // LC elution profile
00401     void setLCelutionProfile(FeatureLCProfile * IN)
00402     {   LCprofile = IN; }
00403     FeatureLCProfile * getLCelutionProfile()
00404     {   return LCprofile; }
00405 
00407     // parameters computed over matched features:
00408     double get_profile_retention_time();
00409     double get_profile_Molecular_Mass();
00410 
00412     // status if feature has been matched:
00413     bool get_feature_match_status()
00414     {   return feature_match_status; }
00415     void set_feature_match_status(bool IN)
00416     {   feature_match_status = IN; }
00417 
00419     // access the MS2 feature
00420     void addMS2Feature(MS2Feature * in)
00421     {   MS2TraceFeature = new MS2Feature(in); }
00422     void removeMS2Feature()
00423     {   delete MS2TraceFeature; MS2TraceFeature = NULL; }
00424     MS2Feature * getMS2Feature()
00425     {   return MS2TraceFeature; }
00426 
00427     double getSignalToNoise()
00428     {   return SignalToNoise; }
00429     void setSignalToNoise(double in)
00430     {   SignalToNoise = in; }
00431 
00432     double getBackgroundNoiseLevel()
00433     {   return BackgroundNoise; }
00434     void setBackgroundNoiseLevel(double in)
00435     {   BackgroundNoise = in; }
00436 
00438     // get static members:
00439     //static double get_MZ_TOL(){return MZ_TOL;};
00440     static double get_MONO_H()
00441     {   return _MONO_H; }
00442 
00443     // compare to masses at the PPM value and decided
00444     // if they fall into the m/z tolerance window
00445     static bool compareFeatureMassValuesAtPPMLevel(double, double);
00446 
00447     // get the masse error at the PPM value
00448     static double getFeatureMassErrorAtPPMLevel(double);
00449 
00450   };
00451 
00452 } // ns
00453 
00454 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_SHFEATURE_H

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