diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c08b83a5b2def798f5ddd036ae85b125b688a79b..a16ae686e980e6c988e538b86a716e1881b44c41 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,11 +27,11 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} ${Qt5
 
 
 #sudo apt-get install libpappsomspp-dev
-FIND_PACKAGE( Pappsomspp REQUIRED )
+#FIND_PACKAGE( Pappsomspp REQUIRED )
 # SET (PAPPSOMSPP_DIR  "/home/olivier/eclipse/git/pappsomspp")
-# SET (PAPPSOMSPP_DIR  "/home/langella/developpement/git/pappsomspp")
-# SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
-# SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/cbuild/src/libpappsomspp-qt4.so")
+ SET (PAPPSOMSPP_DIR  "/home/langella/developpement/git/pappsomspp")
+ SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
+ SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/cbuild/src/libpappsomspp-qt4.so")
 
 
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)
diff --git a/src/core/proteinmatch.cpp b/src/core/proteinmatch.cpp
index f0c4cdd8ae17019ed2df0d67f4e836a05b43bb6a..a03347afc13dfda4bedf4a623b5011bfaa52c1e8 100644
--- a/src/core/proteinmatch.cpp
+++ b/src/core/proteinmatch.cpp
@@ -23,6 +23,7 @@
 
 #include "proteinmatch.h"
 #include <pappsomspp/grouping/grpprotein.h>
+#include <pappsomspp/pappsoexception.h>
 #include <set>
 #include <cmath>
 
