Loading...
Searching...
No Matches
peptidebase.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/masschroq/peptidebase.cpp
* \date 24/01/2025
* \author Olivier Langella
* \brief peptide model base in masschroqlite
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of MassChroQ.
*
* MassChroQ 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.
*
* MassChroQ 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 MassChroQ. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include "peptidebase.h"
pappso::masschroq::PeptideBase::PeptideBase(const pappso::PeptideSp &peptide_sp)
: msp_peptide(peptide_sp)
{
}
pappso::masschroq::PeptideBase::~PeptideBase()
{
}
const pappso::PeptideSp &
pappso::masschroq::PeptideBase::getPappsoPeptideSp() const
{
return msp_peptide;
}
void
pappso::masschroq::PeptideBase::computeIsotopologues(double ni_min_abundance)
{
qDebug();
if(ni_min_abundance > 0)
{
qDebug() << "if (_minimum_isotope_abundance > 0)";
mpa_peptideNaturalIsotopeList = new pappso::PeptideNaturalIsotopeList(msp_peptide, 0.001);
}
qDebug();
}
const pappso::PeptideNaturalIsotopeList *
pappso::masschroq::PeptideBase::getPeptideNaturalIsotopeList() const
{
return mpa_peptideNaturalIsotopeList;
}
const std::vector<pappso::PeptideNaturalIsotopeAverageSp> &
pappso::masschroq::PeptideBase::getPeptideNaturalIsotopeAverageSpList(
pappso::PrecisionPtr precision, std::uint8_t charge, double ni_min_abundance)
{
QMutexLocker lock(&m_mutex);
if(m_niMinAbundance == ni_min_abundance)
{
}
else
{
m_peptideNaturalIsotopeAverageSpListByCharge.clear();
m_niMinAbundance = ni_min_abundance;
}
auto it = m_peptideNaturalIsotopeAverageSpListByCharge.find(charge);
if(it != m_peptideNaturalIsotopeAverageSpListByCharge.end())
{
if(it->second.size() == 0)
{
it->second =
mpa_peptideNaturalIsotopeList->getByIntensityRatio(charge, precision, ni_min_abundance);
}
return it->second;
}
else
{
auto it_insert = m_peptideNaturalIsotopeAverageSpListByCharge.insert(
{charge,
mpa_peptideNaturalIsotopeList->getByIntensityRatio(charge, precision, ni_min_abundance)});
return it_insert.first->second;
}
}
pappso::PeptideNaturalIsotopeList
Definition peptidenaturalisotopelist.h:49
pappso::masschroq::PeptideBase::m_niMinAbundance
double m_niMinAbundance
Definition peptidebase.h:92
pappso::masschroq::PeptideBase::msp_peptide
const pappso::PeptideSp msp_peptide
Definition peptidebase.h:88
pappso::masschroq::PeptideBase::m_mutex
QMutex m_mutex
Definition peptidebase.h:93
pappso::masschroq::PeptideBase::getPeptideNaturalIsotopeList
virtual const pappso::PeptideNaturalIsotopeList * getPeptideNaturalIsotopeList() const
get list of isotopes for this peptide needs computeIsotopologues before
Definition peptidebase.cpp:61
pappso::masschroq::PeptideBase::computeIsotopologues
virtual void computeIsotopologues(double ni_min_abundance)
compute possible isotopes for this molecule
Definition peptidebase.cpp:48
pappso::masschroq::PeptideBase::~PeptideBase
virtual ~PeptideBase()
Definition peptidebase.cpp:36
pappso::masschroq::PeptideBase::getPeptideNaturalIsotopeAverageSpList
virtual const std::vector< pappso::PeptideNaturalIsotopeAverageSp > & getPeptideNaturalIsotopeAverageSpList(pappso::PrecisionPtr precision, std::uint8_t charge, double ni_min_abundance)
get possible and distinguishable masses of isotopes get list of distinguishable isotopes given the ch...
Definition peptidebase.cpp:67
pappso::masschroq::PeptideBase::getPappsoPeptideSp
virtual const pappso::PeptideSp & getPappsoPeptideSp() const
get the peptide sequence
Definition peptidebase.cpp:42
pappso::masschroq::PeptideBase::PeptideBase
PeptideBase(const pappso::PeptideSp &peptide_sp)
Definition peptidebase.cpp:31
pappso::masschroq::PeptideBase::mpa_peptideNaturalIsotopeList
pappso::PeptideNaturalIsotopeList * mpa_peptideNaturalIsotopeList
Definition peptidebase.h:89
pappso::masschroq::PeptideBase::m_peptideNaturalIsotopeAverageSpListByCharge
std::map< std::uint8_t, std::vector< pappso::PeptideNaturalIsotopeAverageSp > > m_peptideNaturalIsotopeAverageSpListByCharge
Definition peptidebase.h:91
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
peptidebase.h