Loading...
Searching...
No Matches
selfspectrumdatapoint.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/processing/specself/selfspectrumdatapoint.h
* \date 23/03/2024
* \author Olivier Langella
* \brief spectrum self data points stored in the self spectrum matrix
*/
/*******************************************************************************
* Copyright (c) 2024 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of PAPPSOms++.
*
* PAPPSOms++ 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.
*
* PAPPSOms++ 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 PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "selfspectrumdatapoint.h"
namespace pappso
{
namespace specself
{
void
SelfSpectrumDataPoint::fillSelfSpectrumDataPoint(
const pappso::AaStringCodeMassMatching &codec_mass_matching,
const DataPoint &peak1,
const DataPoint &peak2)
{
massDelta = peak1.x - peak2.x;
// qDebug() << massDelta;
if(massDelta > 0)
{
aaCodeList = codec_mass_matching.getAaCodeFromMass(massDelta);
}
// m_targetMzSum = m_precursorMass + pappso::MHPLUS + pappso::MHPLUS;
// double precusorBion = m_targetMzSum - pappso::MASSH2O - pappso::MPROTIUM;
// if peak2 is the other ion suite (Y <=> B)
antiMassDelta = 0;
antiAaCodeList.clear();
// qDebug();
}
void
SelfSpectrumDataPoint::fillAntiSpectrumDataPoint(
double precursor_mass,
const pappso::AaStringCodeMassMatching &codec_mass_matching,
const DataPoint &peak1,
const DataPoint &peak2)
{
precursor_mass = precursor_mass + MHPLUS + MHPLUS;
antiMassDelta = (precursor_mass - peak1.x) - peak2.x;
m_isComplement = false;
if(std::abs(antiMassDelta) < codec_mass_matching.getPrecisionPtr()->getNominal())
{
m_isComplement = true;
}
else
{
if(antiMassDelta > 0)
{
antiAaCodeList = codec_mass_matching.getAaCodeFromMass(antiMassDelta);
}
}
}
void
SelfSpectrumDataPoint::setVariableModification(
const pappso::AaStringCodeMassMatching &codec_mass_matching, const Aa &aa, int quantifier)
{
if(massDelta > 0)
{
std::vector<uint32_t> new_code_list =
codec_mass_matching.getAaCodeFromMassWearingModification(massDelta, aa, quantifier);
std::copy(new_code_list.begin(), new_code_list.end(), std::back_inserter(aaCodeList));
}
if(antiMassDelta > 0)
{
std::vector<uint32_t> new_code_list =
codec_mass_matching.getAaCodeFromMassWearingModification(antiMassDelta, aa, quantifier);
std::copy(new_code_list.begin(), new_code_list.end(), std::back_inserter(antiAaCodeList));
}
}
} // namespace specself
} // namespace pappso
pappso::AaStringCodeMassMatching
convert a list of mass to amino acid string codes
Definition aastringcodemassmatching.h:41
pappso::AaStringCodeMassMatching::getAaCodeFromMass
std::vector< uint32_t > getAaCodeFromMass(double mass) const
get amino acid string code from a single mass delta
Definition aastringcodemassmatching.cpp:85
pappso::AaStringCodeMassMatching::getPrecisionPtr
PrecisionPtr getPrecisionPtr() const
Definition aastringcodemassmatching.cpp:78
pappso::AaStringCodeMassMatching::getAaCodeFromMassWearingModification
std::vector< uint32_t > getAaCodeFromMassWearingModification(double mass, const Aa &aa, int quantifier) const
get amino acid string code from a single mass delta wearing a specific modification
Definition aastringcodemassmatching.cpp:129
pappso::Aa
Definition aa.h:45
pappso::PrecisionBase::getNominal
virtual pappso_double getNominal() const final
Definition precision.cpp:73
pappso::specself
Definition selfspectrum.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
selfspectrumdatapoint.h
pappso::DataPoint
Definition datapoint.h:22
pappso::DataPoint::x
pappso_double x
Definition datapoint.h:24
pappso::specself::SelfSpectrumDataPoint::aaCodeList
std::vector< uint32_t > aaCodeList
Definition selfspectrumdatapoint.h:59
pappso::specself::SelfSpectrumDataPoint::setVariableModification
void setVariableModification(const pappso::AaStringCodeMassMatching &codec_mass_matching, const Aa &aa, int quantifier)
Definition selfspectrumdatapoint.cpp:88
pappso::specself::SelfSpectrumDataPoint::fillAntiSpectrumDataPoint
void fillAntiSpectrumDataPoint(double precursor_mass, const pappso::AaStringCodeMassMatching &codec_mass_matching, const DataPoint &peak1, const DataPoint &peak2)
Definition selfspectrumdatapoint.cpp:62
pappso::specself::SelfSpectrumDataPoint::antiAaCodeList
std::vector< uint32_t > antiAaCodeList
Definition selfspectrumdatapoint.h:60
pappso::specself::SelfSpectrumDataPoint::m_isComplement
bool m_isComplement
Definition selfspectrumdatapoint.h:56
pappso::specself::SelfSpectrumDataPoint::antiMassDelta
double antiMassDelta
Definition selfspectrumdatapoint.h:58
pappso::specself::SelfSpectrumDataPoint::fillSelfSpectrumDataPoint
void fillSelfSpectrumDataPoint(const pappso::AaStringCodeMassMatching &codec_mass_matching, const DataPoint &peak1, const DataPoint &peak2)
Definition selfspectrumdatapoint.cpp:38
pappso::specself::SelfSpectrumDataPoint::massDelta
double massDelta
Definition selfspectrumdatapoint.h:57