From 444110bc04ff28aae47843526fd4ab39b2ee57b1 Mon Sep 17 00:00:00 2001
From: Olivier Langella <olivier.langella@u-psud.fr>
Date: Tue, 30 Oct 2018 21:52:42 +0100
Subject: [PATCH] write FDR in ODS file as percentage, compute peptide FDR on
 all proteins

---
 src/core/identificationgroup.cpp | 19 +++++++++----------
 src/output/ods/groupingsheet.cpp |  4 ++--
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp
index 3b9029ed4..b1e394a11 100644
--- a/src/core/identificationgroup.cpp
+++ b/src/core/identificationgroup.cpp
@@ -93,11 +93,10 @@ IdentificationGroup::countPeptideMassSample(ValidationState state) const
   std::vector<std::size_t> count_peptide_mass_sample;
   for(auto &p_protein_match : _protein_match_list)
     {
-      if(p_protein_match->getValidationState() >= state)
-        {
-          p_protein_match->countPeptideMassSample(count_peptide_mass_sample,
-                                                  state);
-        }
+      // if(p_protein_match->getValidationState() >= state)
+      // {
+      p_protein_match->countPeptideMassSample(count_peptide_mass_sample, state);
+      // }
     }
   std::sort(count_peptide_mass_sample.begin(), count_peptide_mass_sample.end());
   auto last = std::unique(count_peptide_mass_sample.begin(),
@@ -113,11 +112,11 @@ IdentificationGroup::countDecoyPeptideMassSample(ValidationState state) const
     {
       if(p_protein_match->getProteinXtpSp().get()->isDecoy())
         {
-          if(p_protein_match->getValidationState() >= state)
-            {
-              p_protein_match->countPeptideMassSample(count_peptide_mass_sample,
-                                                      state);
-            }
+          // if(p_protein_match->getValidationState() >= state)
+          //  {
+          p_protein_match->countPeptideMassSample(count_peptide_mass_sample,
+                                                  state);
+          //}
         }
     }
   std::sort(count_peptide_mass_sample.begin(), count_peptide_mass_sample.end());
diff --git a/src/output/ods/groupingsheet.cpp b/src/output/ods/groupingsheet.cpp
index 4b7d3095a..156bcacd6 100644
--- a/src/output/ods/groupingsheet.cpp
+++ b/src/output/ods/groupingsheet.cpp
@@ -73,8 +73,8 @@ GroupingSheet::writeIdentificationGroup(IdentificationGroup *p_ident)
   //_p_writer->writeCell(p_ident->countSequence(ValidationState::grouped));
   _p_writer->writeCell(
     p_ident->countPeptideMassSample(ValidationState::grouped));
-  _p_writer->writeCell(p_ident->getProteinFdr(ValidationState::valid));
-  _p_writer->writeCell(p_ident->getPeptideMassFdr(ValidationState::valid));
+  _p_writer->writeCellPercentage(p_ident->getProteinFdr(ValidationState::valid));
+  _p_writer->writeCellPercentage(p_ident->getPeptideMassFdr(ValidationState::valid));
 }
 
 
-- 
GitLab