From 3862ecde759388bd6e61ca156519ca45493b3f02 Mon Sep 17 00:00:00 2001 From: Olivier Langella <olivier.langella@u-psud.fr> Date: Fri, 9 Nov 2018 10:48:47 +0100 Subject: [PATCH] display separately fdr on psm and on peptides --- src/core/identificationgroup.cpp | 10 ++++++++++ src/core/identificationgroup.h | 6 ++++++ src/gui/project_view/project_view.ui | 22 ++++++++++++++++++---- src/gui/project_view/projectwindow.cpp | 12 ++++++++++-- src/output/ods/groupingsheet.cpp | 9 +++++++-- 5 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index b1e394a11..13178ddf3 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -442,6 +442,16 @@ IdentificationGroup::getTabName() const return _ms_run_list[0]->getSampleName(); } +pappso::pappso_double +IdentificationGroup::getPsmFdr(ValidationState state) const +{ + + pappso::pappso_double total_peptide = countPeptideEvidence(state); + pappso::pappso_double false_peptide = countDecoyPeptideEvidence(state); + + return (false_peptide / total_peptide); +} + pappso::pappso_double IdentificationGroup::getPeptideMassFdr(ValidationState state) const diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h index 7ec739ac5..f723d8b7f 100644 --- a/src/core/identificationgroup.h +++ b/src/core/identificationgroup.h @@ -125,6 +125,12 @@ class IdentificationGroup pappso::pappso_double getPeptideMassFdr(ValidationState state = ValidationState::valid) const; + /** @brief get False Discovery Rate of psm, peptide spectrum match (unique + * PeptideEvidence object) + */ + pappso::pappso_double + getPsmFdr(ValidationState state = ValidationState::valid) const; + /** @brief validate or invalidate peptides and proteins based automatic * filters and manual checks diff --git a/src/gui/project_view/project_view.ui b/src/gui/project_view/project_view.ui index af88d8cd4..d37feea53 100644 --- a/src/gui/project_view/project_view.ui +++ b/src/gui/project_view/project_view.ui @@ -191,7 +191,7 @@ <string>FDR</string> </property> <layout class="QGridLayout" name="gridLayout_4"> - <item row="0" column="1"> + <item row="1" column="1"> <widget class="QLabel" name="peptide_fdr_label"> <property name="toolTip"> <string/> @@ -201,21 +201,21 @@ </property> </widget> </item> - <item row="1" column="0"> + <item row="2" column="0"> <widget class="QLabel" name="label_3"> <property name="text"> <string>FDR on proteins</string> </property> </widget> </item> - <item row="0" column="0"> + <item row="1" column="0"> <widget class="QLabel" name="label"> <property name="text"> <string>FDR on peptides</string> </property> </widget> </item> - <item row="1" column="1"> + <item row="2" column="1"> <widget class="QLabel" name="protein_fdr_label"> <property name="toolTip"> <string/> @@ -225,6 +225,20 @@ </property> </widget> </item> + <item row="0" column="1"> + <widget class="QLabel" name="psm_fdr_label"> + <property name="text"> + <string>0 %</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>FDR on psm</string> + </property> + </widget> + </item> </layout> </widget> </item> diff --git a/src/gui/project_view/projectwindow.cpp b/src/gui/project_view/projectwindow.cpp index 2d8240d6c..6a0aae86b 100644 --- a/src/gui/project_view/projectwindow.cpp +++ b/src/gui/project_view/projectwindow.cpp @@ -272,19 +272,27 @@ ProjectWindow::computeFdr() pappso::pappso_double false_prot = 0; pappso::pappso_double total_peptide = 0; pappso::pappso_double false_peptide = 0; + pappso::pappso_double total_psm = 0; + pappso::pappso_double false_psm = 0; for(IdentificationGroup *identification_group : _project_sp.get()->getIdentificationGroupList()) { total_prot += identification_group->countProteinMatch(state); false_prot += identification_group->countDecoyProteinMatch(state); - total_peptide += identification_group->countPeptideEvidence(state); - false_peptide += + total_psm += identification_group->countPeptideEvidence(state); + false_psm += identification_group->countDecoyPeptideEvidence(state); + + total_peptide += identification_group->countPeptideMassSample(state); + false_peptide += + identification_group->countDecoyPeptideMassSample(state); } ui->protein_fdr_label->setText(QString("%1 %").arg( QString::number((false_prot / total_prot) * 100.0, 'f', 2))); ui->peptide_fdr_label->setText(QString("%1 %").arg( QString::number((false_peptide / total_peptide) * 100.0, 'f', 2))); + ui->psm_fdr_label->setText(QString("%1 %").arg( + QString::number((false_psm / total_psm) * 100.0, 'f', 2))); } catch(pappso::PappsoException exception_pappso) { diff --git a/src/output/ods/groupingsheet.cpp b/src/output/ods/groupingsheet.cpp index 156bcacd6..cfebe71c9 100644 --- a/src/output/ods/groupingsheet.cpp +++ b/src/output/ods/groupingsheet.cpp @@ -75,6 +75,7 @@ GroupingSheet::writeIdentificationGroup(IdentificationGroup *p_ident) p_ident->countPeptideMassSample(ValidationState::grouped)); _p_writer->writeCellPercentage(p_ident->getProteinFdr(ValidationState::valid)); _p_writer->writeCellPercentage(p_ident->getPeptideMassFdr(ValidationState::valid)); + _p_writer->writeCellPercentage(p_ident->getPsmFdr(ValidationState::valid)); } @@ -106,11 +107,15 @@ GroupingSheet::writeHeaders() "peptide sequence+modifications+sample name"); _p_writer->writeCell("peptide/mass/sample"); _p_writer->setCellAnnotation( - "FDR at the protein level (number of decoy valid proteins / totale number " + "FDR at the protein level (number of decoy valid proteins / total number " "of valid proteins)"); _p_writer->writeCell("prot FDR"); _p_writer->setCellAnnotation( - "FDR at the peptide level (number of decoy valid peptides / totale number " + "FDR at the peptide level (number of decoy valid peptides / total number " "of valid peptides)"); _p_writer->writeCell("pep FDR"); + _p_writer->setCellAnnotation( + "FDR at the peptide spectrum match (peptide evidences for each association of a spectrum to a peptide, overall identification engines) level (number of decoy valid psms / total number " + "of valid peptides)"); + _p_writer->writeCell("psm FDR"); } -- GitLab