Matrix Science header

ms_quantitation.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_quantitation.hpp                                                  #
00004 # 'msparser' toolkit                                                         #
00005 # Base class for the main quantitation interface                             #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2013 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #     $Author: martins $ #
00012 #       $Date: 2015/01/08 15:34:26 $ #
00013 #   $Revision: 1.19 $ #
00014 # $NoKeywords::                                                            $ #
00015 ##############################################################################
00016 */
00017 
00018 #ifndef MS_QUANTITATION_HPP
00019 #define MS_QUANTITATION_HPP
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 // Includes from the standard template library
00038 #include <string>
00039 #include <vector>
00040 #include <map>
00041 #include <set>
00042 #include <utility>
00043 
00044 namespace matrix_science {
00045     class ms_errors;
00046     class ms_mascotresfile;
00047     class ms_peptide_quant_key;
00048     class ms_peptide_quant_key_vector;
00049     class ms_peptide_quant_ratio;
00050     class ms_protein_quant_ratio;
00051     class ms_quant_outliers;
00052 
00058 
00059 
00143     class MS_MASCOTRESFILE_API ms_quantitation: public ms_errors
00144     {
00145         public:
00147             virtual ~ms_quantitation() = 0;
00148 
00150             virtual bool hasPeptideRatio(const ms_peptide_quant_key &key, const std::string &ratioName) const = 0;
00151 
00153             virtual ms_peptide_quant_ratio getPeptideRatio(const ms_peptide_quant_key &key, const std::string &ratioName) const = 0;
00154 
00156             virtual void setPeptideRatioIncluded(const ms_peptide_quant_key &key, const std::string &ratioName) = 0;
00157 
00159             virtual void setPeptideRatioExcluded(const ms_peptide_quant_key &key, const std::string &ratioName) = 0;
00160 
00162             virtual bool isPeptideRatioExcluded(const ms_peptide_quant_key &key, const std::string &ratioName) const = 0;
00163 
00165             virtual void setQuantOutliers(const ms_quant_outliers *) = 0;
00166 
00168             void setMinNumPeptides(int value);
00169 
00171             virtual void setProteinRatioType(const char *value) = 0;
00172 
00174             const ms_quant_method& getQuantitationMethod() const;
00175 
00177             virtual ms_protein_quant_ratio getProteinRatio(const std::string &accession, int dbIdx, const std::string &ratioName) const = 0;
00178 
00180             virtual ms_protein_quant_ratio getProteinRatio(const std::string &accession, int dbIdx, const std::string &ratioName, const ms_peptide_quant_key_vector &includeKeys, const ms_peptide_quant_key_vector &excludeKeys) const = 0;
00181 
00183             ms_peptide_quant_key_vector getPeptideQuantKeys(const std::string &accession, int dbIdx) const;
00184 
00186             double getPeptideRatioNormalisationBase(const std::string &ratioName) const;
00187 
00189             void setPeptideRatioNormalisationBase(const std::string &ratioName, double b);
00190 
00192             void removePeptideRatioNormalisationBase(const std::string &ratioName);
00193 
00195             void removePeptideRatioNormalisationBases();
00196 
00197         protected:
00198             ms_quantitation();
00199 
00200             ms_quant_method quantMethod_;
00201 
00203             virtual void getSortedFinitePeptideRatioValues(const std::string &ratioName, const std::set<ms_peptide_quant_key> &keys, const std::set<ms_peptide_quant_key> &includeKeys, const std::set<ms_peptide_quant_key> &excludeKeys, std::vector<double> &values, std::vector<double> &weights, std::vector<ms_peptide_quant_key> &activeKeys, std::map<ms_peptide_quant_key, int> &inactiveKeys) const = 0;
00204 
00206             void getProteinRatioSample(const std::string &accession, int dbIdx, const std::string &ratioName, const std::vector<ms_peptide_quant_key> &includeKeys, const std::vector<ms_peptide_quant_key> &excludeKeys, std::vector<double> &sample, std::vector<double> &logSample, std::vector<double> &weights, std::vector<ms_peptide_quant_key> &activeKeys, std::map<ms_peptide_quant_key, int> &inactiveKeys, double &normalityPvalue) const;
00207 
00209             ms_protein_quant_ratio calculateMedianRatio(const std::string &accession, int dbIdx, const std::string &ratioName, const std::vector<double> &sample, const std::vector<double> &logSample, const std::vector<ms_peptide_quant_key> &activeKeys, const std::map<ms_peptide_quant_key, int> &inactiveKeys, double normalityPvalue) const;
00210 
00212             ms_protein_quant_ratio calculateGeometricMeanRatio(const std::string &accession, int dbIdx, const std::string &ratioName, const std::vector<double> &sample, const std::vector<double> &logSample, const std::vector<ms_peptide_quant_key> &activeKeys, const std::map<ms_peptide_quant_key, int> &inactiveKeys, double normalityPvalue) const;
00213 
00215             ms_protein_quant_ratio calculateWeightedGeometricMeanRatio(const std::string &accession, int dbIdx, const std::string &ratioName, const std::vector<double> &sample, const std::vector<double> &logSample, const std::vector<double> &weights, const std::vector<ms_peptide_quant_key> &activeKeys, const std::map<ms_peptide_quant_key, int> &inactiveKeys, double normalityPvalue) const;
00216 
00217             typedef std::pair<std::string, int> protein_key_t; // accession, dbIdx
00218             typedef std::map< protein_key_t, std::set<ms_peptide_quant_key> > protein_to_peptide_quant_key_t; // maps from [accession, dbidx] to set<ms_peptide_quant_key>
00219 
00221             protein_to_peptide_quant_key_t proteinKeys_;
00222 
00224             bool initialiseBaseSettings(const ms_quant_method &qmBase, const ms_quant_method &qmConfig);
00225 
00227             int getMinNumPeptides() const;
00228 
00230             virtual int countDistinctPeptides(const std::vector<ms_peptide_quant_key> & activeKeys) const;
00231 
00232         private:
00233             int minNumPeptides_;
00234 
00235             std::map< std::string, double > logH0ProteinRatio_;
00236             typedef std::map< std::string, double > ratio_name_to_normalisation_base_t;
00237             ratio_name_to_normalisation_base_t peptideNormalisationBases_;
00238     }; // end of quantitation_group
00240 }   // matrix_science namespace
00241 
00242 #endif // MS_QUANTITATION_HPP
00243 
00244 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51