Matrix Science header

ms_spectral_lib_peak.hpp

00001 /*
00002 ##############################################################################
00003 # File: ms_spectral_lib_peak_list.hpp                                        #
00004 # Mascot Parser toolkit                                                      #
00005 # Encapsulates a single peak plus annotations for spectral library files     #
00006 #                                                                            #
00007 ##############################################################################
00008 # COPYRIGHT NOTICE                                                           #
00009 # Copyright 2015 Matrix Science Limited  All Rights Reserved.                #
00010 #                                                                            #
00011 ##############################################################################
00012 #    $Source: parser/inc/ms_spectral_lib_peak.hpp $
00013 #    $Author: dcreasy@matrixscience.com $ 
00014 #      $Date: 2019-01-09 17:36:22 +0000 $ 
00015 #  $Revision: 8cb0d9cae7732a8c4def8cb60456be4a3be7a559 | MSPARSER_REL_2_8_1-0-gea32989045 $
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_SPECTRAL_LIB_PEAK
00020 #define MS_SPECTRAL_LIB_PEAK
00021 
00022 
00023 // Includes from the standard template library
00024 
00025 #include <map>
00026 #include <string>
00027 
00028 
00029 namespace matrix_science {
00030   
00040     namespace ms_spectral_lib {
00048         enum FILE_FORMAT {
00049             FORMAT_UNKNOWN,   
00050             FORMAT_NIST_MSP,  
00051             FORMAT_SPECTRAST, 
00052             FORMAT_MGF,       
00053             FORMAT_XHUNTER    
00054         };
00055     };
00056 
00058     class MS_MASCOTRESFILE_API ms_spectral_lib_peak
00059     {
00060     public:
00062         ms_spectral_lib_peak(const std::string & text, 
00063                              ms_spectral_lib::FILE_FORMAT format,
00064                              matrix_science::ms_errs & errs);
00065 
00067         ms_spectral_lib_peak(const double mz, 
00068                              const double intensity, 
00069                              const std::string & annotation, 
00070                              ms_spectral_lib::FILE_FORMAT format);
00071 
00073         ms_spectral_lib_peak(const ms_spectral_lib_peak & src);
00074 
00076         void copyFrom(const ms_spectral_lib_peak* right);
00077 
00078 #ifndef SWIG
00079 
00080         ms_spectral_lib_peak& operator=(const ms_spectral_lib_peak& right);
00081 #endif
00082 
00084         double getMz() const;
00085 
00087         double getIntensity() const;
00088 
00090         std::string getAnnotation(ms_spectral_lib::FILE_FORMAT format = ms_spectral_lib::FORMAT_NIST_MSP) const;
00091 
00093         void setAnnotation(const std::string & annotation, ms_spectral_lib::FILE_FORMAT format);
00094 
00096         void clearAnnotation();
00097 
00099         double getDelta() const;
00100 
00102         bool isMatchedToCalculatedPeak() const;
00103 
00105         bool isSuspectAssignment() const;
00106 
00108         bool getConsensusData(int * numerator, int * denominator, double * medianDeviation) const;
00109 
00111         std::string asText(ms_spectral_lib::FILE_FORMAT format) const;
00112 
00114         bool isValid() const;
00115 
00117         static std::string getUnmatchedAnnotationStr(ms_spectral_lib::FILE_FORMAT format);
00118 
00119 
00120     private:
00121         bool            valid_;
00122         double          mz_;
00123         double          intensity_;
00124         std::string     mzText_;
00125         std::string     intensityText_;
00126         std::string     annotation_;
00127         ms_spectral_lib::FILE_FORMAT  currAnnotationFormat_;
00128         double          delta_;
00129         bool            consensusDataAvailable_;
00130         int             consensusNumerator_;
00131         int             consensusDenominator_;
00132         double          medianDeviationOfConsensusPeaks_;
00133     };
00134 
00135  // end of tools_group
00137 } // namespace matrix_science
00138 
00139 #endif // MS_SPECTRAL_LIB_PEAK
00140 
00141 /*------------------------------- End of File -------------------------------*/

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:30