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 $ #
00013 #       $Date: 2016/03/22 16:49:53 $ #
00014 #   $Revision: 1.49 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_MASCOTRESPROTEINSUM_HPP
00020 #define MS_MASCOTRESPROTEINSUM_HPP
00021 
00022 #ifdef _WIN32
00023 #pragma warning(disable:4251)   // Don't want all classes to be exported
00024 #pragma warning(disable:4786)   // Debug symbols too long
00025 #   ifndef _MATRIX_USE_STATIC_LIB
00026 #       ifdef MS_MASCOTRESFILE_EXPORTS
00027 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00028 #       else
00029 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00030 #       endif
00031 #   else
00032 #       define MS_MASCOTRESFILE_API
00033 #   endif
00034 #else
00035 #   define MS_MASCOTRESFILE_API
00036 #endif
00037 
00038 // for the sake of #include <string>
00039 #ifdef __ALPHA_UNIX__
00040 #include <ctype.h>
00041 #endif
00042 
00043 // Includes from the standard template library
00044 #include <string>
00045 
00046 
00047 namespace matrix_science {
00059     class MS_MASCOTRESFILE_API ms_proteinsummary : public ms_mascotresults
00060     {
00061         public:
00063             ms_proteinsummary(ms_mascotresfile  &resfile,
00064                 const unsigned int flags = ms_mascotresults::MSRES_GROUP_PROTEINS 
00065                                          | ms_mascotresults::MSRES_SHOW_SUBSETS,
00066                               double             minProbability = 0.0,
00067                               int                maxHitsToReport = 50,
00068                               const char *       unigeneIndexFile = 0,
00069                               const char *       singleHit = 0);
00070             
00072             ms_proteinsummary(ms_mascotresfile &resfile,
00073                               const ms_mascotresults_params & parameters);
00074             
00075             virtual ~ms_proteinsummary();
00076 
00078             virtual ms_peptide getPeptide(const int q, const int p) const;
00079 
00081             virtual double getIonsScore(const int q, const int p, const bool decoy) const;
00082 
00084             virtual bool isPeptideUnique(const int q, const int p, const UNIQUE_PEP_RULES rules = UPR_DEFAULT) const;
00085 
00087             virtual bool getPeptide(const int q, const int p, ms_peptide * & pep) const;
00088 
00090             virtual std::string getProteinsWithThisPepMatch(const int q, const int p, const bool quotes=false);
00091 
00093             virtual std::vector<std::string> getAllProteinsWithThisPepMatch(const int q, const int p, 
00094                                                                             std::vector<int> & start, 
00095                                                                             std::vector<int> & end, 
00096                                                                             std::vector<std::string> &pre,
00097                                                                             std::vector<std::string> &post,
00098                                                                             std::vector<int> & frame,
00099                                                                             std::vector<int> & multiplicity,
00100                                                                             std::vector<int> & db) const;
00101 
00103             virtual int getAllFamilyMembersWithThisPepMatch(const int hit,
00104                                                             const int q,
00105                                                             const int p,
00106                                                             std::vector< int >& db,
00107                                                             std::vector< std::string >& acc,
00108                                                             std::vector< int >& dupe_status) const;
00109 
00110 
00112             virtual std::string getErrTolModString(const int q, const int p) const;
00113 
00115             virtual std::string getLibraryModString(const int q, const int p) const;
00116 
00118             virtual std::string getErrTolModMasterString(const int q, const int p) const;
00119 
00121             virtual std::string getErrTolModSlaveString(const int q, const int p) const;
00122 
00124             virtual std::string getErrTolModPepString(const int q, const int p) const;
00125 
00127             virtual std::string getErrTolModReqPepString(const int q, const int p) const;
00128 
00130             virtual std::string getTagString(const int q, const int p) const;
00131 
00133             virtual int getTagDeltaRangeStart(const int q, const int p) const;
00134 
00136             virtual int getTagDeltaRangeEnd(const int q, const int p) const;
00137 
00139             virtual std::string getTerminalResiduesString(const int q, const int p) const;
00140 
00142             virtual std::string getComponentString(const int q, const int p) const;
00143 
00145             virtual int getProteinScoreCutoff(double OneInXprobRnd) const;
00146 
00148             int    getNumPmfQueriesUsed() const;
00149 
00151             bool   isPmfQueryUsed(const int queryIdx) const;
00152 
00154             virtual std::vector<int> getPepsWithSameScore(const int q, const int p) const;
00155             
00157             virtual bool getComponentIntensity(const int q, const int p, const std::string & componentName, double & value, double & rawValue) const;
00158 
00160             virtual bool isValidQandP(const int q, const int h) const;
00161 
00163             virtual QUANT_COMPONENT_STATUS getQuantitationComponentForPeptide(
00164                     const matrix_science::ms_peptide & peptide,
00165                     matrix_science::ms_quant_component & component,
00166                     const matrix_science::ms_quant_method * method = NULL) const;
00167 
00168         protected:  
00169             // Not safe to copy or assign this object.
00170             ms_proteinsummary(const ms_proteinsummary & rhs);
00171 #ifndef SWIG
00172             ms_proteinsummary & operator=(const ms_proteinsummary & rhs);
00173 #endif
00174             virtual void calculateDecoyStats( double dOneInXprobRnd);
00175             virtual bool getThresholdForFDR(bool homology, double targetFDR, 
00176                     DECOY_STATS_COUNT_TYPE countType, DB_MATCH_TYPE dbType,
00177                     double * closestFDR, double * minProbability,
00178                     int * pNumTargetMatches, int * pNumDecoyMatches);
00179 
00181             virtual int findProteins(const int startHit, 
00182                                      const std::string & str, 
00183                                      const int dbIdx,
00184                                      FIND_FLAGS item,
00185                                      FIND_COMPARE_FLAGS compareFlags,
00186                                      std::vector<std::string> & accessions,
00187                                      std::vector<int> & dbIndexes) const;
00188 
00190             virtual int findProteinsByAccession(const int startHit, 
00191                                                 const std::string & str, 
00192                                                 const int dbIdx,
00193                                                 FIND_COMPARE_FLAGS compareFlags,
00194                                                 std::vector<std::string> & accessions,
00195                                                 std::vector<int> & dbIndexes) const;
00196 
00198             virtual int findProteinsByDescription(const int startHit, 
00199                                                   const std::string & str, 
00200                                                   FIND_COMPARE_FLAGS compareFlags,
00201                                                   std::vector<std::string> & accessions,
00202                                                   std::vector<int> & dbIndexes) const;
00203 
00205             virtual int findPeptides(const int startHit, 
00206                                      const std::string & str, 
00207                                      FIND_FLAGS item,
00208                                      FIND_COMPARE_FLAGS compareFlags,
00209                                      std::vector<int> & q,
00210                                      std::vector<int> & p) const;
00211 
00212             virtual bool cacheModificationCounts();
00213 
00214         private:
00215             void initialise();
00216             bool parseProtein(const int hit);
00217             void loadPepRes(const int hit,
00218                             const int dbIdx,
00219                             std::string & accession, 
00220                             const int frame);
00221             void addMixtureHits();
00222             int singleHitAsInt_;
00223             ms_peptide emptyPeptide_;
00224 
00225             bool         isPmfRanks_;
00226             int          numPmfQueriesUsed_;
00227             std::vector<int> pmfQueriesUsed_;
00228             int          numPmfHitsPreserved_;
00229 
00230     }; // end of resfile_group
00232 }   // matrix_science namespace
00233 
00234 #endif // MS_MASCOTRESPROTEINSUM_HPP
00235 
00236 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51