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

WIP: parsing pep xml files

parent 7d766e00
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,7 @@ SET(CPP_FILES
core/identificationgroup.cpp
core/identification_sources/identificationdatasource.cpp
core/identification_sources/identificationmascotdatfile.cpp
core/identification_sources/identificationpepxmlfile.cpp
core/identification_sources/identificationpwizfile.cpp
core/identification_sources/identificationxtandemfile.cpp
core/labeling/label.cpp
......@@ -122,6 +123,7 @@ SET(CPP_FILES
input/mascot/mimeparser.cpp
input/condorqxmlsaxhandler.cpp
input/identificationpwizreader.cpp
input/pepxmlsaxhandler.cpp
input/xpipsaxhandler.cpp
input/xtandemparamsaxhandler.cpp
input/xtandemsaxhandler.cpp
......
......@@ -6,92 +6,137 @@
*/
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
* Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include "identificationpepxmlfile.h"
#include <pappsomspp/pappsoexception.h>
#include "../project.h"
#include "../../input/mascot/mascotdatparser.h"
#include "../../input/pepxmlsaxhandler.h"
IdentificationPepXmlFile::IdentificationPepXmlFile(const QFileInfo & mascot_dat_file) : IdentificationDataSource(mascot_dat_file.absoluteFilePath()), _pep_xml_file(mascot_dat_file)
IdentificationPepXmlFile::IdentificationPepXmlFile(
const QFileInfo &mascot_dat_file)
: IdentificationDataSource(mascot_dat_file.absoluteFilePath())
, _pep_xml_file(mascot_dat_file)
{
_engine = IdentificationEngine::unknown;
_engine = IdentificationEngine::unknown;
}
IdentificationPepXmlFile::IdentificationPepXmlFile(const IdentificationPepXmlFile& other) : IdentificationDataSource(other),_pep_xml_file (other._pep_xml_file)
IdentificationPepXmlFile::IdentificationPepXmlFile(
const IdentificationPepXmlFile &other)
: IdentificationDataSource(other), _pep_xml_file(other._pep_xml_file)
{
_engine = IdentificationEngine::unknown;
_engine = IdentificationEngine::unknown;
}
IdentificationPepXmlFile::~IdentificationPepXmlFile()
{
}
bool IdentificationPepXmlFile::operator==(const IdentificationPepXmlFile& other) const
bool
IdentificationPepXmlFile::
operator==(const IdentificationPepXmlFile &other) const
{
}
pappso::SpectrumSp IdentificationPepXmlFile::getSpectrumSp(unsigned int scan_number) const {
pappso::SpectrumSp spectrum_sp = IdentificationDataSource::getSpectrumSp(scan_number);
return spectrum_sp;
pappso::SpectrumSp
IdentificationPepXmlFile::getSpectrumSp(unsigned int scan_number) const
{
pappso::SpectrumSp spectrum_sp =
IdentificationDataSource::getSpectrumSp(scan_number);
return spectrum_sp;
}
void IdentificationPepXmlFile::parseTo(Project* p_project) {
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
MsRunSp msrun_sp = p_project->getMsRunStore().getInstance(QFileInfo(_pep_xml_file).baseName());
setMsRunSp(msrun_sp);
std::vector<IdentificationGroup *> identification_list = p_project->getIdentificationGroupList();
IdentificationGroup * identification_group_p = nullptr;
if (p_project->getProjectMode() == ProjectMode::combined) {
if (identification_list.size() == 0) {
identification_group_p = p_project->newIdentificationGroup();
void
IdentificationPepXmlFile::parseTo(Project *p_project)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
MsRunSp msrun_sp =
p_project->getMsRunStore().getInstance(QFileInfo(_pep_xml_file).baseName());
setMsRunSp(msrun_sp);
std::vector<IdentificationGroup *> identification_list =
p_project->getIdentificationGroupList();
IdentificationGroup *identification_group_p = nullptr;
if(p_project->getProjectMode() == ProjectMode::combined)
{
if(identification_list.size() == 0)
{
identification_group_p = p_project->newIdentificationGroup();
}
else {
identification_group_p = identification_list[0];
else
{
identification_group_p = identification_list[0];
}
}
else {
for (IdentificationGroup * identification_p_flist : identification_list) {
if (identification_p_flist->containSample(msrun_sp.get()->getSampleName())) {
identification_group_p = identification_p_flist;
break;
else
{
for(IdentificationGroup *identification_p_flist : identification_list)
{
if(identification_p_flist->containSample(
msrun_sp.get()->getSampleName()))
{
identification_group_p = identification_p_flist;
break;
}
}
if (identification_group_p == nullptr) {
identification_group_p = p_project->newIdentificationGroup();
if(identification_group_p == nullptr)
{
identification_group_p = p_project->newIdentificationGroup();
}
}
identification_group_p->addIdentificationDataSourceP(this);
MascotDatParser mascot_parser(p_project, identification_group_p, this);
identification_group_p->addIdentificationDataSourceP(this);
PepXmlSaxHandler *parser =
new PepXmlSaxHandler(p_project, identification_group_p, this);
QXmlSimpleReader simplereader;
simplereader.setContentHandler(parser);
simplereader.setErrorHandler(parser);
QFile qfile(_pep_xml_file.absoluteFilePath());
QXmlInputSource xmlInputSource(&qfile);
if(simplereader.parse(xmlInputSource))
{
qfile.close();
}
else
{
qDebug() << parser->errorString();
// throw PappsoException(
// QObject::tr("error reading tandem XML result file :\n").append(
// parser->errorString()));
qfile.close();
throw pappso::PappsoException(
QObject::tr("Error reading %1 pep xml file :\n %2")
.arg(_pep_xml_file.absoluteFilePath())
.arg(parser->errorString()));
}
QFile qfile(_pep_xml_file.absoluteFilePath());
mascot_parser.parse(&qfile);
qfile.close();
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
}
......@@ -2,210 +2,315 @@
* \file utils/peptideevidence.cpp
* \date 18/11/2017
* \author Olivier Langella
* \brief peptide evidence : a peptide sequence + spectrum + identification engine evaluation (psm)
* \brief peptide evidence : a peptide sequence + spectrum + identification
* engine evaluation (psm)
*/
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and implementation
******************************************************************************/
* Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/
#include "peptideevidence.h"
#include <pappsomspp/pappsoexception.h>
std::hash<std::string> PeptideEvidence::_hash_fn;
PeptideEvidence::PeptideEvidence(MsRun * msrunid_sp, unsigned int scan) {
_msrunid_sp = msrunid_sp;
_scan = scan;
PeptideEvidence::PeptideEvidence(MsRun *msrunid_sp, unsigned int scan)
{
_msrunid_sp = msrunid_sp;
_scan = scan;
_hash_sample_scan = PeptideEvidence::_hash_fn (QString("%1 %2").arg(msrunid_sp->getXmlId()).arg(_scan).toStdString());
_hash_sample_scan = PeptideEvidence::_hash_fn(
QString("%1 %2").arg(msrunid_sp->getXmlId()).arg(_scan).toStdString());
_identification_engine = IdentificationEngine::unknown;
}
PeptideEvidence::PeptideEvidence(const PeptideEvidence & other): PeptideEvidence(other._msrunid_sp, other._scan) {
_hash_sample_scan = other._hash_sample_scan;
_sp_grp_peptide = other._sp_grp_peptide;
_peptide_sp = other._peptide_sp;
_rt = other._rt;
_evalue = other._evalue;
_exp_mass = other._exp_mass;
_charge= other._charge;
_p_identification_source = other._p_identification_source;
_params = other._params;
_checked = other._checked;
_proxy_valid = other._proxy_valid;
PeptideEvidence::PeptideEvidence(const PeptideEvidence &other)
: PeptideEvidence(other._msrunid_sp, other._scan)
{
_hash_sample_scan = other._hash_sample_scan;
_sp_grp_peptide = other._sp_grp_peptide;
_peptide_sp = other._peptide_sp;
_rt = other._rt;
_evalue = other._evalue;
_exp_mass = other._exp_mass;
_charge = other._charge;
_p_identification_source = other._p_identification_source;
_params = other._params;
_checked = other._checked;
_proxy_valid = other._proxy_valid;
_identification_engine = other._identification_engine;
}
pappso::mz PeptideEvidence::getTheoreticalMz() const {
return (getPeptideXtpSp().get()->getMz(getCharge()));
pappso::mz
PeptideEvidence::getTheoreticalMz() const
{
return (getPeptideXtpSp().get()->getMz(getCharge()));
}
PeptideEvidenceSp PeptideEvidence::makePeptideEvidenceSp() const {
return std::make_shared<PeptideEvidence>(*this);
PeptideEvidenceSp
PeptideEvidence::makePeptideEvidenceSp() const
{
return std::make_shared<PeptideEvidence>(*this);
}
void PeptideEvidence::updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters) {
_proxy_valid = false;
void
PeptideEvidence::updateAutomaticFilters(
const AutomaticFilterParameters &automatic_filter_parameters)
{
_proxy_valid = false;
_proxy_valid = this->_p_identification_source->isValid(this, automatic_filter_parameters);
_proxy_valid =
this->_p_identification_source->isValid(this, automatic_filter_parameters);
}
void
PeptideEvidence::setRetentionTime(pappso::pappso_double rt)
{
_rt = rt;
}
void PeptideEvidence::setRetentionTime(pappso::pappso_double rt) {
_rt = rt;
void
PeptideEvidence::setEvalue(pappso::pappso_double evalue)
{
_evalue = evalue;
}
void PeptideEvidence::setEvalue(pappso::pappso_double evalue) {
_evalue = evalue;
void
PeptideEvidence::setIdentificationEngine(
IdentificationEngine identification_engine)
{
_identification_engine = identification_engine;
}
/** \brief set specific parameter value
*/
void PeptideEvidence::setParam(PeptideEvidenceParam param, const QVariant& value) {
_params.insert(std::pair<PeptideEvidenceParam, QVariant>(param, value));
}
const QVariant PeptideEvidence::getParam(PeptideEvidenceParam param) const {
try {
return _params.at(param);
void
PeptideEvidence::setParam(PeptideEvidenceParam param, const QVariant &value)
{
_params.insert(std::pair<PeptideEvidenceParam, QVariant>(param, value));
}
const QVariant
PeptideEvidence::getParam(PeptideEvidenceParam param) const
{
try
{
return _params.at(param);
}
catch (std::out_of_range) {
return QVariant();
catch(std::out_of_range)
{
return QVariant();
}
}
const std::map<PeptideEvidenceParam, QVariant> & PeptideEvidence::getParamList() const {
return _params;
const std::map<PeptideEvidenceParam, QVariant> &
PeptideEvidence::getParamList() const
{
return _params;
}
std::size_t PeptideEvidence::getHashPeptideMassSample() const {
return PeptideEvidence::_hash_fn (QString("%1 %2").arg(_peptide_sp.get()->toAbsoluteString()).arg(_msrunid_sp->getXmlId()).toStdString());
std::size_t
PeptideEvidence::getHashPeptideMassSample() const
{
return PeptideEvidence::_hash_fn(QString("%1 %2")
.arg(_peptide_sp.get()->toAbsoluteString())
.arg(_msrunid_sp->getXmlId())
.toStdString());
}
std::size_t PeptideEvidence::getHashSampleScan() const {
return _hash_sample_scan;
}
pappso::pappso_double PeptideEvidence::getEvalue() const {
return _evalue;
}
pappso::pappso_double PeptideEvidence::getExperimentalMass() const {
return _exp_mass;
}
pappso::pappso_double PeptideEvidence::getExperimentalMhplus() const {
return _exp_mass + pappso::MHPLUS;
std::size_t
PeptideEvidence::getHashSampleScan() const
{
return _hash_sample_scan;
}
pappso::pappso_double
PeptideEvidence::getEvalue() const
{
return _evalue;
}
pappso::pappso_double
PeptideEvidence::getExperimentalMass() const
{
return _exp_mass;
}
pappso::pappso_double
PeptideEvidence::getExperimentalMhplus() const
{
return _exp_mass + pappso::MHPLUS;
}
pappso::pappso_double PeptideEvidence::getExperimentalMz() const {
pappso::mz mz = _exp_mass;
for (unsigned int i=0; i < _charge; i++) {
mz+=pappso::MHPLUS;
pappso::pappso_double
PeptideEvidence::getExperimentalMz() const
{
pappso::mz mz = _exp_mass;
for(unsigned int i = 0; i < _charge; i++)
{
mz += pappso::MHPLUS;
}
mz = mz/_charge;
return mz;
}
void PeptideEvidence::setExperimentalMass(pappso::pappso_double exp_mass) {
_exp_mass =exp_mass;
}
pappso::mz PeptideEvidence::getDeltaMass() const {
return ((_exp_mass+pappso::MHPLUS) - _peptide_sp.get()->getMz(1));
}
pappso::mz PeptideEvidence::getPpmDeltaMass() const {
//return (_peptide_sp.get()->getMz(1) - (_exp_mass+pappso::MHPLUS));
pappso::pappso_double diff = getDeltaMass();
while (diff > 0.5) {
diff = diff - pappso::DIFFC12C13;
mz = mz / _charge;
return mz;
}
void
PeptideEvidence::setExperimentalMass(pappso::pappso_double exp_mass)
{
_exp_mass = exp_mass;
}
pappso::mz
PeptideEvidence::getDeltaMass() const
{
return ((_exp_mass + pappso::MHPLUS) - _peptide_sp.get()->getMz(1));
}
pappso::mz
PeptideEvidence::getPpmDeltaMass() const
{
// return (_peptide_sp.get()->getMz(1) - (_exp_mass+pappso::MHPLUS));
pappso::pappso_double diff = getDeltaMass();
while(diff > 0.5)
{
diff = diff - pappso::DIFFC12C13;
}
diff = (diff / getPeptideXtpSp().get()->getMz(1)) * pappso::ONEMILLION;
return diff;
diff = (diff / getPeptideXtpSp().get()->getMz(1)) * pappso::ONEMILLION;
return diff;
}
void PeptideEvidence::setCharge(unsigned int charge) {
_charge =charge;
void
PeptideEvidence::setCharge(unsigned int charge)
{
_charge = charge;
}
void PeptideEvidence::setPeptideXtpSp (PeptideXtpSp peptide) {
_peptide_sp = peptide;
void
PeptideEvidence::setPeptideXtpSp(PeptideXtpSp peptide)
{
_peptide_sp = peptide;
}
void PeptideEvidence::setChecked(bool arg1) {
_checked = arg1;
void
PeptideEvidence::setChecked(bool arg1)
{
_checked = arg1;
}
ValidationState PeptideEvidence::getValidationState() const {
if (isGrouped()) {
return ValidationState::grouped;
} else if (isValidAndChecked()) {
return ValidationState::validAndChecked;
} else if (isValid()) {
return ValidationState::valid;
ValidationState
PeptideEvidence::getValidationState() const
{
if(isGrouped())
{
return ValidationState::grouped;
}
else if(isValidAndChecked())
{
return ValidationState::validAndChecked;
}
return ValidationState::notValid;
else if(isValid())
{
return ValidationState::valid;
}
return ValidationState::notValid;
}
bool PeptideEvidence::isValid() const {
return _proxy_valid;
bool
PeptideEvidence::isValid() const
{
return _proxy_valid;
}
bool PeptideEvidence::isChecked() const {
return _checked;
bool
PeptideEvidence::isChecked() const
{
return _checked;
}
bool PeptideEvidence::isValidAndChecked() const {
return _proxy_valid && _checked;
bool
PeptideEvidence::isValidAndChecked() const
{
return _proxy_valid && _checked;
}
bool PeptideEvidence::isGrouped() const {
if (_sp_grp_peptide.get() == nullptr) {
return false;
bool
PeptideEvidence::isGrouped() const
{
if(_sp_grp_peptide.get() == nullptr)
{
return false;
}
if (_sp_grp_peptide.get()->getGroupNumber() ==0) {
return false;
if(_sp_grp_peptide.get()->getGroupNumber() == 0)
{
return false;
}
return true;
return true;
}
void PeptideEvidence::setIdentificationDataSource(IdentificationDataSource* identification_source) {
_p_identification_source = identification_source;
void
PeptideEvidence::setIdentificationDataSource(
IdentificationDataSource *identification_source)
{
_p_identification_source = identification_source;
if(_identification_engine == IdentificationEngine::unknown)
{
_identification_engine = identification_source->getIdentificationEngine();
}
}
IdentificationDataSource* PeptideEvidence::getIdentificationDataSource () const {
return _p_identification_source;
IdentificationDataSource *
PeptideEvidence::getIdentificationDataSource() const
{
return _p_identification_source;
}
unsigned int PeptideEvidence::getScan() const {
return _scan;
unsigned int
PeptideEvidence::getScan() const
{
return _scan;
}
pappso::pappso_double PeptideEvidence::getRetentionTime() const {
return _rt;
pappso::pappso_double
PeptideEvidence::getRetentionTime() const
{
return _rt;
}
unsigned int PeptideEvidence::getCharge() const {
return _charge;
unsigned int
PeptideEvidence::getCharge() const
{
return _charge;
}
const PeptideXtpSp & PeptideEvidence::getPeptideXtpSp() const {
//if (_sp_grp_peptide.get() == nullptr) {
// throw pappso::PappsoException(QObject::tr("Peptide is null in %1 %2").arg(_msrunid_sp->getXmlId()).arg(this->getScan()));
//}
return _peptide_sp;
const PeptideXtpSp &
PeptideEvidence::getPeptideXtpSp() const
{
// if (_sp_grp_peptide.get() == nullptr) {
// throw pappso::PappsoException(QObject::tr("Peptide is null in %1
// %2").arg(_msrunid_sp->getXmlId()).arg(this->getScan()));
//}
return _peptide_sp;
}
const MsRun * PeptideEvidence::getMsRunP() const {
return _msrunid_sp;
const MsRun *
PeptideEvidence::getMsRunP() const
{
return _msrunid_sp;
}
void PeptideEvidence::setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide) {
_sp_grp_peptide =sp_grp_peptide;
void
PeptideEvidence::setGrpPeptideSp(const pappso::GrpPeptideSp &sp_grp_peptide)
{
_sp_grp_peptide = sp_grp_peptide;
}
const pappso::GrpPeptideSp & PeptideEvidence::getGrpPeptideSp() const {
return _sp_grp_peptide;
const pappso::GrpPeptideSp &
PeptideEvidence::getGrpPeptideSp() const
{
return _sp_grp_peptide;
}
......@@ -93,6 +93,12 @@ public :
void setCharge(unsigned int charge);
void setPeptideXtpSp (PeptideXtpSp peptide);
void setIdentificationDataSource(IdentificationDataSource* identification_source);
/** @brief sets the identification engine
* by default, this is the identification engine of the datasource
*/
void setIdentificationEngine(IdentificationEngine identification_engine);
void setChecked(bool arg1);
bool isChecked() const;
bool isValid() const;
......@@ -157,5 +163,9 @@ private :
/** @brief automatic filter result (false by default)
*/
bool _proxy_valid = false;
/** @brief the search/identification engine that found this evidence
*/
IdentificationEngine _identification_engine;
};
#endif // PEPTIDEEVIDENCE_H
This diff is collapsed.
......@@ -7,24 +7,24 @@
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
* Copyright (c) 2018 Olivier Langella <Olivier.Langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef PEPXMLSAXHANDLER_H
......@@ -42,8 +42,8 @@ class PepXmlSaxHandler : public QXmlDefaultHandler
{
public:
PepXmlSaxHandler(Project *p_project,
IdentificationGroup *p_identification_group,
IdentificationDataSource *p_identification_data_source);
IdentificationGroup *p_identification_group,
IdentificationDataSource *p_identification_data_source);
~PepXmlSaxHandler();
bool startElement(const QString &namespaceURI, const QString &localName,
......@@ -66,13 +66,18 @@ class PepXmlSaxHandler : public QXmlDefaultHandler
private:
bool startElement_msms_pipeline_analysis(QXmlAttributes attrs);
bool startElement_protein(QXmlAttributes attributes);
bool startElement_note(QXmlAttributes attributes);
bool startElement_file(QXmlAttributes attributes);
bool startElement_aa(QXmlAttributes attributes);
bool startElement_domain(QXmlAttributes attributes);
bool endElement_domain();
bool endElement_note();
bool startElement_msms_run_summary(QXmlAttributes attributes);
bool startElement_search_database(QXmlAttributes attributes);
bool startElement_search_summary(QXmlAttributes attributes);
bool startElement_spectrum_query(QXmlAttributes attributes);
bool startElement_search_hit(QXmlAttributes attributes);
bool startElement_alternative_protein(QXmlAttributes attributes);
bool startElement_peptideprophet_result(QXmlAttributes attributes);
bool startElement_interprophet_result(QXmlAttributes attributes);
bool startElement_search_score(QXmlAttributes attributes);
bool startElement_mod_aminoacid_mass(QXmlAttributes attributes);
bool endElement_search_hit();
bool endElement_modification_info();
private:
std::vector<QString> _tag_stack;
......@@ -84,22 +89,21 @@ class PepXmlSaxHandler : public QXmlDefaultHandler
IdentificationDataSource *_p_identification_data_source;
MsRunSp _sp_msrun;
ProteinMatch *_p_protein_match;
std::vector<ProteinMatch *> _p_protein_match_list;
PeptideEvidence *_p_peptide_evidence;
PeptideMatch _current_peptide_match;
ProteinXtp _current_protein;
PeptideXtpSp _current_peptide_sp;
QMap<QString, pappso::AaModificationP> _map_massstr_aamod;
QString _current_group_label;
QString _current_search_engine;
QString _current_group_type;
QString _current_note_label;
QString _current_note_type;
unsigned int _scan;
pappso::pappso_double _mhplus_obser;
unsigned int _charge;
pappso::pappso_double _retention_time;
unsigned int _current_charge;
pappso::pappso_double _current_retention_time;
pappso::pappso_double _current_precursor_neutral_mass;
bool _is_protein_description = false;
};
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
#include "../core/identification_sources/identificationxtandemfile.h"
#include "../core/identification_sources/identificationmascotdatfile.h"
#include "../core/identification_sources/identificationpwizfile.h"
#include "../core/identification_sources/identificationpepxmlfile.h"
#include <pappsomspp/pappsoexception.h>
#include <pappsomspp/utils.h>
......@@ -90,7 +91,7 @@ IdentificationDataSourceSp IdentificationDataSourceStore::getInstance(const QStr
}
else {
QFileInfo location_file(location);
QString ext = location_file.suffix();
QString ext = location_file.completeSuffix();
//QString sample_name = location_file.baseName();
IdentificationDataSourceSp p_identfile = nullptr;
if (ext.toLower() == "xml") {
......@@ -98,7 +99,10 @@ IdentificationDataSourceSp IdentificationDataSourceStore::getInstance(const QStr
p_identfile = std::make_shared<IdentificationXtandemFile>(location_file);
} else if (ext.toLower() == "pep") {
//pep xml file
p_identfile = std::make_shared<IdentificationPwizFile>(location_file);
p_identfile = std::make_shared<IdentificationPepXmlFile>(location_file);
} else if (ext.toLower() == "pep.xml") {
//pep xml file
p_identfile = std::make_shared<IdentificationPepXmlFile>(location_file);
} else if (ext.toLower() == "dat") {
//MASCOT dat file
p_identfile = std::make_shared<IdentificationMascotDatFile>(location_file);
......
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/
#ifndef _TYPES_H_
......@@ -31,82 +32,104 @@
/** \def ExternalDatabase external database references
*
*/
enum class ExternalDatabase: std::int8_t {
OboPsiMod =1, ///< OBO PSI MOD
SwissProt =2, ///< Swiss-Prot
TrEMBL=3, ///< TrEMBL
AGI_LocusCode=4, ///< AGI_LocusCode
NCBI_gi=5, ///< NCBI_gi
ref=6 ///< ref
enum class ExternalDatabase : std::int8_t
{
OboPsiMod = 1, ///< OBO PSI MOD
SwissProt = 2, ///< Swiss-Prot
TrEMBL = 3, ///< TrEMBL
AGI_LocusCode = 4, ///< AGI_LocusCode
NCBI_gi = 5, ///< NCBI_gi
ref = 6 ///< ref
};
/** \def IdentificationEngine identification engine
*
*/
enum class IdentificationEngine: std::int8_t {
unknown=0, ///< X!Tandem
XTandem=1, ///< X!Tandem
mascot=2, ///< Mascot
peptider=3 ///< peptider
enum class IdentificationEngine : std::int8_t
{
unknown = 0, ///< X!Tandem
XTandem = 1, ///< MS:1001476 X!Tandem was used to analyze the spectra.
mascot = 2, ///< MS:1001207 The name of the Mascot search engine.
peptider = 3, ///< peptider
OMSSA = 4, ///< MS:1001475 Open Mass Spectrometry Search Algorithm was used to
///< analyze the spectra.
SEQUEST = 5, ///< MS:1001208 The name of the SEQUEST search engine.
Comet = 6, ///< MS:1002251 Comet open-source sequence search engine developed
///< at the University of Washington. PMID:23148064
Morpheus = 7, ///< MS:1002661 "Morpheus search engine." [PMID:23323968]
MSGFplus =
8, ///< MS:1002048 "MS-GF+ software used to analyze the spectra." [PSI:PI]
};
/** \def PeptideEvidenceParam peptide evidence specific parameters
* is_a: MS:1001143 ! PSM-level search engine specific statistic
*/
enum class PeptideEvidenceParam: std::int8_t {
tandem_hyperscore=0, ///< X!Tandem hyperscore MS:1001331
tandem_expectation_value=1, ///< X!Tandem expectation value MS:1001330
mascot_score=2, ///< PSI-MS MS:1001171 mascot:score 56.16
mascot_expectation_value=3///< PSI-MS MS:1001172 mascot:expectation value 2.42102904673618e-006
enum class PeptideEvidenceParam : std::int8_t
{
tandem_hyperscore = 0, ///< X!Tandem hyperscore MS:1001331
tandem_expectation_value = 1, ///< X!Tandem expectation value MS:1001330
mascot_score = 2, ///< PSI-MS MS:1001171 mascot:score 56.16
mascot_expectation_value =
3, ///< PSI-MS MS:1001172 mascot:expectation value 2.42102904673618e-006
peptide_prophet_probability = 4, ///< no PSI MS description
peptide_inter_prophet_probability = 5, ///< no PSI MS description
};
/** \def IdentificationEngineParam identification engine parameters
*
*/
enum class IdentificationEngineParam: std::int8_t {
tandem_param=0 ///< X!Tandem xml parameters file
enum class IdentificationEngineParam : std::int8_t
{
tandem_param = 0 ///< X!Tandem xml parameters file
};
/** \def IdentificationEngineStatistics identification engine statistics
*
*/
enum class IdentificationEngineStatistics: std::int8_t {
total_spectra_assigned=1, ///< total_spectra_assigned in one identification file (one sample)
total_spectra_used=2,///< total_spectra_used in one identification file (one sample)
total_peptide_used=3,///< total number of peptides generated and used in identification
total_proteins_used=4,///< total number of proteins generated and used in identification
total_unique_assigned=5,///< total number unique peptide sequence assigned
enum class IdentificationEngineStatistics : std::int8_t
{
total_spectra_assigned =
1, ///< total_spectra_assigned in one identification file (one sample)
total_spectra_used =
2, ///< total_spectra_used in one identification file (one sample)
total_peptide_used =
3, ///< total number of peptides generated and used in identification
total_proteins_used =
4, ///< total number of proteins generated and used in identification
total_unique_assigned = 5, ///< total number unique peptide sequence assigned
};
/** \def MsRunStatistics MS run statistics
*
*/
enum class MsRunStatistics: std::int8_t {
total_spectra=1, ///< total number of spectra
total_spectra_ms1=2,///< total number of MS1 spectra
total_spectra_ms2=3,///< total number of MS2 spectra
total_spectra_ms3=4,///< total number of MS3 spectra
enum class MsRunStatistics : std::int8_t
{
total_spectra = 1, ///< total number of spectra
total_spectra_ms1 = 2, ///< total number of MS1 spectra
total_spectra_ms2 = 3, ///< total number of MS2 spectra
total_spectra_ms3 = 4, ///< total number of MS3 spectra
};
/** \def ProjectMode separate each samples or combine all
*
*/
enum class ProjectMode {
individual, ///< separate each biological samples (2D spots for example)
combined ///< combine every MS runs to get only one protein list
enum class ProjectMode
{
individual, ///< separate each biological samples (2D spots for example)
combined ///< combine every MS runs to get only one protein list
};
/** \def GroupingType list of available grouping algoritms
*
*/
enum class GroupingType {
PeptideMass, ///< protein grouper algo
Phospho, ///< phospho peptides grouping
SampleScan ///< X!TandemPipeline algo
enum class GroupingType
{
PeptideMass, ///< protein grouper algo
Phospho, ///< phospho peptides grouping
SampleScan ///< X!TandemPipeline algo
};
......@@ -114,11 +137,14 @@ enum class GroupingType {
*
*/
enum class ValidationState: std::int8_t {
notValid = 0,///< notValid : automatic filter validation failed
valid =1, ///< valid : automatic filter validation passed
validAndChecked=2, ///< validAndChecked : automatic filter validation passed + manual checking
grouped=3 ///< grouped : automatic filter validation passed + manual checking + grouped
enum class ValidationState : std::int8_t
{
notValid = 0, ///< notValid : automatic filter validation failed
valid = 1, ///< valid : automatic filter validation passed
validAndChecked = 2, ///< validAndChecked : automatic filter validation passed
///< + manual checking
grouped = 3 ///< grouped : automatic filter validation passed + manual
///< checking + grouped
};
......
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