Loading...
Searching...
No Matches
spomsprotein.cpp
Go to the documentation of this file.
/*
* Copyright (c) 2025 Aurélien Berthier
* <aurelien.berthier@ls2n.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/>.
*/
#include "spomsprotein.h"
namespace pappso
{
namespace specpeptidoms
{
SpOMSProtein::SpOMSProtein(const QString &description,
const QString &sequence,
const AaCode &aa_code)
: m_description(description), m_sequence(sequence)
{
clear();
SpOMSAa aa;
for(const QChar &aa_str : m_sequence)
{
aa.aa = (pappso::Enums::AminoAcidChar)aa_str.toLatin1();
aa.code = aa_code.getAaCode(aa.aa);
aa.mass = aa_code.getMass(aa.code);
push_back(aa);
}
// by default the sequence is reversed
std::reverse(begin(), end());
}
SpOMSProtein::~SpOMSProtein()
{
}
const QString
SpOMSProtein::getAccession() const
{
return m_description.split(" ").at(0);
}
const QString &
SpOMSProtein::getSequence() const
{
return m_sequence;
}
const QString &
SpOMSProtein::getCompleteDescription() const
{
return m_description;
}
std::vector<SpOMSAa>
SpOMSProtein::sliced(std::size_t position, std::size_t length) const
{
std::vector<SpOMSAa> aa_vec;
for(std::size_t i = 0; i < length; i++)
{
aa_vec.push_back(at(i + position));
}
return aa_vec;
}
} // namespace specpeptidoms
} // namespace pappso
pappso::AaCode
collection of integer code for each amino acid 0 => null 1 to 20 => amino acid sorted by there mass (...
Definition aacode.h:44
pappso::AaCode::getAaCode
uint8_t getAaCode(char aa_letter) const
get the integer code of an amino acid with the one letter code
Definition aacode.cpp:81
pappso::AaCode::getMass
double getMass(uint8_t aa_code) const
get the mass of the amino acid given its integer code the amino acid can bear some modification (if a...
Definition aacode.cpp:224
pappso::specpeptidoms::SpOMSProtein::getSequence
const QString & getSequence() const
Definition spomsprotein.cpp:58
pappso::specpeptidoms::SpOMSProtein::SpOMSProtein
SpOMSProtein(const QString &description, const QString &sequence, const AaCode &aa_code)
Definition spomsprotein.cpp:26
pappso::specpeptidoms::SpOMSProtein::getCompleteDescription
const QString & getCompleteDescription() const
Definition spomsprotein.cpp:65
pappso::specpeptidoms::SpOMSProtein::getAccession
const QString getAccession() const
Definition spomsprotein.cpp:52
pappso::specpeptidoms::SpOMSProtein::~SpOMSProtein
virtual ~SpOMSProtein()
Definition spomsprotein.cpp:47
pappso::specpeptidoms::SpOMSProtein::m_description
QString m_description
Definition spomsprotein.h:52
pappso::specpeptidoms::SpOMSProtein::sliced
std::vector< SpOMSAa > sliced(std::size_t position, std::size_t length) const
Definition spomsprotein.cpp:71
pappso::specpeptidoms::SpOMSProtein::m_sequence
QString m_sequence
Definition spomsprotein.h:53
pappso::Enums::AminoAcidChar
AminoAcidChar
Definition types.h:196
pappso::specpeptidoms
Definition correctiontree.h:40
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
spomsprotein.h
pappso::specpeptidoms::SpOMSAa
Definition spomsprotein.h:31