diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42d4fb8ffd3688b5b44840562b52e09eea518787..9d83c28381795063e2aaf2c1413a7bf8b640d8bf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,8 +29,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} ${Qt5 #sudo apt-get install libpappsomspp-dev #FIND_PACKAGE( Pappsomspp REQUIRED ) -# SET (PAPPSOMSPP_DIR "/home/olivier/eclipse/git/pappsomspp") - SET (PAPPSOMSPP_DIR "/home/langella/developpement/git/pappsomspp") + 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") diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index dcbf38ed7bc5fe644a0d38327c180c5af4d2020f..a56976d9acf23183536c644ea5d97ef8ed26b628 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -50,19 +50,17 @@ void IdentificationGroup::updateAutomaticFilters(const AutomaticFilterParameters } } -ProteinMatch * IdentificationGroup::getProteinMatch(const QString accession) { +ProteinMatch * IdentificationGroup::getProteinMatchInstance(const QString accession) { if (accession.isEmpty()) { throw pappso::PappsoException(QObject::tr("Error protein match not found : accession is empty")); } auto it_cache = _cache_accession_protein_match.find(accession); if (it_cache == _cache_accession_protein_match.end()) { //accession not found in cache - for (ProteinMatch * p_protein_match : _protein_match_list) { - if (p_protein_match->getProteinXtpSp().get()->getAccession() == accession) { - _cache_accession_protein_match.insert(std::pair<QString, ProteinMatch *>(accession, p_protein_match)); - return p_protein_match; - } - } + ProteinMatch * p_protein_match = new ProteinMatch(); + _cache_accession_protein_match.insert(std::pair<QString, ProteinMatch *>(accession, p_protein_match)); + _protein_match_list.push_back(p_protein_match); + return p_protein_match; } else { return it_cache->second; @@ -70,17 +68,7 @@ ProteinMatch * IdentificationGroup::getProteinMatch(const QString accession) { return nullptr; } void IdentificationGroup::addProteinMatch(ProteinMatch * protein_match) { - QString accession = protein_match->getProteinXtpSp().get()->getAccession(); - if (accession.isEmpty()) { - throw pappso::PappsoException(QObject::tr("Error adding protein match : accession is empty")); - } - auto it_cache = _cache_already_added_protein_match.find(protein_match); - if (it_cache == _cache_already_added_protein_match.end()) { - //accession not found in cache - _cache_already_added_protein_match.insert(protein_match); - _protein_match_list.push_back(protein_match); - } - + _protein_match_list.push_back(protein_match); } bool IdentificationGroup::contains (const MsRun * p_msrun) const { diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h index 279b7a8b7d85bdfe1210c547fb5c2debf42e5615..27986627fe8bfd8ea9ff0ca80d4b71346b9fb0ea 100644 --- a/src/core/identificationgroup.h +++ b/src/core/identificationgroup.h @@ -44,7 +44,7 @@ public: IdentificationGroup(Project * project); ~IdentificationGroup(); - ProteinMatch * getProteinMatch(const QString accession); + ProteinMatch * getProteinMatchInstance(const QString accession); void addProteinMatch(ProteinMatch * protein_match); std::vector<ProteinMatch *> & getProteinMatchList(); void addMsRunSp(MsRunSp ms_run_sp); @@ -95,7 +95,6 @@ private : std::vector<MsRunSp> _ms_run_list; std::map<QString, ProteinMatch *> _cache_accession_protein_match; - std::set<ProteinMatch *> _cache_already_added_protein_match; }; #endif // IDENTIFICATIONGROUP_H diff --git a/src/core/peptidematch.cpp b/src/core/peptidematch.cpp index faba2b9a9e17c49a9ac9415d6eedeab3fe14ae8a..c95a4d48e31f568243172e2d6336caf5b1a105bc 100644 --- a/src/core/peptidematch.cpp +++ b/src/core/peptidematch.cpp @@ -52,7 +52,7 @@ void PeptideMatch::setStart(unsigned int start) { _start =start; } pappso::mz PeptideMatch::getDeltaMass() const { - return (_exp_mass - _peptide_sp.get()->getMass()); + return ((_exp_mass+pappso::MHPLUS) - _peptide_sp.get()->getMz(1)); } unsigned int PeptideMatch::getStart() const { return _start; diff --git a/src/core/peptidematch.h b/src/core/peptidematch.h index 49c58b63795efb0713a441757846c93bc726304a..bd150ed5cd59c70137e9e72fceacec4704cf9a8a 100644 --- a/src/core/peptidematch.h +++ b/src/core/peptidematch.h @@ -72,7 +72,7 @@ public : * */ void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters); - /** @brief get delta between theoretical mass and experimental mass + /** @brief get delta between theoretical mhplus mass and mhplus experimental mass */ pappso::mz getDeltaMass() const; diff --git a/src/input/xtandemsaxhandler.cpp b/src/input/xtandemsaxhandler.cpp index 0f63fe248c26f15e5478e558b0349c1d15547b56..001cb943708d5797923f89ae7c18e3bb321095cc 100644 --- a/src/input/xtandemsaxhandler.cpp +++ b/src/input/xtandemsaxhandler.cpp @@ -132,7 +132,7 @@ bool XtandemSaxHandler::startElement_group(QXmlAttributes attrs) { _scan = attrs.value("id").toUInt(); _mhplus_obser = attrs.value("mh").toDouble(); _charge = attrs.value("z").toUInt(); - //_retention_time = attrs.value("rt"); + _retention_time = attrs.value("rt").replace("PT","").replace("S","").toDouble(); } return is_ok; } @@ -156,22 +156,16 @@ bool XtandemSaxHandler::startElement_protein(QXmlAttributes attributes) { //qDebug() << "startElement_protein begin"; QString accession = attributes.value("label").simplified().split(" ", QString::SkipEmptyParts).at(0); //qDebug() << "startElement_protein accession" << accession; - _p_protein_match = _p_identification_group->getProteinMatch(accession); + _p_protein_match = _p_identification_group->getProteinMatchInstance(accession); //qDebug() << "startElement_protein p_protein_match 1 " << _p_protein_match; _current_protein.setAccession(accession); - if (_p_protein_match == nullptr) { - _p_protein_match = new ProteinMatch(); - //qDebug() << "startElement_protein p_protein_match 2 " << _p_protein_match; - _p_protein_match->setChecked(false); - - } + _p_protein_match->setChecked(false); //qDebug() << "startElement_protein p_protein_match 3 " << _p_protein_match; ProteinXtpSp sp_xtp_protein = _current_protein.makeProteinXtpSp(); _p_protein_match->setProteinXtpSp(_p_project->getProteinStore().getInstance(sp_xtp_protein)); _p_protein_match->setChecked(true); - _p_identification_group->addProteinMatch(_p_protein_match); //qDebug() << "startElement_protein end" ; return is_ok; } @@ -247,7 +241,7 @@ bool XtandemSaxHandler::startElement_aa(QXmlAttributes attributes) { } bool XtandemSaxHandler::endElement_domain() { - bool is_ok = true; + bool is_ok = true; _current_peptide_sp = _p_project->getPeptideStore().getInstance(_current_peptide_sp); _p_peptide_match->setPeptideXtpSp(_current_peptide_sp);