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: dcreasy@matrixscience.com $ #
00013 #       $Date: 2019-11-07 13:48:45 +0000 $ #
00014 #   $Revision: aae33ae602127b2f755e8fa9c5d9391218d406e4 | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_INPUTQUERY_HPP
00020 #define MS_INPUTQUERY_HPP
00021 
00022 
00023 #include <string>
00024 
00025 namespace matrix_science {
00026 
00032 
00033 
00038     class MS_MASCOTRESFILE_API ms_inputquery  
00039     {
00040     public:
00041 
00043         ms_inputquery(const ms_mascotresfile &resfile, const int q);
00044         ~ms_inputquery();
00045 
00046 #ifndef SWIGCSHARP
00047 
00048         std::string getStringTitle(bool unescaped) const;
00049 #else
00050         std::wstring getStringTitle(bool unescaped) const
00051         {
00052             return getStringTitleWide(unescaped);
00053         };
00054 #endif
00055 
00056         std::string getCharge() const;
00057 
00059         std::string getSeq(int seq_no)   const;
00060 
00062         std::string getComp(int comp_no) const;
00063 
00065         std::string getTag(int tag_no) const;
00066 
00068         double getMassMin() const;
00069 
00071         double getMassMax() const;
00072 
00074         double getIonMobility() const;
00075 
00077         int getNumVals()    const;
00078 
00080         int getNumUsed()    const;
00081 
00083         std::string getStringIons1(bool includeCharges = false);
00084        
00086         std::string getStringIons2(bool includeCharges = false);
00087 
00089         std::string getStringIons3(bool includeCharges = false);
00090 
00092         double getIntMax() const;
00093 
00095         double getIntMin() const;
00096 
00098         std::vector<std::pair<double,double> > getPeakList(const int ions);
00099 
00101         double getPeakMass(const int ions, const int peakNo);
00102 
00104         double getPeakIntensity(const int ions, const int peakNo);
00105 
00107         int    getNumberOfPeaks(const int ions);
00108 
00110         double getTotalIonsIntensity();
00111 
00113         double getPepTol() const;
00114 
00116         std::string getPepTolUnits() const;
00117 
00119         std::string getPepTolString() const;
00120 
00122         std::string getINSTRUMENT(const bool unescaped = true) const;
00123 
00125         std::string getRULES() const;
00126 
00128         double getMinInternalMass() const;
00129 
00131         double getMaxInternalMass() const;
00132 
00134         std::string getIT_MODS(const bool unescaped = true) const;
00135 
00137         int getNumberOfLocalVarMods() const;
00138 
00140         std::string getLocalVarModName(const int num) const;
00141 
00143         std::string getScanNumbers(const int rawFileIdx = -1) const;
00144 
00146         void getScanNumbers(std::vector<int> &index, std::vector<std::string> &scans) const;
00147 
00149         std::string getRawScans(const int rawFileIdx = -1) const;
00150 
00152         void getRawScans(std::vector<int> &index, std::vector<std::string> &rawscans) const;
00153 
00155         std::string getRetentionTimes(const int rawFileIdx = -1) const;
00156 
00158         void getRetentionTimes(std::vector<int> &index, std::vector<std::string> &times) const;
00159 
00161         std::string getRawfile() const;
00162 
00164         std::string getLocus() const;
00165 
00167         int getIndex() const;
00168 
00169 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00170         static std::vector<std::string> splitIT_MODS(std::string itmods);
00171 #endif
00172 
00173     private:
00174         enum { max_seqs_  = 20, max_comps_ = 20, max_tags_ = 20 };
00175         const ms_mascotresfile &resfile_;
00176         const int q_;
00177 
00178         mutable bool has_title_;
00179         mutable std::string title_;
00180         mutable std::string unescapedTitle_;
00181 
00182         mutable bool has_charge_;
00183         mutable std::string charge_;
00184 
00185         mutable bool has_seq_;
00186         mutable std::string seq_[max_seqs_   +1]; 
00187 
00188         mutable bool has_comp_;
00189         mutable std::string comp_[max_comps_ +1];
00190 
00191         mutable bool has_tag_;
00192         mutable std::string tag_[max_tags_ + 1];
00193 
00194         mutable bool has_mass_min_;
00195         mutable double mass_min_;
00196 
00197         mutable bool has_mass_max_;
00198         mutable double mass_max_;
00199 
00200         mutable bool has_ion_mobility_;
00201         mutable double ion_mobility_;
00202 
00203         mutable bool has_num_vals_;
00204         mutable int num_vals_;
00205 
00206         mutable bool has_num_used_;
00207         mutable int num_used_;
00208 
00209         bool has_ions_;
00210         std::string ions_[3], ionsCharges_[3];
00211         std::vector<std::pair<double,double> > peakList_[3];  // for ions1, 2 and 3
00212         std::vector<std::string> peakListCharges_[3];  // Also for ions1, 2 and 3
00213 
00214         mutable bool has_int_max_;
00215         mutable double int_max_;
00216 
00217         mutable bool has_int_min_;
00218         mutable double int_min_;
00219 
00220         mutable bool has_tol_;
00221         mutable double tol_;
00222         mutable std::string tol_units_;
00223 
00224         mutable bool has_instrument_;
00225         mutable std::string instrument_;
00226         mutable std::string unescaped_instrument_;
00227 
00228         mutable bool has_rules_;
00229         mutable std::string rules_;
00230 
00231         mutable bool has_internalMasses_;
00232         mutable double minInternalMass_;
00233         mutable double maxInternalMass_;
00234 
00235         mutable bool has_it_mods_;
00236         mutable std::string it_mods_;
00237         mutable std::string unescaped_it_mods_;
00238         mutable std::vector<std::string> local_modtitles_;
00239 
00240         ms_umod_configfile umodfile_;
00241 
00242         mutable bool has_rt_;
00243         mutable std::vector<int> rtIndices_;
00244         mutable std::vector<std::string> rtValues_;
00245 
00246         mutable bool has_scans_;
00247         mutable std::vector<int> scansIndices_;
00248         mutable std::vector<std::string> scansValues_;
00249 
00250         mutable bool has_rawscans_;
00251         mutable std::vector<int> rawscansIndices_;
00252         mutable std::vector<std::string> rawscansValues_;
00253 
00254         mutable bool has_rawfile_;
00255         mutable std::string rawfile_;
00256 
00257         mutable bool has_locus_;
00258         mutable std::string locus_;
00259 
00260         mutable bool has_index_;
00261         mutable int index_;
00262 
00263         void fillPeakList(const int ions);
00264         void loadIons();
00265         void retrieveAllValuesOf(const std::string &prefix, std::vector<int> &index, std::vector<std::string> &values) const;
00266         std::wstring getStringTitleWide(bool unescaped) const;
00267         std::wstring getRawfileWide() const;
00268         std::string getStringIonsWithCharges(const int index);
00269     }; // end of resfile_group
00271 }   // matrix_science namespace
00272 
00273 #endif // !defined(MS_INPUTQUERY_HPP)

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