@@ -308,8 +309,14 @@ pappso::pappso_double ProteinMatch::getEvalue(const MsRun * sp_msrun_id) const {
 }
 
 pappso::pappso_double ProteinMatch::getPAI(const MsRun * sp_msrun_id) const {
+    try {
     pappso::pappso_double PAI =  (pappso::pappso_double) countPeptideMassCharge(ValidationState::validAndChecked ,sp_msrun_id) / (pappso::pappso_double) _protein_sp.get()->countTrypticPeptidesForPAI();
     return PAI;
+    
+    }
+    catch (pappso::PappsoException error) {
+        throw pappso::PappsoException(QObject::tr("Error computing PAI for protein %1 :\n%2").arg(this->getProteinXtpSp().get()->getAccession()).arg(error.qwhat()));
+    }
 }
 
 pappso::pappso_double ProteinMatch::getEmPAI(const MsRun * sp_msrun_id) const {
diff --git a/src/core/proteinxtp.cpp b/src/core/proteinxtp.cpp
index 0b5935773f87782262415272c8dcf30c171e437c..3f468ea4ed66f180284c347b2758611ea4e1c533 100644
--- a/src/core/proteinxtp.cpp
+++ b/src/core/proteinxtp.cpp
@@ -23,6 +23,7 @@
 
 #include "proteinxtp.h"
 #include <pappsomspp/protein/enzyme.h>
+#include <pappsomspp/pappsoexception.h>
 
 ProteinXtp::ProteinXtp():pappso::Protein()
 {
@@ -74,8 +75,14 @@ QString ProteinXtp::getOnlyAminoAcidSequence() const {
 }
 
 pappso::pappso_double ProteinXtp::getMass() const {
-    pappso::Peptide peptide(getOnlyAminoAcidSequence());
+    try {
+    pappso::Peptide peptide(getOnlyAminoAcidSequence().replace("X",""));
     return peptide.getMass();
+    
+    }
+    catch (pappso::PappsoException error) {
+        throw pappso::PappsoException(QObject::tr("Error computing mass for protein %1 :\n%2").arg(getAccession()).arg(error.qwhat()));
+    }
 }
 
 class DigestionHandler: public pappso::EnzymeProductInterface {
@@ -89,11 +96,12 @@ public:
 
 unsigned int ProteinXtp::countTrypticPeptidesForPAI() const {
     qDebug() << "ProteinXtp::countTrypticPeptidesForPAI begin";
+    try {
     pappso::Enzyme kinase;
     kinase.setMiscleavage(0);
     DigestionHandler digestion;
 
-    pappso::ProteinSp protein = std::make_shared<const pappso::Protein>(this->getDescription(),this->getOnlyAminoAcidSequence());
+    pappso::ProteinSp protein = std::make_shared<const pappso::Protein>(this->getDescription(),this->getOnlyAminoAcidSequence().replace("X",""));
     kinase.eat(0,protein,false,digestion);
 
     unsigned int count = 0;
@@ -105,6 +113,11 @@ unsigned int ProteinXtp::countTrypticPeptidesForPAI() const {
         }
     }
 
-    return count;
     qDebug() << "ProteinXtp::countTrypticPeptidesForPAI end";
+    return count;
+    
+    }
+    catch (pappso::PappsoException error) {
+        throw pappso::PappsoException(QObject::tr("Error in countTrypticPeptidesForPAI for protein %1 :\n%2").arg(getAccession()).arg(error.qwhat()));
+    }
 }
diff --git a/src/output/ods/proteinsheet.cpp b/src/output/ods/proteinsheet.cpp
index a16bbff3aed9be818759980fab935be3fefc971e..150bc996fd62fe26e7059eccf37b670de98b3ca7 100644
--- a/src/output/ods/proteinsheet.cpp
+++ b/src/output/ods/proteinsheet.cpp
@@ -30,6 +30,7 @@
 #include "proteinsheet.h"
 #include "../../core/identificationgroup.h"
 #include <pappsomspp/utils.h>
+#include <pappsomspp/pappsoexception.h>
 
 ProteinSheet::ProteinSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) {
     _p_writer = p_writer;
@@ -102,8 +103,10 @@ void ProteinSheet::writeIdentificationGroup(IdentificationGroup * p_ident) {
 
 
 void ProteinSheet::writeOneProtein(const GroupingGroup * p_group, const ProteinMatch * p_protein_match) {
+    try {
     _p_writer->writeLine();
 
+    qDebug() << "ProteinSheet::writeOneProtein begin" ;
     ValidationState validation_state = ValidationState::validAndChecked;
 
     pappso::GrpProtein * p_grp_protein = p_protein_match->getGrpProteinSp().get();
@@ -140,6 +143,7 @@ void ProteinSheet::writeOneProtein(const GroupingGroup * p_group, const ProteinM
 
 
     _p_writer->writeCell(p_protein_match->countPeptideMassCharge(validation_state));
+    qDebug() << "ProteinSheet::writeOneProtein tryptic" ;
     _p_writer->writeCell(p_protein->countTrypticPeptidesForPAI());
     // _p_writer->writeCell("PAI");
     // _p_writer->writeCell(new Double((float) hashProt
@@ -160,5 +164,10 @@ void ProteinSheet::writeOneProtein(const GroupingGroup * p_group, const ProteinM
 
     //number of MS sample
     _p_writer->writeCell(p_protein_match->countDistinctMsSamples(validation_state));
-
+    
+    qDebug() << "ProteinSheet::writeOneProtein end" ;
+    }
+    catch (pappso::PappsoException error) {
+        throw pappso::PappsoException(QObject::tr("Error writing protein %1 :\n%2").arg(p_protein_match->getProteinXtpSp().get()->getAccession()).arg(error.qwhat()));
+    }
 }
diff --git a/src/output/ods/spectrasheet.cpp b/src/output/ods/spectrasheet.cpp
index feec26b640f5c6fa9b2a7e87c7bfa76feedc7033..90f179fe18e61df6006ad4ff8ef81cc439529130 100644
--- a/src/output/ods/spectrasheet.cpp
+++ b/src/output/ods/spectrasheet.cpp
@@ -35,7 +35,7 @@
 SpectraSheet::SpectraSheet (OdsExport * p_ods_export, CalcWriterInterface * p_writer, const Project * p_project): _p_project(p_project) {
     _p_ods_export = p_ods_export;
     _p_writer = p_writer;
-    p_writer->writeSheet("peptides");
+    p_writer->writeSheet("spectra");
 
     std::vector<IdentificationGroup *> identification_list = p_project->getIdentificationGroupList();
     for (IdentificationGroup * p_ident:identification_list) {
@@ -90,12 +90,12 @@ void SpectraSheet::writeBestPeptideMatch(const GroupingGroup * p_group,const Pep
     _p_writer->writeCell(p_peptide_match->getGrpPeptideSp().get()->getGroupingId());
     _p_writer->clearTableCellStyleRef();
     _p_writer->writeCell(p_peptide_match->getMsRunP()->getSampleName());
-    _p_writer->writeCell(QString("%1").arg(p_peptide_match->getScan()));
-    _p_writer->writeCell(QString::number(p_peptide_match->getRetentionTime(), 'f', 2));
+    _p_writer->writeCell(p_peptide_match->getScan());
+    _p_writer->writeCell(p_peptide_match->getRetentionTime());
     _p_writer->writeCell(p_peptide_match->getPeptideXtpSp().get()->getSequence());
     _p_writer->writeCell(p_peptide_match->getPeptideXtpSp().get()->getModifString());
-    _p_writer->writeCell(QString::number(p_peptide_match->getEvalue(), 'f', 2));
-    _p_writer->writeCell(QString::number(p_peptide_match->getParam(PeptideMatchParam::tandem_hyperscore).toDouble(), 'f', 2));
+    _p_writer->writeCell(p_peptide_match->getEvalue());
+    _p_writer->writeCell(p_peptide_match->getParam(PeptideMatchParam::tandem_hyperscore).toDouble());
     
 
 }