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: /vol/cvsroot/parser/inc/ms_spectral_lib_peak.hpp,v $
00013 #    $Author: davidc $ 
00014 #      $Date: 2017/05/03 15:56:59 $ 
00015 #  $Revision: 1.7 $
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_SPECTRAL_LIB_PEAK
00020 #define MS_SPECTRAL_LIB_PEAK
00021 
00022 #ifdef _WIN32
00023 #pragma warning(disable:4251)   // Don't want all classes to be exported
00024 #pragma warning(disable:4786)   // Debug symbols too long
00025 #   ifndef _MATRIX_USE_STATIC_LIB
00026 #       ifdef MS_MASCOTRESFILE_EXPORTS
00027 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00028 #       else
00029 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00030 #       endif
00031 #   else
00032 #       define MS_MASCOTRESFILE_API
00033 #   endif
00034 #else
00035 #   define MS_MASCOTRESFILE_API
00036 #endif
00037 
00038 // Includes from the standard template library
00039 
00040 #include <map>
00041 #include <string>
00042 
00043 
00044 namespace matrix_science {
00045   
00055     namespace ms_spectral_lib {
00063         enum FILE_FORMAT {
00064             FORMAT_UNKNOWN,   
00065             FORMAT_NIST_MSP,  
00066             FORMAT_SPECTRAST, 
00067             FORMAT_MGF,       
00068             FORMAT_XHUNTER    
00069         };
00070     };
00071 
00073     class MS_MASCOTRESFILE_API ms_spectral_lib_peak : public ms_errors 
00074     {
00075     public:
00077         ms_spectral_lib_peak(const std::string & text, ms_spectral_lib::FILE_FORMAT format);
00078 
00080         ms_spectral_lib_peak(const double mz, 
00081                              const double intensity, 
00082                              const std::string & annotation, 
00083                              ms_spectral_lib::FILE_FORMAT format);
00084 
00086         ms_spectral_lib_peak(const ms_spectral_lib_peak & src);
00087 
00089         void copyFrom(const ms_spectral_lib_peak* right);
00090 
00091 #ifndef SWIG
00092 
00093         ms_spectral_lib_peak& operator=(const ms_spectral_lib_peak& right);
00094 #endif
00095 
00097         double getMz() const;
00098 
00100         double getIntensity() const;
00101 
00103         std::string getAnnotation(ms_spectral_lib::FILE_FORMAT format = ms_spectral_lib::FORMAT_NIST_MSP) const;
00104 
00106         void setAnnotation(const std::string & annotation, ms_spectral_lib::FILE_FORMAT format);
00107 
00109         void clearAnnotation();
00110 
00112         double getDelta() const;
00113 
00115         bool isMatchedToCalculatedPeak() const;
00116 
00118         bool isSuspectAssignment() const;
00119 
00121         bool getConsensusData(int * numerator, int * denominator, double * medianDeviation) const;
00122 
00124         std::string asText(ms_spectral_lib::FILE_FORMAT format) const;
00125 
00127         static std::string getUnmatchedAnnotationStr(ms_spectral_lib::FILE_FORMAT format);
00128 
00129 
00130     private:
00131         double          mz_;
00132         double          intensity_;
00133         std::string     mzText_;
00134         std::string     intensityText_;
00135         std::string     annotation_;
00136         ms_spectral_lib::FILE_FORMAT  currAnnotationFormat_;
00137         double          delta_;
00138         bool            consensusDataAvailable_;
00139         int             consensusNumerator_;
00140         int             consensusDenominator_;
00141         double          medianDeviationOfConsensusPeaks_;
00142     };
00143 
00144  // end of tools_group
00146 } // namespace matrix_science
00147 
00148 #endif // MS_SPECTRAL_LIB_PEAK
00149 
00150 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51