Matrix Science header

ms_inputquery.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_inputquery.hpp                                                    #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates a query from the mascot results file                          #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2002 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /MowseBranches/ms_mascotresfile_1.2/include/ms_inputquery. $ #
00012 #     $Author: villek $ #
00013 #       $Date: 2016/07/12 13:41:33 $ #
00014 #   $Revision: 1.18 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_INPUTQUERY_HPP
00020 #define MS_INPUTQUERY_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 #include <string>
00039 
00040 namespace matrix_science {
00041 
00047 
00048 
00053     class MS_MASCOTRESFILE_API ms_inputquery  
00054     {
00055     public:
00056 
00058         ms_inputquery(const ms_mascotresfile &resfile, const int q);
00059         ~ms_inputquery();
00060 
00062         std::string getStringTitle(bool unescaped) const;
00063 
00065         std::string getCharge() const;
00066 
00068         std::string getSeq(int seq_no)   const;
00069 
00071         std::string getComp(int comp_no) const;
00072 
00074         std::string getTag(int tag_no) const;
00075 
00077         double getMassMin() const;
00078 
00080         double getMassMax() const;
00081 
00083         int getNumVals()    const;
00084 
00086         int getNumUsed()    const;
00087 
00089         std::string getStringIons1();
00090        
00092         std::string getStringIons2();
00093 
00095         std::string getStringIons3();
00096 
00098         double getIntMax() const;
00099 
00101         double getIntMin() const;
00102 
00104         std::vector<std::pair<double,double> > getPeakList(const int ions);
00105 
00107         double getPeakMass(const int ions, const int peakNo);
00108 
00110         double getPeakIntensity(const int ions, const int peakNo);
00111 
00113         int    getNumberOfPeaks(const int ions);
00114 
00116         double getTotalIonsIntensity();
00117 
00119         double getPepTol() const;
00120 
00122         std::string getPepTolUnits() const;
00123 
00125         std::string getPepTolString() const;
00126 
00128         std::string getINSTRUMENT(const bool unescaped = true) const;
00129 
00131         std::string getRULES() const;
00132 
00134         double getMinInternalMass() const;
00135 
00137         double getMaxInternalMass() const;
00138 
00140         std::string getIT_MODS(const bool unescaped = true) const;
00141 
00143         int getNumberOfLocalVarMods() const;
00144 
00146         std::string getLocalVarModName(const int num) const;
00147 
00149         std::string getScanNumbers(const int rawFileIdx = -1) const;
00150 
00152         void getScanNumbers(std::vector<int> &index, std::vector<std::string> &scans) const;
00153 
00155         std::string getRawScans(const int rawFileIdx = -1) const;
00156 
00158         void getRawScans(std::vector<int> &index, std::vector<std::string> &rawscans) const;
00159 
00161         std::string getRetentionTimes(const int rawFileIdx = -1) const;
00162 
00164         void getRetentionTimes(std::vector<int> &index, std::vector<std::string> &times) const;
00165 
00167         std::string getRawfile() const;
00168 
00170         std::string getLocus() const;
00171 
00173         int getIndex() const;
00174 
00175 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00176         static std::vector<std::string> splitIT_MODS(std::string itmods);
00177 #endif
00178 
00179     private:
00180         enum { max_seqs_  = 20, max_comps_ = 20, max_tags_ = 20 };
00181         const ms_mascotresfile &resfile_;
00182         const int q_;
00183 
00184         mutable bool has_title_;
00185         mutable std::string title_;
00186         mutable std::string unescapedTitle_;
00187 
00188         mutable bool has_charge_;
00189         mutable std::string charge_;
00190 
00191         mutable bool has_seq_;
00192         mutable std::string seq_[max_seqs_   +1]; 
00193 
00194         mutable bool has_comp_;
00195         mutable std::string comp_[max_comps_ +1];
00196 
00197         mutable bool has_tag_;
00198         mutable std::string tag_[max_tags_ + 1];
00199 
00200         mutable bool has_mass_min_;
00201         mutable double mass_min_;
00202 
00203         mutable bool has_mass_max_;
00204         mutable double mass_max_;
00205 
00206         mutable bool has_num_vals_;
00207         mutable int num_vals_;
00208 
00209         mutable bool has_num_used_;
00210         mutable int num_used_;
00211 
00212         bool has_ions_;
00213         std::string ions_[3];
00214         std::vector<std::pair<double,double> > peakList_[3];  // for ions1, 2 and 3
00215 
00216         mutable bool has_int_max_;
00217         mutable double int_max_;
00218 
00219         mutable bool has_int_min_;
00220         mutable double int_min_;
00221 
00222         mutable bool has_tol_;
00223         mutable double tol_;
00224         mutable std::string tol_units_;
00225 
00226         mutable bool has_instrument_;
00227         mutable std::string instrument_;
00228         mutable std::string unescaped_instrument_;
00229 
00230         mutable bool has_rules_;
00231         mutable std::string rules_;
00232 
00233         mutable bool has_internalMasses_;
00234         mutable double minInternalMass_;
00235         mutable double maxInternalMass_;
00236 
00237         mutable bool has_it_mods_;
00238         mutable std::string it_mods_;
00239         mutable std::string unescaped_it_mods_;
00240         mutable std::vector<std::string> local_modtitles_;
00241 
00242         ms_umod_configfile umodfile_;
00243 
00244         mutable bool has_rt_;
00245         mutable std::vector<int> rtIndices_;
00246         mutable std::vector<std::string> rtValues_;
00247 
00248         mutable bool has_scans_;
00249         mutable std::vector<int> scansIndices_;
00250         mutable std::vector<std::string> scansValues_;
00251 
00252         mutable bool has_rawscans_;
00253         mutable std::vector<int> rawscansIndices_;
00254         mutable std::vector<std::string> rawscansValues_;
00255 
00256         mutable bool has_rawfile_;
00257         mutable std::string rawfile_;
00258 
00259         mutable bool has_locus_;
00260         mutable std::string locus_;
00261 
00262         mutable bool has_index_;
00263         mutable int index_;
00264 
00265         void fillPeakList(const int ions);
00266         void loadIons();
00267         void retrieveAllValuesOf(const std::string &prefix, std::vector<int> &index, std::vector<std::string> &values) const;
00268     }; // end of resfile_group
00270 }   // matrix_science namespace
00271 
00272 #endif // !defined(MS_INPUTQUERY_HPP)
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51