Matrix Science header

ms_protein_quant_ratio.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_protein_quant_ratio.hpp                                           #
00004 # 'msparser' toolkit                                                         #
00005 # Protein ratio for relative quantitation, estimated from peptide ratios     #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2013 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #     $Author: villek $ #
00012 #       $Date: 2014/08/14 15:28:06 $ #
00013 #   $Revision: 1.14 $ #
00014 # $NoKeywords::                                                            $ #
00015 ##############################################################################
00016 */
00017 
00018 #ifndef MS_PROTEIN_QUANT_RATIO_HPP
00019 #define MS_PROTEIN_QUANT_RATIO_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 <map>
00040 
00041 namespace matrix_science {
00042     class ms_peptide_quant_key;
00043     class ms_peptide_quant_key_vector;
00044 
00050 
00051 
00086     class MS_MASCOTRESFILE_API ms_protein_quant_ratio
00087     {
00088         friend class ms_quantitation;
00089         friend class ms_ms1quantitation;
00090         friend class ms_ms2quantitation;
00091         friend class ms_customquantitation;
00092 
00093         public:
00096             ms_protein_quant_ratio(const std::string &accession, int dbIdx, const std::string &ratioName);
00097 
00100             ms_protein_quant_ratio(const std::string &accession, int dbIdx, const std::string &ratioName, double value, double stdev, double stderror, double hypothesisPvalue, double normalityPvalue, unsigned int sampleSize);
00101 
00103             ms_protein_quant_ratio(const ms_protein_quant_ratio& src);
00104 
00106             ~ms_protein_quant_ratio();
00107 
00108 #ifndef SWIG
00109 
00110             ms_protein_quant_ratio& operator=(const ms_protein_quant_ratio& right);
00111 
00113             bool operator==(const ms_protein_quant_ratio& right) const;
00114 
00116             bool operator!=(const ms_protein_quant_ratio& right) const;
00117 #endif
00118 
00119             void copyFrom(const ms_protein_quant_ratio* src);
00120 
00122             bool isMissing() const;
00123 
00125             std::string getAccession() const;
00126 
00128             int getDB() const;
00129 
00131             std::string getRatioName() const;
00132 
00134             double getValue() const;
00135 
00137             unsigned int getSampleSize() const;
00138 
00140             double getStandardDeviation() const;
00141             
00143             double getStandardDeviation(std::string &whyUnavailable) const;
00144 
00146             double getStandardError() const;
00147 
00149             double getStandardError(std::string &whyUnavailable) const;
00150 
00152             ms_peptide_quant_key_vector getActiveKeys() const;
00153 
00155             ms_peptide_quant_key_vector getSkippedKeys() const;
00156 
00158             ms_peptide_quant_key_vector getOutlierKeys() const;
00159 
00161             ms_peptide_quant_key_vector getExcludedKeys() const;
00162 
00164             double getHypothesisPvalue() const;
00165 
00167             double getHypothesisPvalue(std::string &whyUnavailable) const;
00168 
00170             bool isSignificant(double threshold = 0.05) const;
00171 
00173             double getNormalityPvalue() const;
00174 
00176             double getNormalityPvalue(std::string &whyUnavailable) const;
00177 
00179             bool isLogNormal(double threshold = 0.05) const;
00180 
00182             static ms_protein_quant_ratio fromSerialisedString(const std::string &serialisedStr);
00183 
00185             std::string serialise() const;
00186 
00188             static std::string serialisationFormatVersion();
00189             
00190         private:
00191             enum PEPQUANTKEY_STATE {
00192                 PEPQUANTKEY_SKIPPED  = 0x0001,
00193                 PEPQUANTKEY_OUTLIER  = 0x0002,
00194                 PEPQUANTKEY_EXCLUDED = 0x0004
00195             };
00196 
00197             enum REASON_WHY_UNAVAILABLE {
00198                 REASON_NOT_UNAVAILABLE = 0,
00199                 REASON_MISSING_RATIO = 1,
00200                 REASON_TYPE_WEIGHTED = 2
00201             };
00202 
00203             static std::string lookupWhyUnavailable(int reason);
00204 
00205             typedef struct { int why; const char *str; } reason_why_t;
00206             static const reason_why_t reason_why_db[];
00207 
00210             ms_protein_quant_ratio(const std::string &accession, int dbIdx, const std::string &ratioName, double value, double stdev, double stderror, double hypothesisPvalue, double normalityPvalue, const std::vector<ms_peptide_quant_key> &activeKeys, const std::map<ms_peptide_quant_key, int> &inactiveKeys);
00211 
00212             ms_peptide_quant_key_vector collectKeys(int type) const;
00213 
00214             bool isMissing_;
00215 
00216             std::string accession_;
00217             int dbIdx_;
00218             std::string ratioName_;
00219 
00220             double value_;
00221 
00222             double stdev_;
00223             double stderror_;
00224             int whyStdevUnavailable_;
00225 
00226             double hypothesisPvalue_;
00227             int whyHypothesisPUnavailable_;
00228 
00229             double normalityPvalue_;
00230             int whyNormalityPUnavailable_;
00231 
00232             unsigned int sampleSize_;
00233 
00234             std::vector<ms_peptide_quant_key> activeKeys_;
00235             std::map<ms_peptide_quant_key, int> inactiveKeys_;
00236     }; // end of quantitation_group
00238 }   // matrix_science namespace
00239 
00240 #endif // MS_PROTEIN_QUANT_RATIO_HPP
00241 
00242 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51