libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
peptidebase.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/masschroq/peptidebase.cpp
3 * \date 24/01/2025
4 * \author Olivier Langella
5 * \brief peptide model base in masschroqlite
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2025 Olivier Langella
10 *<Olivier.Langella@universite-paris-saclay.fr>.
11 *
12 * This file is part of MassChroQ.
13 *
14 * MassChroQ is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * MassChroQ is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with MassChroQ. If not, see <http://www.gnu.org/licenses/>.
26 *
27 ******************************************************************************/
28
29#include "peptidebase.h"
30
32 : msp_peptide(peptide_sp)
33{
34}
35
39
40
43{
44 return msp_peptide;
45}
46
47void
49{
50 qDebug();
51 if(ni_min_abundance > 0)
52 {
53 qDebug() << "if (_minimum_isotope_abundance > 0)";
54 mpa_peptideNaturalIsotopeList =
55 new pappso::PeptideNaturalIsotopeList(msp_peptide, 0.001);
56 }
57 qDebug();
58}
59
60
63{
64 return mpa_peptideNaturalIsotopeList;
65}
66
67const std::vector<pappso::PeptideNaturalIsotopeAverageSp> &
69 pappso::PrecisionPtr precision, std::uint8_t charge, double ni_min_abundance)
70{
71
72 QMutexLocker lock(&m_mutex);
73 if(m_niMinAbundance == ni_min_abundance)
74 {
75 }
76 else
77 {
78 m_peptideNaturalIsotopeAverageSpListByCharge.clear();
79 m_niMinAbundance = ni_min_abundance;
80 }
81
82 auto it = m_peptideNaturalIsotopeAverageSpListByCharge.find(charge);
83 if(it != m_peptideNaturalIsotopeAverageSpListByCharge.end())
84 {
85 if(it->second.size() == 0)
86 {
87 it->second = mpa_peptideNaturalIsotopeList->getByIntensityRatio(
88 charge, precision, ni_min_abundance);
89 }
90
91 return it->second;
92 }
93 else
94 {
95 auto it_insert = m_peptideNaturalIsotopeAverageSpListByCharge.insert(
96 {charge,
97 mpa_peptideNaturalIsotopeList->getByIntensityRatio(
98 charge, precision, ni_min_abundance)});
99
100 return it_insert.first->second;
101 }
102}
virtual const pappso::PeptideNaturalIsotopeList * getPeptideNaturalIsotopeList() const
get list of isotopes for this peptide needs computeIsotopologues before
virtual void computeIsotopologues(double ni_min_abundance)
compute possible isotopes for this molecule
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...
virtual const pappso::PeptideSp & getPappsoPeptideSp() const
get the peptide sequence
PeptideBase(const pappso::PeptideSp &peptide_sp)
std::shared_ptr< const Peptide > PeptideSp