Loading...
Searching...
No Matches
experimentalspectrum.h
Go to the documentation of this file.
/**
* \file pappsomspp/processing/specglob/experimentalspectrum.h
* \date 08/11/2023
* \author Olivier Langella
* \brief transform a spectrum to SpecGlob spectra
*
* C++ implementation of the SpecGlob algorithm described in :
* 1. Prunier, G. et al. Fast alignment of mass spectra in large proteomics
* datasets, capturing dissimilarities arising from multiple complex
* modifications of peptides. BMC Bioinformatics 24, 421 (2023).
*
* HAL Id : hal-04296170 , version 1
* Mot de passe : hxo20cl
* DOI : 10.1186/s12859-023-05555-y
*/
/*
* SpecGlobTool, Spectra to peptide alignment tool
* Copyright (C) 2023 Olivier Langella
* <olivier.langella@universite-paris-saclay.fr>
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "../../massspectrum/qualifiedmassspectrum.h"
#include "pappsomspp/export-import-config.h"
#include "types.h"
namespace pappso
{
namespace specglob
{
struct ExperimentalSpectrumDataPoint
{
ExperimentalSpectrumDataPointType type;
double peak_mz = 0;
std::size_t indice;
};
class ExperimentalSpectrum;
typedef std::shared_ptr<const ExperimentalSpectrum> ExperimentalSpectrumCsp;
/**
* @todo write docs
*/
class PMSPP_LIB_DECL ExperimentalSpectrum : public std::vector<ExperimentalSpectrumDataPoint>
{
public:
/**
* Default constructor
*/
ExperimentalSpectrum(const pappso::QualifiedMassSpectrum &qmass_spectrum,
pappso::PrecisionPtr precision_ptr);
/**
* specpeptidoms post-processing constructor
*/
ExperimentalSpectrum(const pappso::QualifiedMassSpectrum &qmass_spectrum,
pappso::PrecisionPtr precision_ptr,
double precursor_mass_error);
/**
* Copy constructor
*
* @param other TODO
*/
ExperimentalSpectrum(const ExperimentalSpectrum &other);
/**
* Destructor
*/
virtual ~ExperimentalSpectrum();
std::vector<double> getMassList() const;
/** @brief compute the symmetric mass
* for debuggin purpose
*/
double getSymetricMz(double mz) const;
double getTargetMzSum() const;
double getPrecursorMass() const;
std::vector<double> getMassList(ExperimentalSpectrumDataPointType type) const;
QString toString() const;
const pappso::QualifiedMassSpectrum &getQualifiedMassSpectrum() const;
/** @brief find the peak for wich mass difference from rbegin corresponds to
* aaTheoMass Find if a peak back in the peak list has a mass difference that
* corresponds to the targeted mass
*
* @param start_position reverse iterator on the reference peak to look for
* mass difference from
* @param targeted_mass_range the mass difference to look forconst
* pappso::PeptideSp peptide_sp
* @return a reverse iterator on the peak (found) or the end of the search
* (not found)
*/
std::vector<ExperimentalSpectrumDataPoint>::const_reverse_iterator
reverseFindDiffMz(std::size_t start_position, const pappso::MzRange &targeted_mass_range) const;
private:
/** @brief add symmetric peaks to the spectrum
* Create a SymetricPeakList that contain symmetric peaks and the information
* if a peak is the initial peak, the symmetric peak, or both if already
* exist.
* assuming fragment ion charge is 1
*/
void createSymetricPeakList();
void createSymetricPeakList(double precursor_mass_error);
/** @brief find the correspondin mz in the mass spectrum (given the precision)
*/
std::vector<pappso::DataPoint>::const_iterator findMz(double mz);
private:
pappso::QualifiedMassSpectrum m_qualifiedMassSpectrum;
double m_targetMzSum;
double m_precursorMass;
pappso::PrecisionPtr m_precisionPtr;
};
} // namespace specglob
} // namespace pappso
pappso::MzRange
Definition mzrange.h:46
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition qualifiedmassspectrum.h:99
pappso::specglob::ExperimentalSpectrum
Definition experimentalspectrum.h:64
pappso::specglob::ExperimentalSpectrum::getSymetricMz
double getSymetricMz(double mz) const
compute the symmetric mass for debuggin purpose
Definition experimentalspectrum.cpp:207
pappso::specglob::ExperimentalSpectrum::getMassList
std::vector< double > getMassList() const
Definition experimentalspectrum.cpp:195
pappso::specglob::ExperimentalSpectrum::getPrecursorMass
double getPrecursorMass() const
Definition experimentalspectrum.cpp:237
pappso::specglob::ExperimentalSpectrum::getQualifiedMassSpectrum
const pappso::QualifiedMassSpectrum & getQualifiedMassSpectrum() const
Definition experimentalspectrum.cpp:284
pappso::specglob::ExperimentalSpectrum::getTargetMzSum
double getTargetMzSum() const
Definition experimentalspectrum.cpp:189
pappso::specglob::ExperimentalSpectrum::m_precisionPtr
pappso::PrecisionPtr m_precisionPtr
Definition experimentalspectrum.h:141
pappso::specglob::ExperimentalSpectrum::m_precursorMass
double m_precursorMass
Definition experimentalspectrum.h:140
pappso::specglob::ExperimentalSpectrum::reverseFindDiffMz
std::vector< ExperimentalSpectrumDataPoint >::const_reverse_iterator reverseFindDiffMz(std::size_t start_position, const pappso::MzRange &targeted_mass_range) const
find the peak for wich mass difference from rbegin corresponds to aaTheoMass Find if a peak back in t...
Definition experimentalspectrum.cpp:243
pappso::specglob::ExperimentalSpectrum::toString
QString toString() const
Definition experimentalspectrum.cpp:226
pappso::specglob::ExperimentalSpectrum::ExperimentalSpectrum
ExperimentalSpectrum(const pappso::QualifiedMassSpectrum &qmass_spectrum, pappso::PrecisionPtr precision_ptr)
Definition experimentalspectrum.cpp:45
pappso::specglob::ExperimentalSpectrum::createSymetricPeakList
void createSymetricPeakList()
add symmetric peaks to the spectrum Create a SymetricPeakList that contain symmetric peaks and the in...
Definition experimentalspectrum.cpp:77
pappso::specglob::ExperimentalSpectrum::findMz
std::vector< pappso::DataPoint >::const_iterator findMz(double mz)
find the correspondin mz in the mass spectrum (given the precision)
Definition experimentalspectrum.cpp:169
pappso::specglob::ExperimentalSpectrum::m_targetMzSum
double m_targetMzSum
Definition experimentalspectrum.h:139
pappso::specglob::ExperimentalSpectrum::m_qualifiedMassSpectrum
pappso::QualifiedMassSpectrum m_qualifiedMassSpectrum
Definition experimentalspectrum.h:138
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso::specglob
Definition experimentalspectrum.cpp:44
pappso::specglob::ExperimentalSpectrumCsp
std::shared_ptr< const ExperimentalSpectrum > ExperimentalSpectrumCsp
Definition experimentalspectrum.h:59
pappso::specglob::ExperimentalSpectrumDataPointType
ExperimentalSpectrumDataPointType
Definition types.h:78
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
types.h
qualifiedmassspectrum.h
pappso::specglob::ExperimentalSpectrumDataPoint
Definition experimentalspectrum.h:51
pappso::specglob::ExperimentalSpectrumDataPoint::indice
std::size_t indice
Definition experimentalspectrum.h:54
pappso::specglob::ExperimentalSpectrumDataPoint::peak_mz
double peak_mz
Definition experimentalspectrum.h:53
pappso::specglob::ExperimentalSpectrumDataPoint::type
ExperimentalSpectrumDataPointType type
Definition experimentalspectrum.h:52