Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_mascotresults.hpp
1/*
2##############################################################################
3# file: ms_mascotresults.hpp #
4# 'msparser' toolkit #
5# Abstract class for either ms_peptidesummary or ms_proteinsummary #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2016 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Archive:: /MowseBranches/ms_mascotresfile_1.2/include/ms_mascotresul $ #
12# $Author: villek@matrixscience.com $ #
13# $Date: 2024-09-23 16:49:32 +0100 $ #
14# $Revision: 9380e01cc54b09b4a89586cc2064ed96df95f3bf | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
15# $NoKeywords:: $ #
16##############################################################################
17*/
18
19#ifndef MS_MASCOTRESULTS_HPP
20#define MS_MASCOTRESULTS_HPP
21
22
23// Includes from the standard template library
24#include <string>
25#include <list>
26#include <vector>
27#include <set>
28#include <map>
29#include <algorithm>
30#include <memory>
31
32namespace msparser_internal {
33 class ms_unassigned;
34 class ms_protein_match_data;
35 struct peptide_impl_args;
36 class linearPeptideData_t;
37 class ms_mascotresultsbase;
38}
39
40namespace matrix_science {
46 class ms_unigene;
47 class ms_protein;
48 class ms_peptide;
49 class ms_quant_component;
50 class ms_mascotresults_params;
51
52#ifndef SWIG
53
55 struct LexicoCompare
56 {
57 bool caseSensitive_;
58 LexicoCompare(bool caseSensitive) : caseSensitive_(caseSensitive) { }
59 bool operator()(const std::string& left, const std::string& right ) const;
60 };
61#endif
62
63
65
82 class MS_MASCOTRESFILE_API ms_mascotresults
83 {
84 friend class ms_protein;
85 friend class ms_peptide;
86 friend class msparser_internal::ms_peptidesumcdb;
87
88 public:
89
91
94 enum sortBy
95 {
98 INTENSITY
99
100 };
101
110 enum dupeStatus
111 {
112 dupe_query_same = 0x0001,
113 dupe_seq_same = 0x0002,
114 dupe_mods_same = 0x0004,
115 dupe_pos_same = 0x0008,
116
117 // Bug 13818: Conceptually different to the other duplicate statuses.
118 // Used to indicate if all the components (alpha and beta in a crosslinked match)
119 // are in the same protein.
120 dupe_protein_same = 0x0010
121 };
122
124
128 {
129 TCM_FIRST_VALUE = 0x0001, // For looping - undocumented
130 TCM_PAIRWISE_SINGLE = 0x0001,
131 TCM_PAIRWISE_MAXIMUM = 0x0002,
132 TCM_PAIRWISE_AVERAGE = 0x0003,
133
134 TCM_LAST_VALUE = 0x0003 // For looping - undocumented
135 };
136
138
146 {
147 FT_PEPTIDE_EXP_MZ = 0x00000001,
148 FT_PEPTIDE_EXP_MR = 0x00000002,
149 FT_PEPTIDE_CALC_MZ = 0x00000004,
150 FT_PEPTIDE_CALC_MR = 0x00000008,
151 FT_PEPTIDE_STRING = 0x00000010,
152 FT_PEPTIDE_QUERY = 0x00000020,
153
154 FT_PEPTIDE_VARMOD = 0x00000040,
155 FT_PEPTIDE_FIXMOD = 0x00000080,
156 FT_PEPTIDE_ETMOD = 0x00000100,
157 FT_PEPTIDE_SLMOD = 0x00000200,
158 FT_PEPTIDE_VARMOD_BYNAME = 0x00000400,
159
160 FT_PEPTIDE_FIND_MASK = 0x00000FFF,
161
162 FT_PROTEIN_ACCESSION = 0x00001000,
163 FT_PROTEIN_DESCRIPTION = 0x00002000
164 };
165
167
189 {
190 FC_COMPLETESTR = 0x00000001,
191 FC_SUBSTR = 0x00000002,
192 FC_STARTSTR = 0x00000003,
193 FC_STRTOK = 0x00000004,
194 FC_MASK_STR_PART = 0x0000000F,
195
196 FC_CASE_INSENSITIVE = 0x00000000,
197 FC_CASE_SENSITIVE = 0x00000010,
198 FC_MASK_CASE = 0x000000F0,
199
200 FC_FORWARD = 0x00000000,
201 FC_REVERSE = 0x00000100,
202 FC_MASK_DIRECTION = 0x00000F00,
203
204 FC_RESTRICT_TO_HIT = 0x00001000,
205 FC_LOOP_INTO_UNASSIGNED = 0x00002000,
206 FC_LOOP_FROM_UNASSIGNED = 0x00004000,
207 FC_UNASSIGNED_MASK = 0x00006000,
208
209 FC_SEARCH_ALL_RANKS = 0x00008000,
210
211 FC_ALL_PEPTIDES = 0x00000000,
212 FC_ALL_PEPTITDES = 0x00000000,
213
214 FC_SIGNIFICANT_PEPTIDES = 0x00010000,
215 FC_SEARCH_IGNORED_RANKS = 0x00020000,
216 FC_SCORING_MASK = 0x000F0000,
217
218 FC_PROTEIN_IGN_SAMESETS = 0x00100000,
219 FC_PROTEIN_IGN_SUBSETS = 0x00200000,
220 FC_PROTEIN_IGN_FAMILY = 0x00400000,
221 FC_PROTEIN_IGN_MASK = 0x00F00000,
222
223 FC_PROTEIN_INC_ALT_ACC = 0x01000000
224 };
225
227
231 {
232 IH_INCLUDE_TOP_MATCHES = 0x0000,
233 IH_INCLUDE_TOP_10_MATCHES = 0x0001
234/* IH_INCLUDE_TOP_ERRTOL_MATCHES = 0x0002, //!< Not yet implemented. Include top error tolerant match
235 IH_INCLUDE_TOP_10_ERRTOL_MATCHES = 0x0004, //!< Not yet implemented. Include top 10 error tolerant match
236 IH_INCLUDE_TOP_DECOY_MATCHES = 0x0008, //!< Not yet implemented. Include top decoy matche
237 IH_INCLUDE_TOP_10_DECOY_MATCHES = 0x0010 //!< Not yet implemented. Include top 10 decoy matches */
238 };
239
241
248 {
249 HOMTHR_RANK1 = 1,
250 HOMTHR_RANK2 = 2,
251 HOMTHR_RANK3 = 3,
252 HOMTHR_RANK4 = 4,
253 HOMTHR_RANK5 = 5,
254 HOMTHR_RANK6 = 6,
255 HOMTHR_RANK7 = 7,
256 HOMTHR_RANK8 = 8,
257 HOMTHR_RANK9 = 9,
258 HOMTHR_RANK10 = 10,
259 HOMTHR_RANK11 = 11,
260 HOMTHR_RANK12 = 12,
261 HOMTHR_RANK13 = 13,
262 HOMTHR_RANK14 = 14,
263 HOMTHR_RANK15 = 15,
264 HOMTHR_RANK16 = 16,
265 HOMTHR_RANK17 = 17,
266 HOMTHR_RANK18 = 18,
267 HOMTHR_RANK19 = 19,
268 HOMTHR_RANK20 = 20,
269
270 HOMTHR_FASTA = -1,
271 HOMTHR_SL = -2
272 };
273
275
279 {
285 QCS_OK_MULTIPLE_MATCHES
286 };
287
289
296 enum FLAGS
297 {
298
299 MSRES_NOFLAG = 0x00000000,
300 MSRES_GROUP_PROTEINS = 0x00000001,
301 MSRES_SHOW_SUBSETS = 0x00000002,
302 MSRES_SUBSETS_DIFF_PROT = 0x00000004,
303 MSRES_REQUIRE_BOLD_RED = 0x00000008,
304 MSRES_SHOW_ALL_FROM_ERR_TOL = 0x00000010,
305 MSRES_IGNORE_PMF_MIXTURE = 0x00000020,
306 MSRES_MUDPIT_PROTEIN_SCORE = 0x00000040,
307 MSRES_DECOY = 0x00000080,
308 MSRES_INTEGRATED_ERR_TOL = 0x00000100,
309 MSRES_ERR_TOL = 0x00000200,
310 MSRES_MAXHITS_OVERRIDES_MINPROB = 0x00000400,
311 MSRES_CLUSTER_PROTEINS = 0x00000800,
312
313 MSRES_DUPE_INCL_IN_SCORE_NONE = 0x00000000,
314 MSRES_DUPE_INCL_IN_SCORE_A = 0x00002000,
315 MSRES_DUPE_INCL_IN_SCORE_B = 0x00004000,
316 MSRES_DUPE_INCL_IN_SCORE_C = 0x00008000,
317 MSRES_DUPE_INCL_IN_SCORE_D = 0x00010000,
318 MSRES_DUPE_INCL_IN_SCORE_E = 0x00020000,
319 MSRES_DUPE_INCL_IN_SCORE_F = 0x00040000,
320 MSRES_DUPE_INCL_IN_SCORE_G = 0x00080000,
321 MSRES_DUPE_INCL_IN_SCORE_H = 0x00100000,
322 MSRES_DUPE_INCL_IN_SCORE_I = 0x00200000,
323 MSRES_DUPE_REMOVE_NONE = 0x00400000,
324 MSRES_DUPE_REMOVE_A = 0x00800000,
325 MSRES_DUPE_REMOVE_B = 0x01000000,
326 MSRES_DUPE_REMOVE_C = 0x02000000,
327 MSRES_DUPE_REMOVE_D = 0x04000000,
328 MSRES_DUPE_REMOVE_E = 0x08000000,
329 MSRES_DUPE_REMOVE_F = 0x10000000,
330 MSRES_DUPE_REMOVE_G = 0x20000000,
331 MSRES_DUPE_REMOVE_H = 0x40000000,
332 #ifndef SWIG // 'live' version for C++ compiler
333 MSRES_DUPE_REMOVE_I = 0x80000000,
334 #else // SWIG version
335 // The C# 'unchecked' keyword is only used when generating C# bindings.
336 MSRES_DUPE_REMOVE_I = unchecked((int)0x80000000),
337 #endif
338 MSRES_DUPE_DEFAULT = 0x04800000
339 };
340
341
344 {
345 DM_FASTA = 0,
346 DM_SPECTRAL_LIBRARY = 1,
347 DM_BOTH = 2,
348
349 DM_FASTA_FIRST_PASS = 3,
350 DM_FASTA_SECOND_PASS = 4,
351 };
352
354
360 {
361 UPR_WITHIN_FAMILY = 0x0001,
362 UPR_WITHIN_FAMILY_MEMBER = 0x0002,
363 UPR_IGNORE_SUBSET_PROTEINS = 0x0004,
364
365 UPR_DEFAULT = (UPR_WITHIN_FAMILY_MEMBER + UPR_IGNORE_SUBSET_PROTEINS)
366 };
367
369
373 {
374 TT_HOMOLOGY = 0x0000,
375 TT_IDENTITY = 0x0001,
376 TT_PEPSUM_DEFAULT = 0x0002
377 };
378
379
382 {
383 DS_COUNT_PSM = 0,
384 DS_COUNT_SEQUENCE = 1
385 };
386
387 enum QMATCH_PLUGHOLE_INDEX_SECTIONS {
388 QMATCH_PLUGHOLE_SEC_SUMMARY = 0,
389 QMATCH_PLUGHOLE_SEC_DECOYSUMMARY = 1,
390 QMATCH_PLUGHOLE_SEC_ERRTOLSUMMARY = 2,
391 QMATCH_PLUGHOLE_SEC_LIBRARYSUMMARY= 3,
392 QMATCH_PLUGHOLE_SEC_CROSSLINK_SUMMARY = 4,
393 QMATCH_PLUGHOLE_SEC_ERRTOLDECOYSUMMARY = 5,
394 QMATCH_PLUGHOLE_SEC_LAST = 6
395 };
396
397 enum DECOY_STATS_THRESHOLD_TYPE { DS_IDENTITY = 0, DS_HOMOLOGY = 1 };
398 enum {
399 DECOY_STATS_TD_LEVELS = 2,
400 DECOY_STATS_COUNT_TYPE_LEVELS = 2,
401 DECOY_STATS_THR_TYPE_LEVELS = 3,
402 DECOY_STATS_DB_TYPE_LEVELS = 5
403 };
404
405
406 typedef std::map<std::string, std::set<std::pair<int, int> >, LexicoCompare > map_mod_value_to_qp;
407
408 enum COMPLETED_TASKS {
409 CT_NONE = 0x0000,
410 CT_LOADQUERIES = 0x0001,
411 CT_SRCRANKINITIALISED = 0x0002,
412 CT_PERCOLATORRESULTS = 0x0004,
413 CT_INFERENCING = 0x0008,
414 CT_UNASSIGNEDLIST = 0x0010,
415 CT_COMPONENTINTENSITIES = 0x0020,
416 CT_COUNTMODS = 0x0040,
417 CT_CREATECDB = 0x0080,
418 CT_ALLDONE = 0xFFFF
419 };
420
421 public:
422
423 // Some useful types
424 typedef std::set<ms_protein> proteinSet; // ms_protein has operator< which compares accession and dbIdx
425 typedef std::pair<std::string, int> acc_dbidx_t;
426 typedef std::set<acc_dbidx_t> acc_dbidx_set_t;
427 typedef std::set<std::pair<int, int> > q_p_set_t;
428 typedef std::vector<acc_dbidx_t> acc_dbidx_vect_t;
429 typedef std::vector<std::pair<int, int> > q_p_vect_t;
430
431 // From ms_peptidesummary
432 typedef std::set<std::pair<int,int> > hitAndFamily_t;
433
435 ms_mascotresults();
436
437 virtual ~ms_mascotresults();
438
440 const ms_mascotresfilebase& getResfile() const;
441
442#ifndef SWIG
443 std::shared_ptr<const msparser_internal::ms_mascotresultsbase> getResultsPtr() const;
444 std::shared_ptr<msparser_internal::ms_mascotresultsbase> getResultsPtr();
445#endif
447 virtual bool createSummary();
448
449#ifndef SWIG // Can't / don't want to allow std::string * as OUTPUT in Java and C#
451 bool getCreateSummaryProgress(int * cspTotalPercentComplete,
452 unsigned int * cspCurrTask,
453 int * cspCurrTaskPercentageComplete,
454 std::string * cspAccession,
455 int * cspHit,
456 int * cspQuery,
457 std::string * cspKeepAliveText) const;
458
459 bool getCreateSummaryProgress(int * cspTotalPercentComplete,
460 unsigned int * cspCurrTask,
461 int * cspCurrTaskPercentageComplete,
462 std::string & cspAccession,
463 int * cspHit,
464 int * cspQuery,
465 std::string & cspKeepAliveText) const {
466 return getCreateSummaryProgress(cspTotalPercentComplete, cspCurrTask, cspCurrTaskPercentageComplete, &cspAccession, cspHit, cspQuery, &cspKeepAliveText);
467 }
468#else // SWIG Multiple return values
469 bool getCreateSummaryProgress(int * OUTPUT,
470 unsigned int * OUTPUT,
471 int * OUTPUT,
472 std::string & OUTPUT,
473 int * OUTPUT,
474 int * OUTPUT,
475 std::string & OUTPUT) const;
476#endif
478 void cancelCreateSummary(bool newValue = true);
479
481 virtual ms_protein * getHit(const int hit, const int memberNumber = 0) const;
482
484 virtual void freeHit(const int hit);
485
487 virtual int getNumberOfHits() const;
488
490 virtual int getNumberOfFamilyMembers() const;
491
493 std::string getProteinDescription(const char * accession, const int dbIdx = 1) const;
494
496 double getProteinMass(const char * accession, const int dbIdx = 1) const;
497
499 virtual double getProteinEmPAI(const char *accession, const int dbIdx = 1, const int length = -1) const;
500
502 bool isEmPAIallowed() const;
503
505 virtual bool anyEmPAI() const;
506
508 double getSequenceMass(const char * seq) const;
509
511 void getProteinTaxonomyIDs(const char * accession, const int dbIdx,
512 std::vector<int> & gpt_ids, std::vector<std::string> & gpt_accessions) const;
513
515 virtual const ms_protein * getProtein(const char * accession, const int dbIdx = 1) const;
516
518 virtual const ms_protein * getComponentProtein(const char * accession, const int dbIdx = 1) const;
519
521 virtual ms_protein * getNextSimilarProtein(const int masterHit, const int id) const;
522
524 virtual ms_protein * getNextSimilarProteinOf(const char * masterAccession, const int masterDB, const int id) const;
525
527 virtual ms_protein * getNextFamilyProtein(const int masterHit, const int id) const;
528
529
531 virtual ms_protein * getNextSubsetProtein(const int masterHit, const int id,
532 const bool searchWholeFamily = true) const;
533
535 virtual ms_protein * getNextSubsetProteinOf(const char * masterAccession, const int masterDB, const int id) const;
536
538 virtual ms_peptide getPeptide(const int q, const int p) const = 0;
539
541 virtual bool getPeptide(const int q, const int p, ms_peptide * & pep) const = 0;
542
544 virtual double getIonsScore(const int q, const int p, const bool decoy) const = 0;
545
547 virtual bool isPeptideUnique(const int q, const int p, const UNIQUE_PEP_RULES rules = UPR_DEFAULT) const = 0;
548
550 virtual int getQmatch(const int query) const;
551
553 virtual int getQmatch(const int query, const ms_mascotresfile_dat::section sec) const;
554
556 virtual int getPeptideIdentityThreshold(const int query, double OneInXprobRnd, DB_MATCH_TYPE dbType = DM_FASTA) const;
557
559 virtual int getAvePeptideIdentityThreshold(double OneInXprobRnd, DB_MATCH_TYPE dbType = DM_FASTA) const;
560
562 virtual int getMaxPeptideIdentityThreshold(double OneInXprobRnd, DB_MATCH_TYPE dbType = DM_FASTA) const;
563
565 double getPeptideThreshold(const int query, double OneInXprobRnd, const int rank=1, const THRESHOLD_TYPE thresholdType=TT_PEPSUM_DEFAULT) const;
566
567 enum ERROR_TOLERANT_PEPTIDE { ETPEP_YES, ETPEP_NO, ETPEP_UNKNOWN };
568
570 virtual int getProteinScoreCutoff(double OneInXprobRnd) const = 0;
571
573 virtual int getProteinThreshold(double OneInXprobRnd) const;
574
576 virtual int getHomologyThreshold(const int query,
577 double OneInXprobRnd,
578 const int rank=1) const;
579
581 virtual int getHomologyThresholdForHistogram(double OneInXprobRnd, DB_MATCH_TYPE dbType = DM_FASTA) const;
582
584 virtual int getProbFromScore(const double score) const;
585
587 virtual double getPeptideExpectationValue(const double score,
588 const int query,
589 const int rank = 0) const;
590
592 virtual double getProbOfPepBeingRandomMatch(const double score,
593 const int query) const;
594
596 virtual double getProteinExpectationValue(const double score) const;
597
599 virtual double getProbOfProteinBeingRandomMatch(const double score) const;
600
602 virtual std::string getProteinsWithThisPepMatch(const int q, const int p, const bool quotes=false) = 0;
603
605 virtual std::vector<std::string> getAllProteinsWithThisPepMatch(const int q, const int p,
606 std::vector<int> & start,
607 std::vector<int> & end,
608 std::vector<std::string> &pre,
609 std::vector<std::string> &post,
610 std::vector<int> & frame,
611 std::vector<int> & multiplicity,
612 std::vector<int> & db) const = 0;
613
615 virtual std::vector<std::string> getAllProteinsWithThisPepMatch(const int q, const int p,
616 std::vector<int> & start,
617 std::vector<int> & end,
618 std::vector<std::string> &pre,
619 std::vector<std::string> &post,
620 std::vector<int> & frame,
621 std::vector<int> & multiplicity,
622 std::vector<int> & db,
623 std::vector<int> & psmComponent) const = 0;
624
626 virtual int getAllFamilyMembersWithThisPepMatch(const int hit,
627 const int q,
628 const int p,
629 std::vector< int >& db,
630 std::vector< std::string >& acc,
631 std::vector< int >& dupe_status) const = 0;
632
633
635 virtual std::string getErrTolModString(const int q, const int p) const = 0;
636
638 virtual std::string getLibraryModString(const int q, const int p) const = 0;
639
641 virtual std::string getErrTolModMasterString(const int q, const int p) const = 0;
642
644 virtual std::string getErrTolModSlaveString(const int q, const int p) const = 0;
645
647 virtual std::string getErrTolModPepString(const int q, const int p) const = 0;
648
650 virtual std::string getErrTolModReqPepString(const int q, const int p) const = 0;
651
653 virtual std::string getErrTolModName(const int q, const int p, std::string * modString = NULL) const;
654
656 virtual double getErrTolModDelta(const int q, const int p, std::string * modString = NULL, std::string * deltaAsString = NULL) const;
657
659 virtual double getErrTolModNeutralLoss(const int q, const int p) const;
660
662 virtual std::vector<double> getErrTolModMasterNeutralLoss(const int q, const int p) const;
663
665 virtual std::vector<double> getErrTolModSlaveNeutralLoss(const int q, const int p) const;
666
668 virtual std::vector<double> getErrTolModPepNeutralLoss(const int q, const int p) const;
669
671 virtual std::vector<double> getErrTolModReqPepNeutralLoss(const int q, const int p) const;
672
674 virtual std::string getErrTolOriginalNaSeq(const int q, const int p) const;
675
677 virtual std::string getErrTolModifiedNaSeq(const int q, const int p) const;
678
680 std::string getVarModsForQP(const int q, const int p, const ms_peptide & pep,
681 const ms_peptide::PSM psmComponent,
682 int * numETMods = NULL, int * numLibraryMods = NULL,
683 std::set<std::string> * listMods = NULL) const;
684
686 std::string getLocalModsForQP(const int q, const int p, const ms_peptide & pep, const ms_peptide::PSM psmComponent, std::set<std::string> * listMods = NULL) const;
687
689 std::string getLibraryModsForQP(const int q, const int p, const ms_peptide & pep, std::set<std::string> * listMods = NULL) const;
690
692 virtual std::string getReadableVarMods(const int q, const int p,
693 const int numDecimalPlaces=2,
694 const ms_peptide::PSM psmComponent = ms_peptide::PSM_COMPLETE) const;
695
697 virtual bool anyNumDiscoveredMods() const;
698
700 virtual std::vector<int> getNumDiscoveredFixedMods(const int num,
701 std::vector<std::string> &positions,
702 std::vector<std::string> &sites) const;
703
705 virtual std::vector<int> getNumDiscoveredVariableMods(const int num,
706 std::vector<std::string> &positions,
707 std::vector<std::string> &sites,
708 std::vector<double> &deltas,
709 std::vector<std::string> &names) const;
710
712 virtual std::vector<int> getNumDiscoveredVariableMods(const int num, std::vector<std::string> &positions, std::vector<std::string> &sites) const;
713
715 virtual std::vector<std::string> getDiscoveredLocalModNames() const;
716
718 virtual std::vector<double> getDiscoveredLocalModDeltas(std::vector<std::string> * vecDeltaStrings = NULL) const;
719
721 virtual std::vector<int> getNumDiscoveredLocalMods(const std::string modName, std::vector<std::string> &positions, std::vector<std::string> &sites) const;
722
724 virtual std::vector<std::string> getDiscoveredErrTolModNames() const;
725
727 virtual std::vector<double> getDiscoveredErrTolModDeltas(std::vector<std::string> * vecDeltaStrings = NULL) const;
728
730 virtual std::vector<int> getNumDiscoveredErrTolMods(const std::string modName, std::vector<std::string> &positions, std::vector<std::string> &sites) const;
731
733 std::vector<int> getNumDiscoveredLibraryMods(const int modId, std::vector<std::string> &positions, std::vector<std::string> &sites) const;
734
736 std::vector<int> getNumDiscoveredIntactLinks(std::vector<int> &varModNum1,
737 std::vector<std::string> &position1,
738 std::vector<std::string> &site1,
739 std::vector<int> &varModNum2,
740 std::vector<std::string> &position2,
741 std::vector<std::string> &site2,
742 std::vector<int> &numLinkedPeptides) const;
743
745 virtual int getNumDiscoveredNonSpecCleavage() const;
746
748 virtual std::string getTagString(const int q, const int p) const = 0;
749
751 virtual int getTagStart(const int q, const int p, const int tagNumber) const;
752
754 virtual int getTagEnd(const int q, const int p, const int tagNumber) const;
755
757 virtual int getTagSeries(const int q, const int p, const int tagNumber) const;
758
760 virtual int getTagDeltaRangeStart(const int q, const int p) const = 0;
761
763 virtual int getTagDeltaRangeEnd(const int q, const int p) const = 0;
764
766 virtual std::string getTerminalResiduesString(const int q, const int p, const ms_peptide::PSM psmComponent = ms_peptide::PSM_COMPLETE) const = 0;
767
769 virtual std::string getComponentString(const int q, const int p, const ms_peptide::PSM psmComponent = ms_peptide::PSM_COMPLETE) const = 0;
770
772 virtual int getMaxRankValue() const;
773
775 virtual std::vector<int> getIonsScoreHistogram(IONS_HISTOGRAM flags = IH_INCLUDE_TOP_MATCHES, DB_MATCH_TYPE dbType = DM_FASTA) const;
776
778 double getToleranceInDalton(bool & needMass, const double * const pMass = NULL) const;
779
781 bool createUnassignedList(sortBy s = QUERY);
782
784 int getNumberOfUnassigned() const;
785
787 ms_peptide getUnassigned(const int num) const;
788
790 bool getUnassignedIsBold(const int num) const;
791
793 bool getUnassignedShowCheckbox(const int num) const;
794
796 ms_mascotresults_params getResultsParameters() const;
797
799 virtual bool getTreeClusterNodes(const int hit,
800 std::vector<int> &left,
801 std::vector<int> &right,
802 std::vector<double> &distance,
803 TREE_CLUSTER_METHOD tcm = TCM_PAIRWISE_MAXIMUM,
804 double *** reserved1 = 0,
805 unsigned int * reserved2 = 0) const;
806
808 virtual int findProteins(const int startHit,
809 const std::string & str,
810 const int dbIdx,
811 FIND_FLAGS item,
812 FIND_COMPARE_FLAGS compareFlags,
813 std::vector<std::string> & accessions,
814 std::vector<int> & dbIndexes) const = 0;
815
817 virtual int findProteinsByAccession(const int startHit,
818 const std::string & str,
819 const int dbIdx,
820 FIND_COMPARE_FLAGS compareFlags,
821 std::vector<std::string> & accessions,
822 std::vector<int> & dbIndexes) const = 0;
823
825 virtual int findProteinsByDescription(const int startHit,
826 const std::string & str,
827 FIND_COMPARE_FLAGS compareFlags,
828 std::vector<std::string> & accessions,
829 std::vector<int> & dbIndexes) const = 0;
830
832 virtual int findPeptides(const int startHit,
833 const std::string & str,
834 FIND_FLAGS item,
835 FIND_COMPARE_FLAGS compareFlags,
836 std::vector<int> & q,
837 std::vector<int> & p) const = 0;
838
841 const matrix_science::ms_peptide & peptide,
843 const matrix_science::ms_quant_method * method = NULL) const = 0;
844
846 virtual double getProteinScoreForHistogram(const int num) const;
847
849 bool isNA() const;
850
852
855 unsigned int getFlags() const;
856
858
862 unsigned int getFlags2() const;
863
865 int getMinPepLenInPepSummary() const;
866
868 virtual long getNumHitsAboveIdentity(double OneInXprobRnd, DECOY_STATS_COUNT_TYPE countType = DS_COUNT_PSM, DB_MATCH_TYPE dbType = DM_FASTA);
869
871 virtual long getNumDecoyHitsAboveIdentity(double OneInXprobRnd, DECOY_STATS_COUNT_TYPE countType = DS_COUNT_PSM, DB_MATCH_TYPE dbType = DM_FASTA);
872
874 virtual long getNumHitsAboveHomology(double OneInXprobRnd, DECOY_STATS_COUNT_TYPE countType = DS_COUNT_PSM, DB_MATCH_TYPE dbType = DM_FASTA);
875
877 virtual long getNumDecoyHitsAboveHomology(double OneInXprobRnd, DECOY_STATS_COUNT_TYPE countType = DS_COUNT_PSM, DB_MATCH_TYPE dbType = DM_FASTA);
878
880 virtual void setSubsetsThreshold(const double scoreFraction);
881
883 virtual double getProbabilityThreshold() const;
884
885 // //! Return the probability threshold used for error tolerant peptides.
886 virtual double getErrTolProbabilityThreshold() const;
887
888#ifndef SWIG
890 bool getThresholdForFDRAboveIdentity(double targetFDR, double *closestFDR, double *minProbability, int * numTargetMatches = 0, int * numDecoyMatches = 0);
891
893 bool getThresholdForFDRAboveIdentity(double targetFDR, DECOY_STATS_COUNT_TYPE countType, DB_MATCH_TYPE dbType, double *closestFDR, double *minProbability, int * numTargetMatches = 0, int * numDecoyMatches = 0);
894
896 bool getThresholdForFDRAboveHomology(double targetFDR, double *closestFDR, double *minProbability, int * numTargetMatches = 0, int * numDecoyMatches = 0);
897
899 bool getThresholdForFDRAboveHomology(double targetFDR, DECOY_STATS_COUNT_TYPE countType, DB_MATCH_TYPE dbType, double *closestFDR, double *minProbability, int * numTargetMatches = 0, int * numDecoyMatches = 0);
900
902 virtual bool getComponentIntensity(const int q, const int p, const std::string & componentName, double & value, double & rawValue) const = 0;
903#else // SWIG Multiple return values
904 // Don't supply default parameters for perl or python because these are defined as output parameters
905 bool getThresholdForFDRAboveIdentity(double targetFDR, double *OUTPUT, double *OUTPUT, int * OUTPUT, int * OUTPUT);
906 bool getThresholdForFDRAboveIdentity(double targetFDR, DECOY_STATS_COUNT_TYPE countType, DB_MATCH_TYPE dbType, double *OUTPUT, double *OUTPUT, int * OUTPUT, int * OUTPUT);
907 bool getThresholdForFDRAboveHomology(double targetFDR, double *OUTPUT, double *OUTPUT, int * OUTPUT, int * OUTPUT);
908 bool getThresholdForFDRAboveHomology(double targetFDR, DECOY_STATS_COUNT_TYPE countType, DB_MATCH_TYPE dbType, double *OUTPUT, double *OUTPUT, int * OUTPUT, int * OUTPUT);
909 virtual bool getComponentIntensity(const int q, const int p, const std::string & componentName, double & OUTPUT, double & OUTPUT) const;
910#endif
911
913 virtual std::vector<int> getPepsWithSameScore(const int q, const int p) const = 0;
931 bool queryRemoveThisPeptide(const unsigned short dupeFlags) const;
932
949 bool queryScoreThisPeptide(const unsigned short dupeFlags) const;
950
952 virtual bool loadPepMatchesForProteinFromCache(ms_protein * prot, const bool loadRelated=true) { return false; /*TODO*/}
953
955 virtual bool isValidQandP(const int q, const int p) const = 0;
956
958 std::string lookupParsedLocalModsStr(const ms_peptide *thisOnePep) const;
959
960
961 protected:
962 // Not safe to copy or assign this object.
963#ifndef SWIG
965 ms_mascotresults & operator=(const ms_mascotresults & rhs);
966
967 virtual double getQplughole(const int query, const ms_mascotresfile_dat::section sec) const;
968
969 virtual void getQmatchValuesFromCacheFile(const QMATCH_PLUGHOLE_INDEX_SECTIONS index) const {} ;
970 virtual void getPlugholeValuesFromCacheFile(const QMATCH_PLUGHOLE_INDEX_SECTIONS index) const {};
971
972#endif
973
974 // - Not documented - Get the 'corrected' ions score given multiplicity
975 double getIonsScoreCorrected(const double ionsScore,
976 const long multiplicity) const;
977
978
979 protected:
980 std::shared_ptr<msparser_internal::ms_mascotresultsbase> results_;
981
982 };
983 // end of resfile_group
985} // matrix_science namespace
986
987#endif // MS_MASCOTRESULTS_HPP
988
989/*------------------------------- End of File -------------------------------*/
section
Section names in the standard mascot results files.
Definition: ms_mascotresfile_dat.hpp:132
Class which provides constructor parameters for either ms_peptidesummary or ms_proteinsummary.
Definition: ms_mascotresults_params.hpp:32
Abstract class for either ms_peptidesummary or ms_proteinsummary.
Definition: ms_mascotresults.hpp:83
virtual std::string getTerminalResiduesString(const int q, const int p, const ms_peptide::PSM psmComponent=ms_peptide::PSM_COMPLETE) const =0
Return the complete terminal residue string from h1_q1_terms or q1_p1_terms.
virtual std::string getErrTolModReqPepString(const int q, const int p) const =0
Return the error tolerant mod required peptide neutral loss string from h1_q2_et_mods_reqpep or q1_p1...
virtual std::string getErrTolModSlaveString(const int q, const int p) const =0
Return the error tolerant mod slave neutral loss string from h1_q2_et_mods_slave or q1_p1_et_mods_sla...
virtual int findProteins(const int startHit, const std::string &str, const int dbIdx, FIND_FLAGS item, FIND_COMPARE_FLAGS compareFlags, std::vector< std::string > &accessions, std::vector< int > &dbIndexes) const =0
Find the next hit that contains proteins with the specified attributes.
virtual std::vector< std::string > getAllProteinsWithThisPepMatch(const int q, const int p, std::vector< int > &start, std::vector< int > &end, std::vector< std::string > &pre, std::vector< std::string > &post, std::vector< int > &frame, std::vector< int > &multiplicity, std::vector< int > &db, std::vector< int > &psmComponent) const =0
Return a complete list of proteins that contain this same peptide match.
virtual ms_peptide getPeptide(const int q, const int p) const =0
Return the ms_peptide object given the query and either the rank (ms_peptidesummary) or the hit (ms_p...
FIND_COMPARE_FLAGS
Flags to specify how comparisons are performed in the find functions.
Definition: ms_mascotresults.hpp:189
virtual bool isPeptideUnique(const int q, const int p, const UNIQUE_PEP_RULES rules=UPR_DEFAULT) const =0
Returns true if this peptide match is unique to one protein or one protein family.
virtual int getProteinScoreCutoff(double OneInXprobRnd) const =0
Return the 'protein' score value for cutting off results (different for peptide and protein summary).
TREE_CLUSTER_METHOD
Flags for getTreeClusterNodes().
Definition: ms_mascotresults.hpp:128
sortBy
Flags for createUnassignedList().
Definition: ms_mascotresults.hpp:95
@ QUERY
Sort the unassigned list by ascending query number - this is the same as ascending relative mass orde...
Definition: ms_mascotresults.hpp:96
@ SCORE
Sort the unassigned list by descending score.
Definition: ms_mascotresults.hpp:97
virtual int getTagDeltaRangeEnd(const int q, const int p) const =0
Return the second number from h1_q2_drange=0,256.
virtual int findProteinsByDescription(const int startHit, const std::string &str, FIND_COMPARE_FLAGS compareFlags, std::vector< std::string > &accessions, std::vector< int > &dbIndexes) const =0
Find the next hit that contains proteins with the specified description.
virtual std::string getErrTolModPepString(const int q, const int p) const =0
Return the error tolerant mod peptide neutral loss string from h1_q2_et_mods_pep or q1_p1_et_mods_pep...
virtual bool getComponentIntensity(const int q, const int p, const std::string &componentName, double &value, double &rawValue) const =0
Returns the component intensity for reporter or multiplex methods.
DECOY_STATS_COUNT_TYPE
Type of object counted by getNumHitsAboveIdentity() and friends.
Definition: ms_mascotresults.hpp:382
virtual std::string getTagString(const int q, const int p) const =0
Return the complete tag string from h1_q2_tag or q1_p1_tag.
virtual int findProteinsByAccession(const int startHit, const std::string &str, const int dbIdx, FIND_COMPARE_FLAGS compareFlags, std::vector< std::string > &accessions, std::vector< int > &dbIndexes) const =0
Find the next hit that contains proteins with the specified accession.
virtual std::string getErrTolModMasterString(const int q, const int p) const =0
Return the error tolerant mod primary neutral loss string from h1_q2_et_mods_master or q1_p1_et_mods_...
virtual std::string getLibraryModString(const int q, const int p) const =0
Return the modification string of the spectral library match from q1_p1_SLmod.
UNIQUE_PEP_RULES
Flags for isPeptideUnique().
Definition: ms_mascotresults.hpp:360
virtual std::string getErrTolModString(const int q, const int p) const =0
Return the complete error tolerant mod string from h1_q2_et_mods or q1_p1_et_mods.
virtual QUANT_COMPONENT_STATUS getQuantitationComponentForPeptide(const matrix_science::ms_peptide &peptide, matrix_science::ms_quant_component &component, const matrix_science::ms_quant_method *method=NULL) const =0
Get the component in the quantitation method that matches the peptide.
FIND_FLAGS
Flags for findPeptides() and findProteins().
Definition: ms_mascotresults.hpp:146
virtual std::vector< std::string > getAllProteinsWithThisPepMatch(const int q, const int p, std::vector< int > &start, std::vector< int > &end, std::vector< std::string > &pre, std::vector< std::string > &post, std::vector< int > &frame, std::vector< int > &multiplicity, std::vector< int > &db) const =0
Return a complete list of proteins that contain this same peptide match.
HOMOLOGY_THRESHOLD_SOURCE
Flags for getHomologyThreshold()
Definition: ms_mascotresults.hpp:248
virtual int findPeptides(const int startHit, const std::string &str, FIND_FLAGS item, FIND_COMPARE_FLAGS compareFlags, std::vector< int > &q, std::vector< int > &p) const =0
Find the next hit that contains peptides with the specified attribute.
virtual double getIonsScore(const int q, const int p, const bool decoy) const =0
Returns an ions score quickly without having to load an ms_peptide object.
virtual int getTagDeltaRangeStart(const int q, const int p) const =0
Return the first number from h1_q2_drange=0,256.
THRESHOLD_TYPE
Flags for getPeptideThreshold()
Definition: ms_mascotresults.hpp:373
virtual bool getPeptide(const int q, const int p, ms_peptide *&pep) const =0
Return the ms_peptide object given the query and either the rank (ms_peptidesummary) or the hit (ms_p...
DB_MATCH_TYPE
Type of matches counted by getNumHitsAboveIdentity() and friends, and type of score for getIonsScoreH...
Definition: ms_mascotresults.hpp:344
QUANT_COMPONENT_STATUS
Return codes for getQuantitationComponentForPeptide().
Definition: ms_mascotresults.hpp:279
@ QCS_ERROR_NO_METHOD
There is no quantitation method available (e.g. for protein summary).
Definition: ms_mascotresults.hpp:282
@ QCS_OK
The component was retrieved successfully.
Definition: ms_mascotresults.hpp:280
@ QCS_ERROR_BAD_COMPONENT_NAME
The peptide's component name in the Mascot results does not match any component in the quantitation m...
Definition: ms_mascotresults.hpp:284
@ QCS_ERROR_NO_COMPONENTS
There are no components specified in the quantitation method (e.g. for non-precursor method).
Definition: ms_mascotresults.hpp:283
@ QCS_OK_NO_MATCH
The quantitation method's components were searched successfully, no matching component was found.
Definition: ms_mascotresults.hpp:281
virtual int getAllFamilyMembersWithThisPepMatch(const int hit, const int q, const int p, std::vector< int > &db, std::vector< std::string > &acc, std::vector< int > &dupe_status) const =0
Return a list of (top level) family proteins that have a match to the specified q and p.
virtual std::string getComponentString(const int q, const int p, const ms_peptide::PSM psmComponent=ms_peptide::PSM_COMPLETE) const =0
Return q1_p2_comp string value; for h1_q2 this string is always empty.
IONS_HISTOGRAM
Flags for getIonsScoreHistogram().
Definition: ms_mascotresults.hpp:231
virtual std::vector< int > getPepsWithSameScore(const int q, const int p) const =0
Returns a list of 'p' values for peptides with the same score.
virtual std::string getProteinsWithThisPepMatch(const int q, const int p, const bool quotes=false)=0
Return a partial list of proteins that matched the same peptide.
FLAGS
Flags for the type of results.
Definition: ms_mascotresults.hpp:297
This class encapsulates a peptide from the mascot results file.
Definition: ms_peptide.hpp:57
PSM
Type of data to return from accessor methods.
Definition: ms_peptide.hpp:98
This class encapsulates a protein in the mascot results file.
Definition: ms_protein.hpp:57
An object of this class represent a single component element in quantitation.xml.
Definition: ms_quant_component.hpp:48
An object of this class represent a single quantitation method from quantitation.xml.
Definition: ms_quant_method.hpp:51