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

Peptide prophet column display

parent 8b969320
No related branches found
No related tags found
No related merge requests found
...@@ -2,31 +2,33 @@ ...@@ -2,31 +2,33 @@
* \file utils/peptideevidence.h * \file utils/peptideevidence.h
* \date 18/11/2017 * \date 18/11/2017
* \author Olivier Langella * \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>. * Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>.
* *
* This file is part of XTPcpp. * This file is part of XTPcpp.
* *
* XTPcpp 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.
* *
* XTPcpp 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 XTPcpp. If not, see <http://www.gnu.org/licenses/>. * along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
* *
* Contributors: * Contributors:
* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and implementation * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
******************************************************************************/ *implementation
******************************************************************************/
#ifndef PEPTIDEEVIDENCE_H #ifndef PEPTIDEEVIDENCE_H
#define PEPTIDEEVIDENCE_H #define PEPTIDEEVIDENCE_H
...@@ -46,132 +48,139 @@ typedef std::shared_ptr<PeptideEvidence> PeptideEvidenceSp; ...@@ -46,132 +48,139 @@ typedef std::shared_ptr<PeptideEvidence> PeptideEvidenceSp;
class PeptideEvidence class PeptideEvidence
{ {
public : public:
PeptideEvidence(MsRun * msrunid_sp, unsigned int scan); PeptideEvidence(MsRun *msrunid_sp, unsigned int scan);
PeptideEvidence(const PeptideEvidence & other); PeptideEvidence(const PeptideEvidence &other);
std::size_t getHashSampleScan() const; std::size_t getHashSampleScan() const;
std::size_t getHashPeptideMassSample() const; std::size_t getHashPeptideMassSample() const;
PeptideEvidenceSp makePeptideEvidenceSp() const; PeptideEvidenceSp makePeptideEvidenceSp() const;
void setRetentionTime(pappso::pappso_double rt); void setRetentionTime(pappso::pappso_double rt);
void setEvalue(pappso::pappso_double evalue); void setEvalue(pappso::pappso_double evalue);
/** @brief get experimental mass of this peptide /** @brief get experimental mass of this peptide
* @return the computed mass given the precursor measured mass and the deduced peptide charge * @return the computed mass given the precursor measured mass and the deduced
*/ * peptide charge
pappso::pappso_double getExperimentalMass() const; */
pappso::pappso_double getExperimentalMass() const;
/** @brief get experimental MH+ of this peptide
* @return getExperimentalMass + MHPLUS /** @brief get experimental MH+ of this peptide
*/ * @return getExperimentalMass + MHPLUS
pappso::pappso_double getExperimentalMhplus() const; */
pappso::pappso_double getExperimentalMhplus() const;
/** @brief get experimental mz of this peptide
* @return the real mass measured (precuror mass) by the spectrometer /** @brief get experimental mz of this peptide
*/ * @return the real mass measured (precuror mass) by the spectrometer
pappso::pappso_double getExperimentalMz() const; */
pappso::pappso_double getExperimentalMz() const;
/** @brief set experimental mass of this peptide
* @arg exp_mass the computed mass given the precursor measured mass and the deduced peptide charge /** @brief set experimental mass of this peptide
*/ * @arg exp_mass the computed mass given the precursor measured mass and the
void setExperimentalMass(pappso::pappso_double exp_mass); * deduced peptide charge
*/
void setExperimentalMass(pappso::pappso_double exp_mass);
/** \brief set specific parameter value
*/ /** \brief set specific parameter value
virtual void setParam(PeptideEvidenceParam param, const QVariant& value); */
/** \brief get specific parameter value virtual void setParam(PeptideEvidenceParam param, const QVariant &value);
*/ /** \brief get specific parameter value
virtual const QVariant getParam(PeptideEvidenceParam param) const; */
virtual const QVariant getParam(PeptideEvidenceParam param) const;
const std::map<PeptideEvidenceParam, QVariant> & getParamList() const;
const std::map<PeptideEvidenceParam, QVariant> &getParamList() const;
void setCharge(unsigned int charge);
void setPeptideXtpSp (PeptideXtpSp peptide); void setCharge(unsigned int charge);
void setIdentificationDataSource(IdentificationDataSource* identification_source); void setPeptideXtpSp(PeptideXtpSp peptide);
void
setIdentificationDataSource(IdentificationDataSource *identification_source);
/** @brief sets the identification engine
* by default, this is the identification engine of the datasource
*/ /** @brief sets the identification engine
void setIdentificationEngine(IdentificationEngine identification_engine); * by default, this is the identification engine of the datasource
*/
/** @brief get the identification engine void setIdentificationEngine(IdentificationEngine identification_engine);
* by default, this is the identification engine of the datasource
*/ /** @brief get the identification engine
IdentificationEngine getIdentificationEngine() const; * by default, this is the identification engine of the datasource
*/
void setChecked(bool arg1); IdentificationEngine getIdentificationEngine() const;
bool isChecked() const;
bool isValid() const; void setChecked(bool arg1);
bool isValidAndChecked() const; bool isChecked() const;
bool isGrouped() const; bool isValid() const;
bool isValidAndChecked() const;
const MsRun * getMsRunP() const; bool isGrouped() const;
IdentificationDataSource* getIdentificationDataSource () const;
unsigned int getScan() const; const MsRun *getMsRunP() const;
pappso::pappso_double getRetentionTime() const; IdentificationDataSource *getIdentificationDataSource() const;
unsigned int getCharge() const; unsigned int getScan() const;
const PeptideXtpSp & getPeptideXtpSp() const; pappso::pappso_double getRetentionTime() const;
pappso::pappso_double getEvalue() const; unsigned int getCharge() const;
const PeptideXtpSp &getPeptideXtpSp() const;
void setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide); pappso::pappso_double getEvalue() const;
const pappso::GrpPeptideSp & getGrpPeptideSp() const;
void setGrpPeptideSp(const pappso::GrpPeptideSp &sp_grp_peptide);
/** @brief validate or invalidate peptides and proteins based automatic filters and manual checks const pappso::GrpPeptideSp &getGrpPeptideSp() const;
* */
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters); /** @brief validate or invalidate peptides and proteins based automatic
* filters and manual checks
/** @brief get delta between theoretical mhplus mass and mhplus experimental mass * */
* mhplus experimental mass - theoretical mhplus mass void updateAutomaticFilters(
*/ const AutomaticFilterParameters &automatic_filter_parameters);
pappso::mz getDeltaMass() const;
/** @brief get delta between theoretical mhplus mass and mhplus experimental
/** @brief get delta in ppm between theoretical mhplus mass and mhplus experimental mass * mass mhplus experimental mass - theoretical mhplus mass
* @return mhplus experimental mass - theoretical mhplus mass */
*/ pappso::mz getDeltaMass() const;
pappso::mz getPpmDeltaMass() const;
/** @brief get delta in ppm between theoretical mhplus mass and mhplus
/** @brief get theoretical (not observed) m/z based on peptide composition and charge * experimental mass
* @return theoretical mz mass * @return mhplus experimental mass - theoretical mhplus mass
*/ */
pappso::mz getTheoreticalMz() const; pappso::mz getPpmDeltaMass() const;
ValidationState getValidationState() const; /** @brief get theoretical (not observed) m/z based on peptide composition and
* charge
/** @brief tells if this peptide contains a protein position * @return theoretical mz mass
* the position is the amino acid position on the protein sequence (starts from 0) */
* */ pappso::mz getTheoreticalMz() const;
bool containsPosition(unsigned int position) const;
ValidationState getValidationState() const;
private :
static std::hash<std::string> _hash_fn; /** @brief tells if this peptide contains a protein position
MsRun * _msrunid_sp; * the position is the amino acid position on the protein sequence (starts
unsigned int _scan=0; * from 0)
size_t _hash_sample_scan; * */
pappso::GrpPeptideSp _sp_grp_peptide; bool containsPosition(unsigned int position) const;
PeptideXtpSp _peptide_sp;
pappso::pappso_double _rt; private:
pappso::pappso_double _evalue=0; static std::hash<std::string> _hash_fn;
pappso::pappso_double _exp_mass; MsRun *_msrunid_sp;
unsigned int _charge; unsigned int _scan = 0;
IdentificationDataSource* _p_identification_source = nullptr; size_t _hash_sample_scan;
std::map<PeptideEvidenceParam, QVariant> _params; pappso::GrpPeptideSp _sp_grp_peptide;
PeptideXtpSp _peptide_sp;
/** @brief manually checked by user (true by default) pappso::pappso_double _rt;
*/ pappso::pappso_double _evalue = 0;
bool _checked = true; pappso::pappso_double _exp_mass;
unsigned int _charge;
/** @brief automatic filter result (false by default) IdentificationDataSource *_p_identification_source = nullptr;
*/ std::map<PeptideEvidenceParam, QVariant> _params;
bool _proxy_valid = false;
/** @brief manually checked by user (true by default)
/** @brief the search/identification engine that found this evidence */
*/ bool _checked = true;
IdentificationEngine _identification_engine;
/** @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 #endif // PEPTIDEEVIDENCE_H
...@@ -56,13 +56,28 @@ PeptideTableModel::setProteinMatch(ProteinMatch *p_protein_match) ...@@ -56,13 +56,28 @@ PeptideTableModel::setProteinMatch(ProteinMatch *p_protein_match)
// QModelIndex bottomRight = createIndex(rowCount(),columnCount()); // QModelIndex bottomRight = createIndex(rowCount(),columnCount());
std::set<PeptideListColumn> engine_columns; std::set<PeptideListColumn> engine_columns;
bool first = true;
for(auto &&peptide_match : _p_protein_match->getPeptideMatchList()) for(auto &&peptide_match : _p_protein_match->getPeptideMatchList())
{ {
if(first)
{
QVariant var = peptide_match.getPeptideEvidence()->getParam(
PeptideEvidenceParam::peptide_prophet_probability);
if(!var.isNull())
{
}
var = peptide_match.getPeptideEvidence()->getParam(
PeptideEvidenceParam::peptide_inter_prophet_probability);
if(!var.isNull())
{
}
first = false;
}
IdentificationEngine engine = IdentificationEngine engine =
peptide_match.getPeptideEvidence()->getIdentificationEngine(); peptide_match.getPeptideEvidence()->getIdentificationEngine();
if(engine == IdentificationEngine::XTandem) if(engine == IdentificationEngine::XTandem)
{ {
engine_columns.insert(PeptideListColumn::hyperscore); engine_columns.insert(PeptideListColumn::tandem_hyperscore);
} }
else if(engine == IdentificationEngine::mascot) else if(engine == IdentificationEngine::mascot)
{ {
...@@ -95,7 +110,7 @@ PeptideTableModel::rowCount(const QModelIndex &parent) const ...@@ -95,7 +110,7 @@ PeptideTableModel::rowCount(const QModelIndex &parent) const
int int
PeptideTableModel::columnCount(const QModelIndex &parent) const PeptideTableModel::columnCount(const QModelIndex &parent) const
{ {
return 23; return 33;
} }
QVariant QVariant
PeptideTableModel::headerData(int section, Qt::Orientation orientation, PeptideTableModel::headerData(int section, Qt::Orientation orientation,
...@@ -333,7 +348,7 @@ PeptideTableModel::data(const QModelIndex &index, int role) const ...@@ -333,7 +348,7 @@ PeptideTableModel::data(const QModelIndex &index, int role) const
.getPeptideEvidence() .getPeptideEvidence()
->getPpmDeltaMass()); ->getPpmDeltaMass());
break; break;
case(std::int8_t)PeptideListColumn::hyperscore: case(std::int8_t)PeptideListColumn::tandem_hyperscore:
return _p_protein_match->getPeptideMatchList() return _p_protein_match->getPeptideMatchList()
.at(row) .at(row)
.getPeptideEvidence() .getPeptideEvidence()
...@@ -345,11 +360,25 @@ PeptideTableModel::data(const QModelIndex &index, int role) const ...@@ -345,11 +360,25 @@ PeptideTableModel::data(const QModelIndex &index, int role) const
.getPeptideEvidence() .getPeptideEvidence()
->getParam(PeptideEvidenceParam::mascot_score); ->getParam(PeptideEvidenceParam::mascot_score);
break; break;
case(std::int8_t)PeptideListColumn::peptide_prophet_probability:
return _p_protein_match->getPeptideMatchList()
.at(row)
.getPeptideEvidence()
->getParam(
PeptideEvidenceParam::peptide_prophet_probability);
break;
case(std::int8_t)
PeptideListColumn::peptide_inter_prophet_probability:
return _p_protein_match->getPeptideMatchList()
.at(row)
.getPeptideEvidence()
->getParam(
PeptideEvidenceParam::peptide_inter_prophet_probability);
break;
} }
} }
return QString("Row%1, Column%2") return QString();
.arg(index.row() + 1)
.arg(index.column() + 1);
} }
return QVariant(); return QVariant();
} }
...@@ -454,11 +483,15 @@ PeptideTableModel::getTitle(std::int8_t column) ...@@ -454,11 +483,15 @@ PeptideTableModel::getTitle(std::int8_t column)
case(std::int8_t)PeptideListColumn::delta_ppm: case(std::int8_t)PeptideListColumn::delta_ppm:
return "delta ppm"; return "delta ppm";
break; break;
case(std::int8_t)PeptideListColumn::hyperscore: case(std::int8_t)PeptideListColumn::tandem_hyperscore:
return "hyperscore"; return "hyperscore";
break; break;
case(std::int8_t)PeptideListColumn::mascot_score: case(std::int8_t)PeptideListColumn::mascot_score:
return "mascot score"; return "mascot score";
case(std::int8_t)PeptideListColumn::peptide_prophet_probability:
return "Prophet probability";
case(std::int8_t)PeptideListColumn::peptide_inter_prophet_probability:
return "Inter prophet probability";
} }
return ""; return "";
} }
...@@ -537,11 +570,15 @@ PeptideTableModel::getDescription(std::int8_t column) ...@@ -537,11 +570,15 @@ PeptideTableModel::getDescription(std::int8_t column)
return "peptide mass difference in ppm between observed mass and " return "peptide mass difference in ppm between observed mass and "
"theoretical mass"; "theoretical mass";
break; break;
case(std::int8_t)PeptideListColumn::hyperscore: case(std::int8_t)PeptideListColumn::tandem_hyperscore:
return "X!Tandem hyperscore"; return "X!Tandem hyperscore";
break; break;
case(std::int8_t)PeptideListColumn::mascot_score: case(std::int8_t)PeptideListColumn::mascot_score:
return "Mascot ion score"; return "Mascot ion score";
case(std::int8_t)PeptideListColumn::peptide_prophet_probability:
return "Peptide prophet probability";
case(std::int8_t)PeptideListColumn::peptide_inter_prophet_probability:
return "Peptide inter prophet probability";
} }
return ""; return "";
} }
......
...@@ -34,29 +34,40 @@ ...@@ -34,29 +34,40 @@
enum class PeptideListColumn : std::int8_t enum class PeptideListColumn : std::int8_t
{ {
checked = 0, ///< manual checked checked = 0, ///< manual checked
peptide_grouping_id = 1, ///< manual checked peptide_grouping_id = 1, ///< manual checked
engine = 2, engine = 2,
sample = 3, sample = 3,
scan = 4, scan = 4,
rtmin = 5, rtmin = 5,
rt = 6, rt = 6,
charge = 7, charge = 7,
experimental_mz = 8, experimental_mz = 8,
sequence = 9, sequence = 9,
modifs = 10, modifs = 10,
label = 11, label = 11,
start = 12, start = 12,
length = 13, length = 13,
used = 14, used = 14,
subgroups = 15, subgroups = 15,
Evalue = 16, Evalue = 16,
experimental_mhplus = 17, experimental_mhplus = 17,
theoretical_mhplus = 18, theoretical_mhplus = 18,
delta_mhplus = 19, delta_mhplus = 19,
delta_ppm = 20, delta_ppm = 20,
hyperscore = 21, peptide_prophet_probability = 21, ///< no PSI MS description
mascot_score = 22 peptide_inter_prophet_probability = 22, ///< no PSI MS description
tandem_hyperscore = 23, ///< X!Tandem hyperscore MS:1001331
mascot_score = 24, ///< PSI-MS MS:1001171 mascot:score 56.16
mascot_expectation_value =
25, ///< PSI-MS MS:1001172 mascot:expectation value 2.42102904673618e-006
omssa_evalue = 26, ///< MS:1001328 "OMSSA E-value." [PSI:PI]
omssa_pvalue = 27, ///< MS:1001329 "OMSSA p-value." [PSI:PI]
msgfplus_raw = 28, ///< MS:1002049 "MS-GF raw score." [PSI:PI]
msgfplus_denovo = 29, ///< MS:1002050 "MS-GF de novo score." [PSI:PI]
msgfplus_energy = 30, ///< MS:1002051 "MS-GF energy score." [PSI:PI]
msgfplus_SpecEValue = 31, ///< MS:1002052 "MS-GF spectral E-value." [PSI:PI]
msgfplus_EValue = 32, ///< MS:1002053 "MS-GF E-value." [PSI:PI]
}; };
class PeptideListWindow; class PeptideListWindow;
......
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