Loading...
Searching...
No Matches
deepprotenum.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/psm/deepprot/deepprotenum.cpp
* \date 22/1/2021
* \author Olivier Langella <olivier.langella@universite-paris-saclay.fr>
* \brief base type definition to use in DeepProt
*
* DeepProt is the C++ implementation of the SpecOMS algorithm
*
*/
/*******************************************************************************
* Copyright (c) 2021 Olivier Langella
*<olivier.langella@universite-paris-saclay.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* 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 <QObject>
#include "deepprotenum.h"
#include "pappsomspp/core/pappsoexception.h"
pappso::DeepProtMatchType
pappso::DeepProtEnumStr::DeepProtMatchTypeFromString(const QString &name)
{
DeepProtMatchType match_type = DeepProtMatchType::uncategorized;
if(name == "delta_position")
{
match_type = DeepProtMatchType::DeltaPosition;
}
else if(name == "no_delta_position")
{
match_type = DeepProtMatchType::NoDeltaPosition;
}
else if(name == "uncategorized")
{
match_type = DeepProtMatchType::uncategorized;
}
else if(name == "zero_mass_delta")
{
match_type = DeepProtMatchType::ZeroMassDelta;
}
else if(name == "zero_mass_delta_mc")
{
match_type = DeepProtMatchType::ZeroMassDeltaMissedCleavage;
}
else if(name == "zero_mass_delta_st")
{
match_type = DeepProtMatchType::ZeroMassDeltaSemiTryptic;
}
else
{
throw pappso::PappsoException(QObject::tr("DeepProtMatchType unknown :\n%1").arg(name));
}
return match_type;
}
pappso::DeepProtPeptideCandidateStatus
pappso::DeepProtEnumStr::DeepProtPeptideCandidateStatusFromString(const QString &name)
{
DeepProtPeptideCandidateStatus status = DeepProtPeptideCandidateStatus::unmodified;
if(name == "cter_removal")
{
status = DeepProtPeptideCandidateStatus::CterRemoval;
}
else if(name == "delta_position")
{
status = DeepProtPeptideCandidateStatus::DeltaPosition;
}
else if(name == "missed_cleavage")
{
status = DeepProtPeptideCandidateStatus::MissedCleavage;
}
else if(name == "no_delta_position")
{
status = DeepProtPeptideCandidateStatus::NoDeltaPosition;
}
else if(name == "nter_removal")
{
status = DeepProtPeptideCandidateStatus::NterRemoval;
}
else if(name == "zero_mass_delta")
{
status = DeepProtPeptideCandidateStatus::ZeroMassDelta;
}
else
{
throw pappso::PappsoException(
QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1").arg(name));
}
return status;
}
const QString
pappso::DeepProtEnumStr::toString(pappso::DeepProtMatchType match_type)
{
QString match_type_str;
switch(match_type)
{
case DeepProtMatchType::DeltaPosition:
match_type_str = "delta_position";
break;
case DeepProtMatchType::NoDeltaPosition:
match_type_str = "no_delta_position";
break;
case DeepProtMatchType::uncategorized:
match_type_str = "uncategorized";
break;
case DeepProtMatchType::ZeroMassDelta:
match_type_str = "zero_mass_delta";
break;
case DeepProtMatchType::ZeroMassDeltaMissedCleavage:
match_type_str = "zero_mass_delta_mc";
break;
case DeepProtMatchType::ZeroMassDeltaSemiTryptic:
match_type_str = "zero_mass_delta_st";
break;
default:
throw pappso::PappsoException(
QObject::tr("DeepProtMatchType unknown :\n%1").arg((std::uint8_t)match_type));
}
return match_type_str;
}
const QString
pappso::DeepProtEnumStr::toString(pappso::DeepProtPeptideCandidateStatus status)
{
QString status_str;
switch(status)
{
case DeepProtPeptideCandidateStatus::CterRemoval:
status_str = "cter_removal";
break;
case DeepProtPeptideCandidateStatus::DeltaPosition:
status_str = "delta_position";
break;
case DeepProtPeptideCandidateStatus::MissedCleavage:
status_str = "missed_cleavage";
break;
case DeepProtPeptideCandidateStatus::NoDeltaPosition:
status_str = "no_delta_position";
break;
case DeepProtPeptideCandidateStatus::NterRemoval:
status_str = "nter_removal";
break;
case DeepProtPeptideCandidateStatus::ZeroMassDelta:
status_str = "zero_mass_delta";
break;
default:
throw pappso::PappsoException(
QObject::tr("DeepProtPeptideCandidateStatus unknown :\n%1").arg((std::uint8_t)status));
}
return status_str;
}
pappso::DeepProtEnumStr::toString
static const QString toString(DeepProtMatchType match_type)
Definition deepprotenum.cpp:112
pappso::DeepProtEnumStr::DeepProtMatchTypeFromString
static DeepProtMatchType DeepProtMatchTypeFromString(const QString &name)
Definition deepprotenum.cpp:38
pappso::DeepProtEnumStr::DeepProtPeptideCandidateStatusFromString
static DeepProtPeptideCandidateStatus DeepProtPeptideCandidateStatusFromString(const QString &name)
Definition deepprotenum.cpp:74
pappso::PappsoException
Definition pappsoexception.h:41
deepprotenum.h
pappso::DeepProtMatchType
DeepProtMatchType
definition of different class of PSMs used by DeepProt
Definition deepprotenum.h:42
pappso::DeepProtMatchType::ZeroMassDeltaMissedCleavage
@ ZeroMassDeltaMissedCleavage
peptide candidate with missed cleavage is in precursor mz range
Definition deepprotenum.h:45
pappso::DeepProtMatchType::uncategorized
@ uncategorized
precursor mass was not compared
Definition deepprotenum.h:43
pappso::DeepProtMatchType::NoDeltaPosition
@ NoDeltaPosition
Definition deepprotenum.h:51
pappso::DeepProtMatchType::DeltaPosition
@ DeltaPosition
Definition deepprotenum.h:49
pappso::DeepProtMatchType::ZeroMassDelta
@ ZeroMassDelta
peptide candidate is in precursor mz range
Definition deepprotenum.h:44
pappso::DeepProtMatchType::ZeroMassDeltaSemiTryptic
@ ZeroMassDeltaSemiTryptic
semi tryptic peptide candidate is in precursor mz range
Definition deepprotenum.h:47
pappso::DeepProtPeptideCandidateStatus
DeepProtPeptideCandidateStatus
definition of different status for potential peptide candidates on the same spectrum
Definition deepprotenum.h:61
pappso::DeepProtPeptideCandidateStatus::CterRemoval
@ CterRemoval
Definition deepprotenum.h:64
pappso::DeepProtPeptideCandidateStatus::unmodified
@ unmodified
precursor mass was not compared
Definition deepprotenum.h:62
pappso::DeepProtPeptideCandidateStatus::NoDeltaPosition
@ NoDeltaPosition
Definition deepprotenum.h:68
pappso::DeepProtPeptideCandidateStatus::MissedCleavage
@ MissedCleavage
Definition deepprotenum.h:66
pappso::DeepProtPeptideCandidateStatus::DeltaPosition
@ DeltaPosition
Definition deepprotenum.h:67
pappso::DeepProtPeptideCandidateStatus::ZeroMassDelta
@ ZeroMassDelta
Definition deepprotenum.h:63
pappso::DeepProtPeptideCandidateStatus::NterRemoval
@ NterRemoval
Definition deepprotenum.h:65
pappsoexception.h