Matrix Science header

ms_fragmentationrules.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_fragmentationrules.hpp                                            #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates a fragmentation_rules file (mascot configuration files)       #
00006 #                                                                            #
00007 ##############################################################################
00008 # COPYRIGHT NOTICE                                                           #
00009 # Copyright 1998-2006 Matrix Science Limited  All Rights Reserved.           #
00010 #                                                                            #
00011 ##############################################################################
00012 # @(#)$Source: /vol/cvsroot/parser/inc/ms_fragmentationrules.hpp,v $
00013 # @(#)$Revision: 1.26 $
00014 # @(#)$Date: 2017/05/18 14:50:40 $ 
00015 # @(#)$Author: davidc $ 
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_FRAGMENTATIONRULES_HPP
00020 #define MS_FRAGMENTATIONRULES_HPP
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 // for the sake of #include <string>
00039 #ifdef __ALPHA_UNIX__
00040 #include <ctype.h>
00041 #endif
00042 
00043 // Includes from the standard template library
00044 #include <vector>
00045 #include <string>
00046 
00047 
00048 namespace matrix_science {
00054     class ms_filesource;
00055 
00057 
00075     class MS_MASCOTRESFILE_API ms_fragmentationrules : public ms_customproperty
00076     {
00077         friend class ms_fragrulesfile;
00078     public:
00079 
00081 
00087         enum  FRAG_SERIES_TYPE
00088         {
00089             FRAG_IMMONIUM        = 4,  
00090             FRAG_A_SERIES        = 5,  
00091             FRAG_A_MINUS_NH3     = 6,  
00092             FRAG_A_MINUS_H2O     = 7,  
00093             FRAG_B_SERIES        = 8,  
00094             FRAG_B_MINUS_NH3     = 9,  
00095             FRAG_B_MINUS_H2O     = 10, 
00096             FRAG_C_SERIES        = 11, 
00097             FRAG_X_SERIES        = 12, 
00098             FRAG_Y_SERIES        = 13, 
00099             FRAG_Y_MINUS_NH3     = 14, 
00100             FRAG_Y_MINUS_H2O     = 15, 
00101             FRAG_Z_SERIES        = 16, 
00102             FRAG_INTERNAL_YB     = 17, 
00103             FRAG_INTERNAL_YA     = 18, 
00104             FRAG_Z_PLUS_1        = 21, 
00105             FRAG_D_SERIES        = 22, 
00106             FRAG_V_SERIES        = 23, 
00107             FRAG_W_SERIES        = 24, 
00108             FRAG_Z_PLUS_2        = 25  
00109         };
00110 
00112         ms_fragmentationrules();
00113 
00115         ms_fragmentationrules(const ms_fragmentationrules& src);
00116 
00118         ~ms_fragmentationrules();
00119 
00121         void defaultValues();
00122 
00124         void copyFrom(const ms_fragmentationrules* right);
00125 
00126 #ifndef SWIG
00127 
00128         ms_fragmentationrules& operator=(const ms_fragmentationrules& right);
00129 #endif
00130 
00131         std::string getTitle() const;
00132 
00134         void setTitle(const char * title);
00135 
00137         static int getFirstSeries();
00138 
00140         static int getFirstSerie();
00141 
00143         static int getLastSeries();
00144 
00146         static int getLastSerie();
00147 
00149         bool isSinglyCharged() const;
00150 
00152         void setSinglyCharged(const bool value);
00153 
00155         bool isCharged2Plus() const;
00156 
00158         void setCharged2Plus(const bool value);
00159 
00161         bool isCharged3Plus() const;
00162 
00164         void setCharged3Plus(const bool value);
00165 
00167         bool isSeriesUsed(const int series) const;
00168 
00170         void clearSeries();
00171 
00173         void setSeriesUsed(const int series, const bool val);
00174 
00176         bool isValid() const;
00177 
00179         bool verifyRule(ms_errs* err_, const bool tryToFix);
00180 
00182         static std::string getSeriesDescription(const int series);
00183 
00185         double getMinInternalMass() const;
00186 
00188         void setMinInternalMass(const double mass);
00189 
00191         double getMaxInternalMass() const;
00192 
00194         void setMaxInternalMass(const double mass);
00195 
00197         static std::string getSeriesName(const int series);
00198 
00200         static bool isBackboneSeries(const int series);
00201 
00203         static bool isNeutralLossSeries(const int series);
00204 
00206         bool anyNLseriesUsed(const int series) const;
00207 
00209         static int getTotalSeriesOutput();
00210 
00211 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00212 #include "suppress_ms_customproperty.hpp"
00213 #endif
00214 
00215     private:
00216         std::string title_;
00217         bool* which_series_;
00218         double minInternalMass_;
00219         double maxInternalMass_;
00220     }; // class ms_fragmentationrules
00221 
00223 
00228     class MS_MASCOTRESFILE_API ms_fragrulesfile: public ms_errors
00229     {
00230     public:
00232         ms_fragrulesfile();
00233         
00235         ms_fragrulesfile(const char* filename, const matrix_science::ms_connection_settings * cs = 0);
00236 
00238         ms_fragrulesfile(const ms_fragrulesfile& src);
00239 
00241         ~ms_fragrulesfile();
00242 
00244         void defaultValues();
00245 
00247         void copyFrom(const ms_fragrulesfile* right);
00248 
00249 #ifndef SWIG
00250 
00251         ms_fragrulesfile& operator=(const ms_fragrulesfile& right);
00252 #endif        
00253 
00254         void setFileName(const char* filename);
00255 
00257         std::string getFileName() const;
00258 
00260         void setConnectionSettings(const matrix_science::ms_connection_settings & cs);
00261 
00263         matrix_science::ms_connection_settings getConnectionSettings() const;
00264 
00266         void read_file();
00267 
00269         void read_buffer(const char * buffer);
00270 
00272         void save_file();
00273 
00275         int  getNumberOfInstruments() const;
00276 
00278         void clearInstruments();
00279 
00281         void appendInstrument(const ms_fragmentationrules* item);
00282 
00284         std::string getInstrumentName(const int instrumentNum) const;
00285 
00287         const ms_fragmentationrules* getInstrumentByName(const char * name) const;
00288 
00290         const ms_fragmentationrules* getInstrumentByNumber(const int instrumentNum) const;
00291 
00293         bool updateInstrumentByNumber(const int num, const ms_fragmentationrules item);
00294 
00296         bool updateInstrumentByName(const char* name, const ms_fragmentationrules item);
00297 
00299         bool deleteInstrumentByNumber(const int num);
00300 
00302         bool deleteInstrumentByName(const char* name);
00303 
00304     private:
00305         void read_filesource(ms_filesource & fsource);
00306 
00307         std::string filename_;
00308         std::vector< ms_fragmentationrules* > rules_;
00309         std::vector< std::string > comments_;
00310         ms_connection_settings cs_;
00311     }; // ms_fragrulesfile // end of config_group
00313 }   // matrix_science namespace
00314 
00315 #endif // MS_FRAGMENTATIONRULES_HPP
00316 
00317 /*------------------------------- End of File -------------------------------*/
00318 
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51