Matrix Science header

ms_spectral_lib_peak_list.hpp

00001 /*
00002 ##############################################################################
00003 # File: ms_spectral_lib_peak_list.hpp                                        #
00004 # Mascot Parser toolkit                                                      #
00005 # Encapsulates peak lists for spectral library files (e.g. msp, sptext)      #
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_list.hpp,v $
00013 #    $Author: francoisr $ 
00014 #      $Date: 2017/05/04 11:31:35 $ 
00015 #  $Revision: 1.8 $
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_SPECTRAL_LIB_PEAK_LIST
00020 #define MS_SPECTRAL_LIB_PEAK_LIST
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 <vector>
00041 #include <map>
00042 #include <string>
00043 
00044 
00045 namespace matrix_science {
00046   
00052 
00053     class MS_MASCOTRESFILE_API ms_spectral_lib_peak_list : public ms_errors 
00054     {
00055     public:
00057 
00064         enum PEAK_ANNOTATION_LEVEL {
00065             ANNOT_LVL_NONE,             
00066             ANNOT_LVL_QUESTION_MARKS,   
00067             ANNOT_LVL_SOME_PEAKS,       
00068             ANNOT_LVL_CANNOT_ANNOTATE,  
00069         };
00071         ms_spectral_lib_peak_list();
00072         
00074         ~ms_spectral_lib_peak_list();
00075         
00077         ms_spectral_lib_peak_list(std::vector<std::string> input, ms_spectral_lib::FILE_FORMAT format);
00078 
00080         ms_spectral_lib_peak_list(const ms_spectral_lib_peak_list & src);
00081 
00083         void copyFrom(const ms_spectral_lib_peak_list* right);
00084 
00085 #ifndef SWIG
00086 
00087         ms_spectral_lib_peak_list& operator=(const ms_spectral_lib_peak_list& right);
00088 #endif
00089 
00090         int getNumPeaks() const;
00091 
00093         const ms_spectral_lib_peak * getPeak(const int pkNum) const;
00094         
00096         void addPeaks(const std::vector<double> &vecMz, const std::vector<double> &vecIntensity);
00097 
00099         void annotatePeaks(const ms_fragmentvector *fragments, const double fragmentToleranceValue, const std::string fragmentToleranceUnit, double precursorMz);
00100         
00101 #ifndef SWIG
00102 
00103         void annotatePeaks(const std::vector<ms_fragment> *fragments, const double fragmentToleranceValue, const std::string fragmentToleranceUnit, double precursorMz);
00104 #endif
00105 
00107         void clearAnnotation();
00108 
00110         PEAK_ANNOTATION_LEVEL getPeakAnnotationLevel() const;
00111 
00113         std::vector<std::string> asText(ms_spectral_lib::FILE_FORMAT format) const;
00114 
00116         std::string getChecksum() const;
00117 
00119         void setAnnotationLevel(PEAK_ANNOTATION_LEVEL level);
00120 
00121     private:
00122         void setAnnotationLevel(const ms_spectral_lib_peak & pk);
00123 
00124         std::vector<ms_spectral_lib_peak> peakList_;
00125         bool isConsensusSpectrum_;
00126         PEAK_ANNOTATION_LEVEL annotationLevel_;
00127         std::string checksum_;
00128     };
00129 
00130  // end of tools_group
00132 } // namespace matrix_science
00133 
00134 #endif // MS_SPECTRAL_LIB_PEAK_LIST
00135 
00136 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51