Loading...
Searching...
No Matches
scorevalues.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/processing/specglob/scorevalues.h
* \date 06/11/2023
* \author Olivier Langella
* \brief scores to apply in comparisons
*
* 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/>.
*
*/
#include "scorevalues.h"
#include <algorithm>
namespace pappso
{
namespace specglob
{
ScoreValues::ScoreValues()
{
// #Scores to apply
// #Score for non alignment (int)
// sg.scoreNonAlign=-4
m_scoreTable[(std::uint8_t)ScoreValueType::scoreNonAlign] = -4;
// #Score for re-alignment (int)
// sg.scoreReAlignNative=-8
m_scoreTable[(std::uint8_t)ScoreValueType::scoreReAlignNative] = -8;
// sg.scoreReAlignSym=-8
m_scoreTable[(std::uint8_t)ScoreValueType::scoreReAlignSym] = -8;
// sg.scoreReAlignBoth=-6
m_scoreTable[(std::uint8_t)ScoreValueType::scoreReAlignBoth] = -6;
// #Score for good alignment(int)
m_scoreTable[(std::uint8_t)ScoreValueType::scoreAlignNative] = 7;
m_scoreTable[(std::uint8_t)ScoreValueType::scoreAlignSym] = 7;
m_scoreTable[(std::uint8_t)ScoreValueType::scoreAlignBoth] = 10;
// #Score for re - alignment without offset(int)
m_scoreTable[(std::uint8_t)ScoreValueType::scoreReAlignNativeNO] = 4;
m_scoreTable[(std::uint8_t)ScoreValueType::scoreReAlignSymNO] = 4;
m_scoreTable[(std::uint8_t)ScoreValueType::scoreReAlignBothNO] = 7;
}
ScoreValues::ScoreValues(const ScoreValues &other)
{
std::copy(other.m_scoreTable, other.m_scoreTable + 10, m_scoreTable);
}
ScoreValues::~ScoreValues()
{
}
int
ScoreValues::get(ScoreValueType type)
{
return m_scoreTable[(std::uint8_t)type];
}
void
ScoreValues::set(ScoreValueType type, int value)
{
m_scoreTable[(std::uint8_t)type] = value;
}
const ScoreValues &
ScoreValues::operator=(const ScoreValues &other)
{
std::copy(other.m_scoreTable, other.m_scoreTable + 10, m_scoreTable);
return *this;
}
} // namespace specglob
} // namespace pappso
pappso::specglob::ScoreValues
Definition scorevalues.h:54
pappso::specglob::ScoreValues::set
void set(ScoreValueType type, int value)
Definition scorevalues.cpp:90
pappso::specglob::ScoreValues::get
int get(ScoreValueType type)
Definition scorevalues.cpp:84
pappso::specglob::ScoreValues::~ScoreValues
virtual ~ScoreValues()
Definition scorevalues.cpp:79
pappso::specglob::ScoreValues::operator=
const ScoreValues & operator=(const ScoreValues &other)
Definition scorevalues.cpp:96
pappso::specglob::ScoreValues::m_scoreTable
int m_scoreTable[10]
Definition scorevalues.h:76
pappso::specglob::ScoreValues::ScoreValues
ScoreValues()
Definition scorevalues.cpp:46
pappso::specglob::ScoreValueType
ScoreValueType
Definition types.h:57
pappso::specglob::ScoreValueType::scoreAlignNative
@ scoreAlignNative
Score for good alignment native (int)
pappso::specglob::ScoreValueType::scoreReAlignSymNO
@ scoreReAlignSymNO
Score for re-alignment without offset symmetric (int)
pappso::specglob::ScoreValueType::scoreNonAlign
@ scoreNonAlign
Score for non alignment (int)
pappso::specglob::ScoreValueType::scoreAlignBoth
@ scoreAlignBoth
Score for good alignment both (int)
pappso::specglob::ScoreValueType::scoreReAlignBoth
@ scoreReAlignBoth
Score for re-alignment both (int)
pappso::specglob::ScoreValueType::scoreReAlignBothNO
@ scoreReAlignBothNO
Score for re-alignment without offset both (int)
pappso::specglob::ScoreValueType::scoreReAlignSym
@ scoreReAlignSym
Score for re-alignment symmetric (int)
pappso::specglob::ScoreValueType::scoreReAlignNative
@ scoreReAlignNative
pappso::specglob::ScoreValueType::scoreAlignSym
@ scoreAlignSym
Score for good alignment symmetric (int)
pappso::specglob::ScoreValueType::scoreReAlignNativeNO
@ scoreReAlignNativeNO
Score for re-alignment without offset native (int)
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
scorevalues.h
scores to apply in comparisons