diff --git a/CMakeLists.txt b/CMakeLists.txt index 7610046a2f658cede84029dac73ffddb01e8e3b1..c7b3d38b6231842329e6405d44ef770159f75d78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ SET(SOFTWARE_NAME "XTPcpp") SET(XTPCPP_VERSION_MAJOR "0") SET(XTPCPP_VERSION_MINOR "2") -SET(XTPCPP_VERSION_PATCH "23") +SET(XTPCPP_VERSION_PATCH "24") SET(XTPCPP_VERSION "${XTPCPP_VERSION_MAJOR}.${XTPCPP_VERSION_MINOR}.${XTPCPP_VERSION_PATCH}") # Set the CMAKE_PREFIX_PATH for the find_library fonction when using non diff --git a/debian/changelog b/debian/changelog index 4a3532ef71dacfd9d6ccf847b6d4cf4db57caf66..79f15f937399ff70e0b5526c728a6d9e9d58154e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +xtpcpp (0.2.24-3) stretch; urgency=medium + + * fix for temporary directory under condor + + -- Olivier Langella <olivier.langella@u-psud.fr> Mon, 29 Oct 2018 11:14:33 +0100 + +xtpcpp (0.2.24-2) stretch; urgency=medium + + * ODS output fix + + -- Olivier Langella <olivier.langella@u-psud.fr> Fri, 19 Oct 2018 16:57:33 +0200 + +xtpcpp (0.2.24-1) stretch; urgency=medium + + * new compar ODS output dedicated to labeled experiments + * SEVERE bug fix concerning protein Evalue computation (reported by T. Balliau) + + -- Olivier Langella <olivier.langella@u-psud.fr> Fri, 19 Oct 2018 16:13:10 +0200 + xtpcpp (0.2.23-2) stretch; urgency=medium * fix version number diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index 1f805b5e69e38909f4ea7352164ff997acafc84f..5063f0bfb48c297b92f89bb4156a96be14dce68a 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -55,14 +55,15 @@ IdentificationGroup::getGroupStore() const } pappso::pappso_double -IdentificationGroup::computeProtoNsafSum(const MsRun *p_msrun_id) const +IdentificationGroup::computeProtoNsafSum(const MsRun *p_msrun_id, + const Label *p_label) const { pappso::pappso_double nsaf_sum = 0; for(auto &p_protein_match : _protein_match_list) { if(p_protein_match->getValidationState() >= ValidationState::grouped) { - nsaf_sum += p_protein_match->getProtoNsaf(p_msrun_id); + nsaf_sum += p_protein_match->getProtoNsaf(p_msrun_id, p_label); } } return nsaf_sum; @@ -130,7 +131,8 @@ unsigned int IdentificationGroup::countDecoyProteinMatch(ValidationState state) const { return std::count_if( - _protein_match_list.begin(), _protein_match_list.end(), + _protein_match_list.begin(), + _protein_match_list.end(), [state](const ProteinMatch *p_protein_match) { if((p_protein_match->getProteinXtpSp().get()->isDecoy()) && (p_protein_match->getValidationState() >= state)) @@ -209,7 +211,8 @@ IdentificationGroup::countDecoyPeptideMatch(ValidationState state) const unsigned int IdentificationGroup::countProteinMatch(ValidationState state) const { - return std::count_if(_protein_match_list.begin(), _protein_match_list.end(), + return std::count_if(_protein_match_list.begin(), + _protein_match_list.end(), [state](const ProteinMatch *p_protein_match) { if(p_protein_match->getValidationState() >= state) { @@ -302,8 +305,8 @@ IdentificationGroup::addIdentificationDataSourceP( IdentificationDataSource *p_identification_source) { addMsRunSp(p_identification_source->getMsRunSp()); - auto it = std::find(_id_source_list.begin(), _id_source_list.end(), - p_identification_source); + auto it = std::find( + _id_source_list.begin(), _id_source_list.end(), p_identification_source); if(it == _id_source_list.end()) { _id_source_list.push_back(p_identification_source); @@ -353,7 +356,8 @@ IdentificationGroup::countSubGroup() const void IdentificationGroup::collectMhDelta( - std::vector<pappso::pappso_double> &delta_list, pappso::PrecisionUnit unit, + std::vector<pappso::pappso_double> &delta_list, + pappso::PrecisionUnit unit, ValidationState state) const { std::set<const PeptideEvidence *> peptide_evidence_list; @@ -466,7 +470,9 @@ IdentificationGroup::getProteinFdr(ValidationState state) const void IdentificationGroup::getSameXicPeptideEvidenceList( std::vector<const PeptideEvidence *> &peptide_evidence_list, - const MsRun *p_msrun, const PeptideXtp *p_peptide, unsigned int charge) const + const MsRun *p_msrun, + const PeptideXtp *p_peptide, + unsigned int charge) const { if(!contains(p_msrun)) return; @@ -475,8 +481,8 @@ IdentificationGroup::getSameXicPeptideEvidenceList( if(p_msrun == p_identification_source->getMsRunSp().get()) { p_identification_source->getPeptideEvidenceStore() - .getSameXicPeptideEvidenceList(peptide_evidence_list, p_msrun, - p_peptide, charge); + .getSameXicPeptideEvidenceList( + peptide_evidence_list, p_msrun, p_peptide, charge); } } } diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h index 43e03e2bd4e5088115bd930ce990c92ba2220bda..7ec739ac5d3fa153e57d3be3d5ca1954ec90aca2 100644 --- a/src/core/identificationgroup.h +++ b/src/core/identificationgroup.h @@ -62,7 +62,9 @@ class IdentificationGroup * Warning: this is not NSAF, just a part * @param p_msrun_id pointer on the msrun to get NSAF. * */ - pappso::pappso_double computeProtoNsafSum(const MsRun *p_msrun_id) const; + pappso::pappso_double + computeProtoNsafSum(const MsRun *p_msrun_id, + const Label *p_label = nullptr) const; /** @brief count groups * */ @@ -152,7 +154,8 @@ class IdentificationGroup * each peptide evidence is only counted once */ void collectMhDelta(std::vector<pappso::pappso_double> &delta_list, - pappso::PrecisionUnit unit, ValidationState state) const; + pappso::PrecisionUnit unit, + ValidationState state) const; /** @brief look for a peptide in the same XIC @@ -163,7 +166,8 @@ class IdentificationGroup */ void getSameXicPeptideEvidenceList( std::vector<const PeptideEvidence *> &peptide_evidence_list, - const MsRun *p_msrun, const PeptideXtp *p_peptide, + const MsRun *p_msrun, + const PeptideXtp *p_peptide, unsigned int charge) const; private: diff --git a/src/core/proteinmatch.cpp b/src/core/proteinmatch.cpp index 360b897c17a0d312713d8df99b9bced28ea3cba9..700dedd321de85960ea1f91b585aa68343a54d89 100644 --- a/src/core/proteinmatch.cpp +++ b/src/core/proteinmatch.cpp @@ -346,7 +346,8 @@ ProteinMatch::countPeptideMatch(ValidationState state) const size_t ProteinMatch::countSequenceLi(ValidationState state, - const MsRun *p_msrun_id) const + const MsRun *p_msrun_id, + const Label *p_label) const { // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__; std::set<QString> sequence_list; @@ -356,13 +357,33 @@ ProteinMatch::countSequenceLi(ValidationState state, { if(p_msrun_id != nullptr) { - // within sample - if(peptide_match.getPeptideEvidence()->getMsRunP() == p_msrun_id) + + if(p_label != nullptr) { - sequence_list.insert(peptide_match.getPeptideEvidence() - ->getPeptideXtpSp() - .get() - ->getSequenceLi()); + if((peptide_match.getPeptideEvidence()->getMsRunP() == + p_msrun_id) && + (peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getLabel() == p_label)) + { + sequence_list.insert(peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getSequenceLi()); + } + } + else + { + // within sample + if(peptide_match.getPeptideEvidence()->getMsRunP() == + p_msrun_id) + { + sequence_list.insert(peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getSequenceLi()); + } } } else @@ -398,7 +419,8 @@ ProteinMatch::countDistinctMsSamples(ValidationState state) const unsigned int ProteinMatch::countPeptideMassCharge(ValidationState state, - const MsRun *sp_msrun_id) const + const MsRun *sp_msrun_id, + const Label *p_label) const { std::set<QString> sequence_list; for(auto &peptide_match : _peptide_match_list) @@ -410,19 +432,46 @@ ProteinMatch::countPeptideMassCharge(ValidationState state, // within sample if(peptide_match.getPeptideEvidence()->getMsRunP() == sp_msrun_id) { - sequence_list.insert( - QString("%1-%2-%3") - .arg(peptide_match.getPeptideEvidence() - ->getPeptideXtpSp() - .get() - ->getNativePeptideP() - ->getSequenceLi()) - .arg(peptide_match.getPeptideEvidence() - ->getPeptideXtpSp() - .get() - ->getNativePeptideP() - ->getMass()) - .arg(peptide_match.getPeptideEvidence()->getCharge())); + if(p_label != nullptr) + { + if(peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getLabel() == p_label) + { + sequence_list.insert( + QString("%1-%2-%3") + .arg(peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getNativePeptideP() + ->getSequenceLi()) + .arg(peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getNativePeptideP() + ->getMass()) + .arg(peptide_match.getPeptideEvidence() + ->getCharge())); + } + } + else + { + sequence_list.insert( + QString("%1-%2-%3") + .arg(peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getNativePeptideP() + ->getSequenceLi()) + .arg(peptide_match.getPeptideEvidence() + ->getPeptideXtpSp() + .get() + ->getNativePeptideP() + ->getMass()) + .arg( + peptide_match.getPeptideEvidence()->getCharge())); + } } } else @@ -500,7 +549,7 @@ ProteinMatch::getLogEvalue(const MsRun *sp_msrun_id) const } } - pappso::pappso_double evalue_prot = 1; + pappso::pappso_double evalue_prot = 0; for(auto &&peptide_pair : map_sequence_evalue) { evalue_prot += std::log10(peptide_pair.second); @@ -512,7 +561,8 @@ ProteinMatch::getLogEvalue(const MsRun *sp_msrun_id) const } pappso::pappso_double ProteinMatch::getNsaf(pappso::pappso_double proto_nsaf_sum, - const MsRun *p_msrun_id) const + const MsRun *p_msrun_id, + const Label *p_label) const { if(proto_nsaf_sum == 0) { @@ -521,11 +571,11 @@ ProteinMatch::getNsaf(pappso::pappso_double proto_nsaf_sum, "Error computing NSAF for protein %1 :\nproto_nsaf_sum is null") .arg(this->getProteinXtpSp().get()->getAccession())); } - return (getProtoNsaf(p_msrun_id) / proto_nsaf_sum); + return (getProtoNsaf(p_msrun_id, p_label) / proto_nsaf_sum); } pappso::pappso_double -ProteinMatch::getProtoNsaf(const MsRun *sp_msrun_id) const +ProteinMatch::getProtoNsaf(const MsRun *sp_msrun_id, const Label *p_label) const { try { @@ -535,8 +585,8 @@ ProteinMatch::getProtoNsaf(const MsRun *sp_msrun_id) const QObject::tr("protein has no amino acid sequence")); } pappso::pappso_double proto_nsaf = - (pappso::pappso_double)countSampleScan(ValidationState::validAndChecked, - sp_msrun_id) / + (pappso::pappso_double)countSampleScan( + ValidationState::validAndChecked, sp_msrun_id, p_label) / (pappso::pappso_double)_protein_sp.get()->size(); return proto_nsaf; } @@ -550,13 +600,13 @@ ProteinMatch::getProtoNsaf(const MsRun *sp_msrun_id) const } pappso::pappso_double -ProteinMatch::getPAI(const MsRun *sp_msrun_id) const +ProteinMatch::getPAI(const MsRun *sp_msrun_id, const Label *p_label) const { try { pappso::pappso_double PAI = (pappso::pappso_double)countPeptideMassCharge( - ValidationState::validAndChecked, sp_msrun_id) / + ValidationState::validAndChecked, sp_msrun_id, p_label) / (pappso::pappso_double)_protein_sp.get()->countTrypticPeptidesForPAI(); return PAI; } @@ -570,11 +620,11 @@ ProteinMatch::getPAI(const MsRun *sp_msrun_id) const } pappso::pappso_double -ProteinMatch::getEmPAI(const MsRun *sp_msrun_id) const +ProteinMatch::getEmPAI(const MsRun *sp_msrun_id, const Label *p_label) const { // compute emPAI, Ishihama 2005 pappso::pappso_double value = - std::pow(10.0, getPAI(sp_msrun_id)) - (pappso::pappso_double)1.0; + std::pow(10.0, getPAI(sp_msrun_id, p_label)) - (pappso::pappso_double)1.0; return value; } diff --git a/src/core/proteinmatch.h b/src/core/proteinmatch.h index 7bb8efd81901c8eaaaf7cc5188d6fc205b843cfd..33ff923c7b481ad6c3bef43deb3483b020b73522 100644 --- a/src/core/proteinmatch.h +++ b/src/core/proteinmatch.h @@ -72,7 +72,8 @@ class ProteinMatch * Warning: this is not NSAF, just a part * @param p_msrun_id pointer on the msrun to get NSAF. * */ - pappso::pappso_double getProtoNsaf(const MsRun *p_msrun_id) const; + pappso::pappso_double getProtoNsaf(const MsRun *p_msrun_id, + const Label *p_label = nullptr) const; /** @brief compute NSAF within msrun : normalized spectral abundance factor * (NSAF) Florens L., Carozza M. J. C., Swanson S. K., et al. Analyzing @@ -84,17 +85,20 @@ class ProteinMatch * @param p_msrun_id pointer on the msrun to get NSAF * */ pappso::pappso_double getNsaf(pappso::pappso_double proto_nsaf_sum, - const MsRun *p_msrun_id) const; + const MsRun *p_msrun_id, + const Label *p_label = nullptr) const; /** @brief compute Protein Abundance Index (PAI) within sample * PAI computation (Rappsilber et al. 2002) * */ - pappso::pappso_double getPAI(const MsRun *sp_msrun_id = nullptr) const; + pappso::pappso_double getPAI(const MsRun *sp_msrun_id = nullptr, + const Label *p_label = nullptr) const; /** @brief compute emPAI within sample * Ishihama 2005 * */ - pappso::pappso_double getEmPAI(const MsRun *sp_msrun_id = nullptr) const; + pappso::pappso_double getEmPAI(const MsRun *sp_msrun_id = nullptr, + const Label *p_label = nullptr) const; void setProteinXtpSp(ProteinXtpSp protein_sp); void addPeptideMatch(const PeptideMatch &peptide_match); @@ -162,7 +166,8 @@ class ProteinMatch * @param p_msrun_id count within the specified sample */ size_t countSequenceLi(ValidationState state, - const MsRun *p_msrun_id = nullptr) const; + const MsRun *p_msrun_id = nullptr, + const Label *p_label = nullptr) const; /** @brief count distinct peptide+mass+charge * peptide is the peptide sequence LI (Leucine => Isoleucine) @@ -171,7 +176,8 @@ class ProteinMatch * @param p_msrun_id count within the specified sample */ unsigned int countPeptideMassCharge(ValidationState state, - const MsRun *sp_msrun_id = nullptr) const; + const MsRun *sp_msrun_id = nullptr, + const Label *p_label = nullptr) const; /** @brief count distinct MS samples in which the protein is observed * @param state validation state of peptides to count diff --git a/src/core/tandem_run/tandemcondorprocess.cpp b/src/core/tandem_run/tandemcondorprocess.cpp index 79b22eebc724c5cdc08c1ae2d6e9fba6dcef2f41..f05d317dbac15f1ed33f33824d314f5c05331c27 100644 --- a/src/core/tandem_run/tandemcondorprocess.cpp +++ b/src/core/tandem_run/tandemcondorprocess.cpp @@ -98,7 +98,9 @@ TandemCondorProcess::prepareTemporaryDirectory() { QSettings settings; - QString condor_tmp_dir = QString("%1/xtpcpp"); + QString condor_tmp_dir = + QString("%1/xtpcpp") + .arg(settings.value("condor/tmp_dir", "/tmp").toString()); if(_p_tmp_dir != nullptr) { delete _p_tmp_dir; diff --git a/src/gui/widgets/automatic_filter_widget/automatic_filter_widget.ui b/src/gui/widgets/automatic_filter_widget/automatic_filter_widget.ui index 4611c3aa163279f4cafd596d0316c16d2576d6e3..ec90cfb4088fba249c58b44418f2d1abca38a372 100644 --- a/src/gui/widgets/automatic_filter_widget/automatic_filter_widget.ui +++ b/src/gui/widgets/automatic_filter_widget/automatic_filter_widget.ui @@ -6,10 +6,28 @@ <rect> <x>0</x> <y>0</y> - <width>533</width> - <height>300</height> + <width>510</width> + <height>180</height> </rect> </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>180</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>0</width> + <height>180</height> + </size> + </property> <property name="windowTitle"> <string>Form</string> </property> @@ -21,6 +39,12 @@ </property> <item row="0" column="0"> <widget class="QLabel" name="sample_number_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> <string>peptide Evalue</string> </property> @@ -44,6 +68,12 @@ </item> <item row="1" column="0"> <widget class="QLabel" name="group_number_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> <string>number of peptides per protein</string> </property> @@ -61,6 +91,12 @@ </item> <item row="2" column="0"> <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> <string>overall samples</string> </property> @@ -75,6 +111,12 @@ </item> <item row="3" column="0"> <widget class="QLabel" name="subgroup_number_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> <string>protein Evalue</string> </property> @@ -98,6 +140,12 @@ </item> <item row="4" column="0"> <widget class="QLabel" name="label_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> <string>protein Evalue (log10)</string> </property> diff --git a/src/output/ods/comparbasesheet.cpp b/src/output/ods/comparbasesheet.cpp index 627e1c7229a7f4fcef149b786fcbdd78e59c3d95..3c7bfaa5533bc635701407f3559d173a051862d2 100644 --- a/src/output/ods/comparbasesheet.cpp +++ b/src/output/ods/comparbasesheet.cpp @@ -45,7 +45,10 @@ ComparBaseSheet::ComparBaseSheet(OdsExport *p_ods_export, _sp_labelling_method = p_project->getLabelingMethodSp(); - _label_list = _sp_labelling_method.get()->getLabelList(); + if(_sp_labelling_method.get() != nullptr) + { + _label_list = _sp_labelling_method.get()->getLabelList(); + } } void @@ -174,7 +177,8 @@ ComparBaseSheet::writeProteinMatch(const ProteinMatch *p_protein_match) { writeComparValue(p_protein_match, ValidationState::validAndChecked, - msrun_sp.get(),p_label); + msrun_sp.get(), + p_label); if(_first_cell_coordinate.isEmpty()) { _first_cell_coordinate = _p_writer->getOdsCellCoordinate(); diff --git a/src/output/ods/comparspectrasheet.cpp b/src/output/ods/comparspectrasheet.cpp index 2a94fe0fad05ac23eecd7e7e7391c08445b949ae..b9ee4cc32c6eb1f6d0e503358be87e0935e9f503 100644 --- a/src/output/ods/comparspectrasheet.cpp +++ b/src/output/ods/comparspectrasheet.cpp @@ -50,7 +50,8 @@ ComparSpectraSheet::writeComparValue(const ProteinMatch *p_protein_match, const Label *p_label) { qDebug() << "ComparSpectraSheet::writeComparValue begin"; - _p_writer->writeCell(p_protein_match->countSampleScan(state, p_msrun,p_label)); + _p_writer->writeCell( + p_protein_match->countSampleScan(state, p_msrun, p_label)); qDebug() << "ComparSpectraSheet::writeComparValue end"; } @@ -71,7 +72,7 @@ ComparSequenceSheet::writeComparValue(const ProteinMatch *p_protein_match, { qDebug() << "ComparSequenceSheet::writeComparValue begin"; _p_writer->writeCell( - (unsigned int)p_protein_match->countSequenceLi(state, p_msrun)); + (unsigned int)p_protein_match->countSequenceLi(state, p_msrun, p_label)); qDebug() << "ComparSequenceSheet::writeComparValue end"; } @@ -90,7 +91,7 @@ ComparPaiSheet::writeComparValue(const ProteinMatch *p_protein_match, const Label *p_label) { qDebug() << "ComparPaiSheet::writeComparValue begin"; - _p_writer->writeCell(p_protein_match->getPAI(p_msrun)); + _p_writer->writeCell(p_protein_match->getPAI(p_msrun, p_label)); qDebug() << "ComparPaiSheet::writeComparValue end"; } @@ -109,7 +110,7 @@ ComparEmpaiSheet::writeComparValue(const ProteinMatch *p_protein_match, const Label *p_label) { qDebug() << "ComparEmpaiSheet::writeComparValue begin"; - _p_writer->writeCell(p_protein_match->getEmPAI(p_msrun)); + _p_writer->writeCell(p_protein_match->getEmPAI(p_msrun, p_label)); qDebug() << "ComparEmpaiSheet::writeComparValue end"; } @@ -129,21 +130,47 @@ ComparNsafSheet::writeComparValue(const ProteinMatch *p_protein_match, { qDebug() << "ComparNsafSheet::writeComparValue begin"; pappso::pappso_double proto_nsaf_sum = 0; - std::pair<std::map<const MsRun *, pappso::pappso_double>::iterator, bool> - ret = _map_proto_nsaf_sum_by_msrun.insert( - std::pair<const MsRun *, pappso::pappso_double>(p_msrun, 0)); - if(ret.second == false) + + if(_label_list.size() > 0) { - //"element 'z' already existed"; - proto_nsaf_sum = ret.first->second; + std::pair<std::map<QString, pappso::pappso_double>::iterator, bool> ret = + _map_proto_nsaf_sum_by_msrun.insert( + std::pair<QString, pappso::pappso_double>( + QString("%1--%2").arg(p_msrun->getXmlId()).arg(p_label->getXmlId()), + 0)); + if(ret.second == false) + { + //"element 'z' already existed"; + proto_nsaf_sum = ret.first->second; + } + else + { + proto_nsaf_sum = _p_current_identification_group->computeProtoNsafSum( + p_msrun, p_label); + ret.first->second = proto_nsaf_sum; + } + + _p_writer->writeCell( + p_protein_match->getNsaf(proto_nsaf_sum, p_msrun, p_label)); } else { - proto_nsaf_sum = - _p_current_identification_group->computeProtoNsafSum(p_msrun); - ret.first->second = proto_nsaf_sum; + std::pair<std::map<QString, pappso::pappso_double>::iterator, bool> ret = + _map_proto_nsaf_sum_by_msrun.insert( + std::pair<QString, pappso::pappso_double>(p_msrun->getXmlId(), 0)); + if(ret.second == false) + { + //"element 'z' already existed"; + proto_nsaf_sum = ret.first->second; + } + else + { + proto_nsaf_sum = + _p_current_identification_group->computeProtoNsafSum(p_msrun); + ret.first->second = proto_nsaf_sum; + } + + _p_writer->writeCell(p_protein_match->getNsaf(proto_nsaf_sum, p_msrun)); } - - _p_writer->writeCell(p_protein_match->getNsaf(proto_nsaf_sum, p_msrun)); qDebug() << "ComparNsafSheet::writeComparValue end"; } diff --git a/src/output/ods/comparspectrasheet.h b/src/output/ods/comparspectrasheet.h index 737af6c1eab249560020dbae9a0b40a2f45facf7..d129f71f728bd408dc887d27843dbf7720014a28 100644 --- a/src/output/ods/comparspectrasheet.h +++ b/src/output/ods/comparspectrasheet.h @@ -104,7 +104,7 @@ class ComparNsafSheet : public ComparBaseSheet const Label *p_label = nullptr) override; private: - std::map<const MsRun *, pappso::pappso_double> _map_proto_nsaf_sum_by_msrun; + std::map<QString, pappso::pappso_double> _map_proto_nsaf_sum_by_msrun; }; #endif // COMPARSPECTRASHEET_H