Skip to content
Snippets Groups Projects
Commit 863d97f1 authored by Olivier Langella's avatar Olivier Langella
Browse files

replacing X amino acid by nothing to compute mass and valid tryptic peptide number

parent aca68211
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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 {
......
......@@ -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()));
}
}
......@@ -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()));
}
}
......@@ -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());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment