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@matrixscience.com $ #
00012 #       $Date: 2018-07-30 16:23:53 +0100 $ #
00013 #   $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00014 # $NoKeywords::                                                            $ #
00015 ##############################################################################
00016 */
00017 
00018 #ifndef MS_PROTEIN_QUANT_RATIO_HPP
00019 #define MS_PROTEIN_QUANT_RATIO_HPP
00020 
00021 
00022 // Includes from the standard template library
00023 #include <string>
00024 #include <map>
00025 
00026 namespace matrix_science {
00027     class ms_peptide_quant_key;
00028     class ms_peptide_quant_key_vector;
00029 
00035 
00036 
00071     class MS_MASCOTRESFILE_API ms_protein_quant_ratio
00072     {
00073         friend class ms_quantitation;
00074         friend class ms_ms1quantitation;
00075         friend class ms_ms2quantitation;
00076         friend class ms_customquantitation;
00077 
00078         public:
00081             ms_protein_quant_ratio(const std::string &accession, int dbIdx, const std::string &ratioName);
00082 
00085             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);
00086 
00088             ms_protein_quant_ratio(const ms_protein_quant_ratio& src);
00089 
00091             ~ms_protein_quant_ratio();
00092 
00093 #ifndef SWIG
00094 
00095             ms_protein_quant_ratio& operator=(const ms_protein_quant_ratio& right);
00096 
00098             bool operator==(const ms_protein_quant_ratio& right) const;
00099 
00101             bool operator!=(const ms_protein_quant_ratio& right) const;
00102 #endif
00103 
00104             void copyFrom(const ms_protein_quant_ratio* src);
00105 
00107             bool isMissing() const;
00108 
00110             std::string getAccession() const;
00111 
00113             int getDB() const;
00114 
00116             std::string getRatioName() const;
00117 
00119             double getValue() const;
00120 
00122             unsigned int getSampleSize() const;
00123 
00125             double getStandardDeviation() const;
00126             
00128             double getStandardDeviation(std::string &whyUnavailable) const;
00129 
00131             double getStandardError() const;
00132 
00134             double getStandardError(std::string &whyUnavailable) const;
00135 
00137             ms_peptide_quant_key_vector getActiveKeys() const;
00138 
00140             ms_peptide_quant_key_vector getSkippedKeys() const;
00141 
00143             ms_peptide_quant_key_vector getOutlierKeys() const;
00144 
00146             ms_peptide_quant_key_vector getExcludedKeys() const;
00147 
00149             double getHypothesisPvalue() const;
00150 
00152             double getHypothesisPvalue(std::string &whyUnavailable) const;
00153 
00155             bool isSignificant(double threshold = 0.05) const;
00156 
00158             double getNormalityPvalue() const;
00159 
00161             double getNormalityPvalue(std::string &whyUnavailable) const;
00162 
00164             bool isLogNormal(double threshold = 0.05) const;
00165 
00167             static ms_protein_quant_ratio fromSerialisedString(const std::string &serialisedStr);
00168 
00170             std::string serialise() const;
00171 
00173             static std::string serialisationFormatVersion();
00174             
00175         private:
00176             enum PEPQUANTKEY_STATE {
00177                 PEPQUANTKEY_SKIPPED  = 0x0001,
00178                 PEPQUANTKEY_OUTLIER  = 0x0002,
00179                 PEPQUANTKEY_EXCLUDED = 0x0004
00180             };
00181 
00182             enum REASON_WHY_UNAVAILABLE {
00183                 REASON_NOT_UNAVAILABLE = 0,
00184                 REASON_MISSING_RATIO = 1,
00185                 REASON_TYPE_WEIGHTED = 2
00186             };
00187 
00188             static std::string lookupWhyUnavailable(int reason);
00189 
00190 //Warning 325: Nested struct not currently supported
00191 #ifndef SWIG
00192             typedef struct { int why; const char *str; } reason_why_t;
00193             static const reason_why_t reason_why_db[];
00194 #endif
00195 
00196 
00197             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);
00198 
00199             ms_peptide_quant_key_vector collectKeys(int type) const;
00200 
00201             bool isMissing_;
00202 
00203             std::string accession_;
00204             int dbIdx_;
00205             std::string ratioName_;
00206 
00207             double value_;
00208 
00209             double stdev_;
00210             double stderror_;
00211             int whyStdevUnavailable_;
00212 
00213             double hypothesisPvalue_;
00214             int whyHypothesisPUnavailable_;
00215 
00216             double normalityPvalue_;
00217             int whyNormalityPUnavailable_;
00218 
00219             unsigned int sampleSize_;
00220 
00221             std::vector<ms_peptide_quant_key> activeKeys_;
00222             std::map<ms_peptide_quant_key, int> inactiveKeys_;
00223     }; // end of quantitation_group
00225 }   // matrix_science namespace
00226 
00227 #endif // MS_PROTEIN_QUANT_RATIO_HPP
00228 
00229 /*------------------------------- End of File -------------------------------*/

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