Matrix Science header

ms_mascotresproteinsum.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_mascotresproteinsum.cpp                                           #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates the protein summary report 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_mascotrespr $ #
00012 #     $Author: villek@matrixscience.com $ #
00013 #       $Date: 2021-01-14 15:39:42 +0000 $ #
00014 #   $Revision: 3df1effe4b9d5696c343804b398ed8a5afaaffce | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_MASCOTRESPROTEINSUM_HPP
00020 #define MS_MASCOTRESPROTEINSUM_HPP
00021 
00022 
00023 // Includes from the standard template library
00024 #include <string>
00025 
00026 
00027 namespace matrix_science {
00028     class ms_mascotresults_parameters;
00029 
00041     class MS_MASCOTRESFILE_API ms_proteinsummary : public ms_mascotresults
00042     {
00043         public:
00045             ms_proteinsummary(const ms_mascotresfile  &resfile,
00046                 const unsigned int flags = ms_mascotresults::MSRES_GROUP_PROTEINS 
00047                                          | ms_mascotresults::MSRES_SHOW_SUBSETS,
00048                               double             minProbability = 0.0,
00049                               int                maxHitsToReport = 50,
00050                               const char *       unigeneIndexFile = 0,
00051                               const char *       singleHit = 0);
00052             
00054             ms_proteinsummary(const ms_mascotresfile &resfile,
00055                               const ms_mascotresults_params & parameters);
00056             
00057             virtual ~ms_proteinsummary();
00058 
00060             virtual ms_peptide getPeptide(const int q, const int p) const;
00061 
00063             virtual double getIonsScore(const int q, const int p, const bool decoy) const;
00064 
00066             virtual bool isPeptideUnique(const int q, const int p, const UNIQUE_PEP_RULES rules = UPR_DEFAULT) const;
00067 
00069             virtual bool getPeptide(const int q, const int p, ms_peptide * & pep) const;
00070 
00072             virtual std::string getProteinsWithThisPepMatch(const int q, const int p, const bool quotes=false);
00073 
00075             virtual std::vector<std::string> getAllProteinsWithThisPepMatch(const int q, const int p, 
00076                                                                             std::vector<int> & start, 
00077                                                                             std::vector<int> & end, 
00078                                                                             std::vector<std::string> &pre,
00079                                                                             std::vector<std::string> &post,
00080                                                                             std::vector<int> & frame,
00081                                                                             std::vector<int> & multiplicity,
00082                                                                             std::vector<int> & db) const;
00083 
00085             virtual std::vector<std::string> getAllProteinsWithThisPepMatch(const int q, const int p, 
00086                                                                             std::vector<int> & start, 
00087                                                                             std::vector<int> & end, 
00088                                                                             std::vector<std::string> &pre,
00089                                                                             std::vector<std::string> &post,
00090                                                                             std::vector<int> & frame,
00091                                                                             std::vector<int> & multiplicity,
00092                                                                             std::vector<int> & db,
00093                                                                             std::vector<int> & psmComponent) const;
00094 
00096             virtual int getAllFamilyMembersWithThisPepMatch(const int hit,
00097                                                             const int q,
00098                                                             const int p,
00099                                                             std::vector< int >& db,
00100                                                             std::vector< std::string >& acc,
00101                                                             std::vector< int >& dupe_status) const;
00102 
00103 
00105             virtual std::string getErrTolModString(const int q, const int p) const;
00106 
00108             virtual std::string getLibraryModString(const int q, const int p) const;
00109 
00111             virtual std::string getErrTolModMasterString(const int q, const int p) const;
00112 
00114             virtual std::string getErrTolModSlaveString(const int q, const int p) const;
00115 
00117             virtual std::string getErrTolModPepString(const int q, const int p) const;
00118 
00120             virtual std::string getErrTolModReqPepString(const int q, const int p) const;
00121 
00123             virtual std::string getTagString(const int q, const int p) const;
00124 
00126             virtual int getTagDeltaRangeStart(const int q, const int p) const;
00127 
00129             virtual int getTagDeltaRangeEnd(const int q, const int p) const;
00130 
00132             virtual std::string getTerminalResiduesString(const int q, const int p, const ms_peptide::PSM psmComponent = ms_peptide::PSM_COMPLETE) const;
00133 
00135             virtual std::string getComponentString(const int q, const int p, const ms_peptide::PSM psmComponent = ms_peptide::PSM_COMPLETE) const;
00136 
00138             virtual int getProteinScoreCutoff(double OneInXprobRnd) const;
00139 
00141             int    getNumPmfQueriesUsed() const;
00142 
00144             bool   isPmfQueryUsed(const int queryIdx) const;
00145 
00147             virtual std::vector<int> getPepsWithSameScore(const int q, const int p) const;
00148 #ifndef SWIG            
00149 
00150             virtual bool getComponentIntensity(const int q, const int p, const std::string & componentName, double & value, double & rawValue) const;
00151 #else // SWIG Multiple return values
00152             virtual bool getComponentIntensity(const int q, const int p, const std::string & componentName, double & OUTPUT, double & OUTPUT) const;
00153 #endif
00154 
00155             virtual bool isValidQandP(const int q, const int h) const;
00156 
00158             virtual QUANT_COMPONENT_STATUS getQuantitationComponentForPeptide(
00159                     const matrix_science::ms_peptide & peptide,
00160                     matrix_science::ms_quant_component & component,
00161                     const matrix_science::ms_quant_method * method = NULL) const;
00162 
00163         protected:  
00164             // Not safe to copy or assign this object.
00165             ms_proteinsummary(const ms_proteinsummary & rhs);
00166 #ifndef SWIG
00167             ms_proteinsummary & operator=(const ms_proteinsummary & rhs);
00168 #endif
00169 
00170             virtual bool queryHasSignificantRank1Match(ms_mascotresfile::section secSummary,
00171                                                        int query) const;
00172 
00173             virtual void calculateDecoyStats( double dOneInXprobRnd);
00174             virtual bool getThresholdForFDR(bool homology, double targetFDR, 
00175                     DECOY_STATS_COUNT_TYPE countType, DB_MATCH_TYPE dbType,
00176                     double * closestFDR, double * minProbability,
00177                     int * pNumTargetMatches, int * pNumDecoyMatches);
00178 
00180             virtual int findProteins(const int startHit, 
00181                                      const std::string & str, 
00182                                      const int dbIdx,
00183                                      FIND_FLAGS item,
00184                                      FIND_COMPARE_FLAGS compareFlags,
00185                                      std::vector<std::string> & accessions,
00186                                      std::vector<int> & dbIndexes) const;
00187 
00189             virtual int findProteinsByAccession(const int startHit, 
00190                                                 const std::string & str, 
00191                                                 const int dbIdx,
00192                                                 FIND_COMPARE_FLAGS compareFlags,
00193                                                 std::vector<std::string> & accessions,
00194                                                 std::vector<int> & dbIndexes) const;
00195 
00197             virtual int findProteinsByDescription(const int startHit, 
00198                                                   const std::string & str, 
00199                                                   FIND_COMPARE_FLAGS compareFlags,
00200                                                   std::vector<std::string> & accessions,
00201                                                   std::vector<int> & dbIndexes) const;
00202 
00204             virtual int findPeptides(const int startHit, 
00205                                      const std::string & str, 
00206                                      FIND_FLAGS item,
00207                                      FIND_COMPARE_FLAGS compareFlags,
00208                                      std::vector<int> & q,
00209                                      std::vector<int> & p) const;
00210 
00211             virtual bool cacheModificationCounts();
00212 
00213         private:
00214             void initialise();
00215             bool parseProtein(const int hit);
00216             void loadPepRes(const int hit,
00217                             const int dbIdx,
00218                             std::string & accession, 
00219                             const int frame);
00220             void addMixtureHits();
00221             int singleHitAsInt_;
00222             ms_peptide emptyPeptide_;
00223 
00224             bool         isPmfRanks_;
00225             int          numPmfQueriesUsed_;
00226             std::vector<int> pmfQueriesUsed_;
00227             int          numPmfHitsPreserved_;
00228 
00229     }; // end of resfile_group
00231 }   // matrix_science namespace
00232 
00233 #endif // MS_MASCOTRESPROTEINSUM_HPP
00234 
00235 /*------------------------------- End of File -------------------------------*/

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