Matrix Science header

ms_fragmentvector.hpp

00001 /*
00002 ##############################################################################
00003 # File: ms_fragmentvector.hpp                                                #
00004 # Mascot Parser toolkit                                                      #
00005 # Encapsulates a list (vector) of single fragment ions                       #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2006 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Source: /vol/cvsroot/parser/inc/ms_fragmentvector.hpp,v $
00012 #    $Author: francoisr $ 
00013 #      $Date: 2017/05/04 11:31:35 $ 
00014 #  $Revision: 1.8 $
00015 ##############################################################################
00016 */
00017 
00018 #if !defined(ms_fragmentvector_INCLUDED_)
00019 #define ms_fragmentvector_INCLUDED_
00020 
00021 #ifdef _WIN32
00022 #pragma warning(disable:4251)   // Don't want all classes to be exported
00023 #pragma warning(disable:4786)   // Debug symbols too long
00024 #   ifndef _MATRIX_USE_STATIC_LIB
00025 #       ifdef MS_MASCOTRESFILE_EXPORTS
00026 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00027 #       else
00028 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00029 #       endif
00030 #   else
00031 #       define MS_MASCOTRESFILE_API
00032 #   endif
00033 #else
00034 #   define MS_MASCOTRESFILE_API
00035 #endif
00036 
00037 // for the sake of #include <string>
00038 #ifdef __ALPHA_UNIX__
00039 #include <ctype.h>
00040 #endif
00041 
00042 // Includes from the standard template library
00043 #include <string>
00044 #include <set>
00045 #include <vector>
00046 #include <map>
00047 
00048 
00049 namespace matrix_science {
00050      class ms_mascotresfile;
00051 
00057 
00058 
00066     class MS_MASCOTRESFILE_API ms_fragmentvector
00067     {
00068     public:
00069 
00071 
00078         enum MATCH_PEAKS 
00079         { 
00080 
00081             MATCH_MOST_INTENSE_PEAK  = 0x0000, 
00082             MATCH_CLOSEST_PEAK       = 0x0001  
00083         };
00084 
00085         enum TOLERANCE_UNIT
00086         {
00087             TOLERANCE_DALTON,
00088             TOLERANCE_MMU,
00089             TOLERANCE_PERCENT,
00090             TOLERANCE_PPM
00091         };
00092 
00094         ms_fragmentvector();
00095 
00097         ms_fragmentvector(const ms_fragmentvector& src);
00098 
00100         virtual ~ms_fragmentvector();
00101 
00103         void copyFrom(const ms_fragmentvector* right);
00104 
00105 #ifndef SWIG
00106 
00107         ms_fragmentvector& operator=(const ms_fragmentvector& right);
00108 #endif
00109 
00110         int getNumberOfFragments() const;
00111 
00113         void clearFragments();
00114 
00116         void appendFragment(const ms_fragment * item);
00117 
00119         const ms_fragment * getFragmentByNumber(const unsigned int numFrag) const;
00120 
00121         typedef std::vector<ms_fragment> frag_vector;
00122 
00124         frag_vector * getVector();
00125         
00127         const frag_vector * getVector() const;
00128 
00130         bool addExperimentalData(const std::string & peakList, 
00131                                  const int           numPeaks, 
00132                                  const double        tolerance, 
00133                                  const std::string & toleranceUnits,
00134                                  const bool          updateMatchList = true);
00135 
00137         bool addExperimentalData(const ms_mascotresfile * resfile,
00138                                  const int query,
00139                                  const int flags = MATCH_MOST_INTENSE_PEAK,
00140                                  const int peaksUsedFromIons1 = -1,
00141                                  const int peaksUsedFromIons2 = -1,
00142                                  const int peaksUsedFromIons3 = -1);
00143 
00144         typedef std::map<double, double> peaklist_t;  // Mass, intensity
00145 
00147         bool addExperimentalData(const peaklist_t &  peakList, 
00148                                  const double        tolerance, 
00149                                  const std::string & toleranceUnits,
00150                                  const bool          updateMatchList = true);
00151 
00153         static void getMassesWithinTolerance(const double & fragmentMass, const double & fragmentToleranceValue, const TOLERANCE_UNIT & fragmentToleranceUnit,
00154                                              double & minMass, double & maxMass);
00155         
00156     private:
00157         frag_vector  entries_;
00158         peaklist_t experimentalData_;
00159         void matchFragments();
00160         double   matchingTol_; 
00161         std::string matchingTolUnits_;
00162     }; // class ms_fragmentvector // end of mass_calculation_group
00164 } // matrix_science
00165 
00166 #endif // !defined(ms_fragmentvector_INCLUDED_)
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51