From 31e9f57b7d6bbbb78bb03253b1939227e7db1ad0 Mon Sep 17 00:00:00 2001
From: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Date: Fri, 12 May 2017 15:32:04 +0200
Subject: [PATCH] make sure that reversed protein is tagged

---
 src/input/xtandemsaxhandler.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/input/xtandemsaxhandler.cpp b/src/input/xtandemsaxhandler.cpp
index acef364d..ee79ad84 100644
--- a/src/input/xtandemsaxhandler.cpp
+++ b/src/input/xtandemsaxhandler.cpp
@@ -333,7 +333,12 @@ bool XtandemSaxHandler::endElement_note() {
     ////parent_gene=GRMZM2G083841</note>
     bool is_ok = true;
     if (_is_protein_description) {
-        _p_protein_match->getProteinXtpSp().get()->setDescription(_current_text.section(" ",1));
+        //_p_protein_match->getProteinXtpSp().get()->setDescription(_current_text.section(" ",1));
+	_p_protein_match->getProteinXtpSp().get()->setCompleteDescription(_current_text);
+	if (!_p_protein_match->getProteinXtpSp().get()->getAccession().endsWith(":reversed") && _p_protein_match->getProteinXtpSp().get()->getDescription().endsWith(":reversed")) {
+	  //to fit most cases, just check that the :reversed chars added by X!Tandem are not in the description. if so, then add it too in the accession
+	  _p_protein_match->getProteinXtpSp().get()->setAccession(QString("%1%2").arg(_p_protein_match->getProteinXtpSp().get()->getAccession()).arg(":reversed"));
+	}
     }
     else {
 
-- 
GitLab