Commit dbfbf78d authored by Filippo Rusconi's avatar Filippo Rusconi
Browse files

Merge branch 'master' of forgemia.inra.fr:pappso/xtpcpp into master

parents 221bfa4f 0ef046ae
...@@ -79,11 +79,12 @@ Files: src/resources/icons/mit/jamicons/* ...@@ -79,11 +79,12 @@ Files: src/resources/icons/mit/jamicons/*
Copyright: 2017-2020 Michael Amprimo <https://github.com/michaelampr/jam> Copyright: 2017-2020 Michael Amprimo <https://github.com/michaelampr/jam>
License: MIT License: MIT
Files: */src/resources/html_doc
Copyright: The Global Proteome Machine Organization <https://www.thegpm.org/TANDEM/>
License: Artistic
Files: debian/* Files: debian/*
Copyright: 2015-2020 Olivier Langella <olivier.langella@universite-paris-saclay.fr> Copyright: 2015-2020 Olivier Langella <olivier.langella@universite-paris-saclay.fr>
2020 Filippo Rusconi <filippo.rusconi@universite-paris-saclay.fr> 2020 Filippo Rusconi <filippo.rusconi@universite-paris-saclay.fr>
License: GPL-3+ License: GPL-3+
...@@ -30,6 +30,16 @@ AutomaticFilterParameters::AutomaticFilterParameters() ...@@ -30,6 +30,16 @@ AutomaticFilterParameters::AutomaticFilterParameters()
AutomaticFilterParameters::AutomaticFilterParameters( AutomaticFilterParameters::AutomaticFilterParameters(
const AutomaticFilterParameters &other) const AutomaticFilterParameters &other)
{
this->operator=(other);
}
AutomaticFilterParameters::~AutomaticFilterParameters()
{
}
AutomaticFilterParameters &
AutomaticFilterParameters::operator=(const AutomaticFilterParameters &other)
{ {
_filter_minimum_peptide_evalue = other._filter_minimum_peptide_evalue; _filter_minimum_peptide_evalue = other._filter_minimum_peptide_evalue;
_filter_minimum_protein_evalue = other._filter_minimum_protein_evalue; _filter_minimum_protein_evalue = other._filter_minimum_protein_evalue;
...@@ -39,12 +49,11 @@ AutomaticFilterParameters::AutomaticFilterParameters( ...@@ -39,12 +49,11 @@ AutomaticFilterParameters::AutomaticFilterParameters(
m_filter_peptide_observed_in_less_samples_than = m_filter_peptide_observed_in_less_samples_than =
other.m_filter_peptide_observed_in_less_samples_than; other.m_filter_peptide_observed_in_less_samples_than;
m_filterFDR = other.m_filterFDR; m_filterFDR = other.m_filterFDR;
}
AutomaticFilterParameters::~AutomaticFilterParameters() return *this;
{
} }
void void
AutomaticFilterParameters::setFilterPeptideFDR(double fdr) AutomaticFilterParameters::setFilterPeptideFDR(double fdr)
{ {
......
...@@ -32,6 +32,8 @@ class AutomaticFilterParameters ...@@ -32,6 +32,8 @@ class AutomaticFilterParameters
AutomaticFilterParameters(const AutomaticFilterParameters &other); AutomaticFilterParameters(const AutomaticFilterParameters &other);
~AutomaticFilterParameters(); ~AutomaticFilterParameters();
AutomaticFilterParameters &operator=(const AutomaticFilterParameters &);
void setFilterPeptideEvalue(pappso::pappso_double evalue); void setFilterPeptideEvalue(pappso::pappso_double evalue);
void setFilterPeptideFDR(double fdr); void setFilterPeptideFDR(double fdr);
......
...@@ -385,6 +385,36 @@ IdentificationGroup::collectMhDelta( ...@@ -385,6 +385,36 @@ IdentificationGroup::collectMhDelta(
} }
} }
} }
void
IdentificationGroup::collectTargetDecoyMhDelta(
std::vector<pappso::pappso_double> &delta_list,
pappso::PrecisionUnit unit,
ValidationState state) const
{
std::set<const PeptideEvidence *> peptide_evidence_list;
for(auto &p_protein_match : _protein_match_list)
{
if(p_protein_match->getValidationState() == state)
{
p_protein_match->collectPeptideEvidences(peptide_evidence_list,
state);
}
}
for(const PeptideEvidence *p_peptide_evidence : peptide_evidence_list)
{
if(unit == pappso::PrecisionUnit::ppm)
{
delta_list.push_back(p_peptide_evidence->getPpmDeltaMass());
}
else
{
delta_list.push_back(p_peptide_evidence->getDeltaMass());
}
}
}
void void
IdentificationGroup::startGrouping( IdentificationGroup::startGrouping(
ContaminantRemovalMode contaminantRemovalMode, ContaminantRemovalMode contaminantRemovalMode,
......
...@@ -157,14 +157,33 @@ class IdentificationGroup ...@@ -157,14 +157,33 @@ class IdentificationGroup
bool containSample(const QString &sample) const; bool containSample(const QString &sample) const;
/** @brief collect mass delta between theoretical mass and observed mass /** @brief collect mass delta between theoretical mass and observed mass for
* each peptide evidence is only counted once * target sequences
*
* each peptide evidence is only counted once it counts only
* peptide evidence for target Sequences
* @param delta_list list of mass delta
* @param unit precision unit, ppm or dalton
* @param state validation state of the peptides to collect
*/ */
void collectMhDelta(std::vector<pappso::pappso_double> &delta_list, void collectMhDelta(std::vector<pappso::pappso_double> &delta_list,
pappso::PrecisionUnit unit, pappso::PrecisionUnit unit,
ValidationState state) const; ValidationState state) const;
/** @brief collect mass delta between theoretical mass and observed mass
*
* each peptide evidence is only counted once it counts target or decoy
* peptide evidence
* @param delta_list list of mass delta
* @param unit precision unit, ppm or dalton
* @param state validation state of the peptides to collect
*/
void collectTargetDecoyMhDelta(std::vector<pappso::pappso_double> &delta_list,
pappso::PrecisionUnit unit,
ValidationState state) const;
/** @brief look for a peptide in the same XIC /** @brief look for a peptide in the same XIC
* @param peptide_evidence_list the peptide evidence list to build * @param peptide_evidence_list the peptide evidence list to build
* @param p_msrun MSrun to look for * @param p_msrun MSrun to look for
......
...@@ -32,8 +32,7 @@ PeptideMatch::PeptideMatch() ...@@ -32,8 +32,7 @@ PeptideMatch::PeptideMatch()
PeptideMatch::PeptideMatch(const PeptideMatch &other) PeptideMatch::PeptideMatch(const PeptideMatch &other)
{ {
_start = other._start; this->operator=(other);
_p_peptide_evidence = other._p_peptide_evidence;
} }
bool bool
PeptideMatch::operator==(const PeptideMatch &other) const PeptideMatch::operator==(const PeptideMatch &other) const
...@@ -45,6 +44,17 @@ PeptideMatch::operator==(const PeptideMatch &other) const ...@@ -45,6 +44,17 @@ PeptideMatch::operator==(const PeptideMatch &other) const
} }
return false; return false;
} }
PeptideMatch &
PeptideMatch::operator=(const PeptideMatch &other)
{
_start = other._start;
_p_peptide_evidence = other._p_peptide_evidence;
return *this;
}
void void
PeptideMatch::setPeptideEvidenceSp(PeptideEvidenceSp sp_peptide_evidence) PeptideMatch::setPeptideEvidenceSp(PeptideEvidenceSp sp_peptide_evidence)
{ {
......
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
*implementation *implementation
******************************************************************************/ ******************************************************************************/
#ifndef PEPTIDEMATCH_H #pragma once
#define PEPTIDEMATCH_H
#include "peptideevidence.h" #include "peptideevidence.h"
...@@ -35,6 +34,8 @@ class PeptideMatch ...@@ -35,6 +34,8 @@ class PeptideMatch
bool operator==(const PeptideMatch &other) const; bool operator==(const PeptideMatch &other) const;
PeptideMatch &operator=(const PeptideMatch &);
/** @brief set start position of this peptide inside the protein sequence /** @brief set start position of this peptide inside the protein sequence
* @param start position in the protein amino acid sequence (starts at 0) * @param start position in the protein amino acid sequence (starts at 0)
...@@ -66,5 +67,3 @@ class PeptideMatch ...@@ -66,5 +67,3 @@ class PeptideMatch
unsigned int _start = 0; unsigned int _start = 0;
PeptideEvidence *_p_peptide_evidence = nullptr; PeptideEvidence *_p_peptide_evidence = nullptr;
}; };
#endif // PEPTIDEMATCH_H
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>. * Copyright (c) 2015 Olivier Langella <olivier.langella@u-psud.fr>.
* *
* This file is part of PAPPSOms-tools. * This file is part of XTPcpp.
* *
* PAPPSOms-tools is free software: you can redistribute it and/or modify * XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* PAPPSOms-tools is distributed in the hope that it will be useful, * XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>. * along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
* *
* Contributors:
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
*implementation
******************************************************************************/ ******************************************************************************/
#include "config.h" #include "config.h"
......
...@@ -832,7 +832,7 @@ ProticdbMl::writeMatch(std::vector<const ProteinMatch *> &protein_match_sg_list) ...@@ -832,7 +832,7 @@ ProticdbMl::writeMatch(std::vector<const ProteinMatch *> &protein_match_sg_list)
sample_name_list sample_name_list
<< peptide_match.getPeptideEvidence()->getMsRunP()->getSampleName(); << peptide_match.getPeptideEvidence()->getMsRunP()->getSampleName();
} }
sample_name_list = sample_name_list.toSet().toList(); sample_name_list = sample_name_list.toSet().values();
for(QString sample_name : sample_name_list) for(QString sample_name : sample_name_list)
{ {
_output_stream->writeStartElement("matchSample"); _output_stream->writeStartElement("matchSample");
......
...@@ -28,13 +28,12 @@ ...@@ -28,13 +28,12 @@
*implementation *implementation
******************************************************************************/ ******************************************************************************/
#ifndef PROTICDBML_H #pragma once
#define PROTICDBML_H
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
#include <QFile> #include <QFile>
#include <QString> #include <QString>
#include <QTime> #include <QElapsedTimer>
#include <pappsomspp/amino_acid/aamodification.h> #include <pappsomspp/amino_acid/aamodification.h>
#include "../core/project.h" #include "../core/project.h"
#include "../grouping/groupinggroup.h" #include "../grouping/groupinggroup.h"
...@@ -76,10 +75,8 @@ class ProticdbMl ...@@ -76,10 +75,8 @@ class ProticdbMl
QXmlStreamWriter *_output_stream; QXmlStreamWriter *_output_stream;
ProjectSp _sp_project; ProjectSp _sp_project;
IdentificationGroup *_p_identification_group; IdentificationGroup *_p_identification_group;
QTime _duracel; QElapsedTimer _duracel;
std::map<QString, QString> _map_accession2xmlid; std::map<QString, QString> _map_accession2xmlid;
std::map<QString, QString> _sample_to_id; std::map<QString, QString> _sample_to_id;
std::map<QString, QString> _peptidekey_to_id; std::map<QString, QString> _peptidekey_to_id;
}; };
#endif // PROTICDBML_H
/*******************************************************************************
* 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/>.
*
******************************************************************************/
#include "utils.h" #include "utils.h"
#include <pappsomspp/exception/exceptionnotfound.h> #include <pappsomspp/exception/exceptionnotfound.h>
#include <pappsomspp/mzrange.h> #include <pappsomspp/mzrange.h>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment