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: parser/inc/ms_fragmentvector.hpp $
00012 #    $Author: villek@matrixscience.com $ 
00013 #      $Date: 2018-07-30 16:23:53 +0100 $ 
00014 #  $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_8_1-0-gea32989045 $
00015 ##############################################################################
00016 */
00017 
00018 #if !defined(ms_fragmentvector_INCLUDED_)
00019 #define ms_fragmentvector_INCLUDED_
00020 
00021 
00022 // Includes from the standard template library
00023 #include <string>
00024 #include <set>
00025 #include <vector>
00026 #include <map>
00027 
00028 
00029 namespace matrix_science {
00030      class ms_mascotresfile;
00031 
00037 
00038 
00046     class MS_MASCOTRESFILE_API ms_fragmentvector
00047     {
00048     public:
00049 
00051 
00058         enum MATCH_PEAKS 
00059         { 
00060 
00061             MATCH_MOST_INTENSE_PEAK  = 0x0000, 
00062             MATCH_CLOSEST_PEAK       = 0x0001  
00063         };
00064 
00065         enum TOLERANCE_UNIT
00066         {
00067             TOLERANCE_DALTON,
00068             TOLERANCE_MMU,
00069             TOLERANCE_PERCENT,
00070             TOLERANCE_PPM
00071         };
00072 
00074         ms_fragmentvector();
00075 
00077         ms_fragmentvector(const ms_fragmentvector& src);
00078 
00080         virtual ~ms_fragmentvector();
00081 
00083         void copyFrom(const ms_fragmentvector* right);
00084 
00085 #ifndef SWIG
00086 
00087         ms_fragmentvector& operator=(const ms_fragmentvector& right);
00088 #endif
00089 
00090         int getNumberOfFragments() const;
00091 
00093         void clearFragments();
00094 
00096         void appendFragment(const ms_fragment * item);
00097 
00099         const ms_fragment * getFragmentByNumber(const unsigned int numFrag) const;
00100 
00101         typedef std::vector<ms_fragment> frag_vector;
00102 
00103 #if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
00104 
00105         frag_vector * getVector();
00106 #endif        
00107 
00108         const frag_vector * getVector() const;
00109 
00111         bool addExperimentalData(const std::string & peakList, 
00112                                  const int           numPeaks, 
00113                                  const double        tolerance, 
00114                                  const std::string & toleranceUnits,
00115                                  const bool          updateMatchList = true);
00116 
00118         bool addExperimentalData(const ms_mascotresfile * resfile,
00119                                  const int query,
00120                                  const int flags = MATCH_MOST_INTENSE_PEAK,
00121                                  const int peaksUsedFromIons1 = -1,
00122                                  const int peaksUsedFromIons2 = -1,
00123                                  const int peaksUsedFromIons3 = -1);
00124 
00125         typedef std::map<double, double> peaklist_t;  // Mass, intensity
00126 
00128         bool addExperimentalData(const peaklist_t &  peakList, 
00129                                  const double        tolerance, 
00130                                  const std::string & toleranceUnits,
00131                                  const bool          updateMatchList = true);
00132 
00134         static void getMassesWithinTolerance(const double & fragmentMass, const double & fragmentToleranceValue, const TOLERANCE_UNIT & fragmentToleranceUnit,
00135                                              double & minMass, double & maxMass);
00136         
00137     private:
00138         frag_vector  entries_;
00139         peaklist_t experimentalData_;
00140         void matchFragments();
00141         double   matchingTol_; 
00142         std::string matchingTolUnits_;
00143     }; // class ms_fragmentvector // end of mass_calculation_group
00145 } // matrix_science
00146 
00147 #endif // !defined(ms_fragmentvector_INCLUDED_)

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