Loading...
Searching...
No Matches
utils.cpp
Go to the documentation of this file.
/**
* \file mcql/utils.cpp
* \date 03/01/2025
* \author Olivier Langella
* \brief MassChroQ Lite utilities
*/
/*******************************************************************************
* 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 "utils.h"
#include <QObject>
#include "pappsomspp/core/pappsoexception.h"
#include "pappsomspp/config.h"
QString
pappso::masschroq::Utils::getVersion()
{
QString version(MASSCHROQ_VERSION);
return version;
}
QString
pappso::masschroq::Utils::enumToString(PeakQualityCategory peak_category)
{
switch(peak_category)
{
case PeakQualityCategory::a:
return "a";
break;
case PeakQualityCategory::aa:
return "aa";
break;
case PeakQualityCategory::ab:
return "ab";
break;
case PeakQualityCategory::za:
return "za";
break;
case PeakQualityCategory::zaa:
return "zaa";
break;
case PeakQualityCategory::zab:
return "zab";
break;
case PeakQualityCategory::b:
return "b";
break;
case PeakQualityCategory::c:
return "c";
break;
case PeakQualityCategory::d:
return "d";
break;
case PeakQualityCategory::missed:
return "missed";
break;
case PeakQualityCategory::nomatch:
return "nomatch";
break;
case PeakQualityCategory::post_matching:
return "pm";
break;
case PeakQualityCategory::last:
throw pappso::PappsoException(QObject::tr("no QString for PeakQualityCategory::last"));
break;
}
return "";
}
QString
pappso::masschroq::Utils::enumToString(Enums::XicExtractMethod extract_method)
{
switch(extract_method)
{
case Enums::XicExtractMethod::sum:
return "sum";
break;
case Enums::XicExtractMethod::max:
return "max";
break;
default:
break;
}
return "";
}
QString
pappso::masschroq::Utils::enumToString(Enums::PrecisionUnit precision_unit)
{
switch(precision_unit)
{
case Enums::PrecisionUnit::ppm:
return "ppm";
break;
case Enums::PrecisionUnit::dalton:
return "dalton";
break;
default:
break;
}
return "";
}
pappso::PappsoException
Definition pappsoexception.h:41
pappso::masschroq::Utils::getVersion
static QString getVersion()
Definition utils.cpp:37
pappso::masschroq::Utils::enumToString
static QString enumToString(PeakQualityCategory peak_category)
Convenience function to return a string describing the specglob alingment type.
Definition utils.cpp:44
config.h
MASSCHROQ_VERSION
#define MASSCHROQ_VERSION
Definition config.h:7
utils.h
pappso::Enums::XicExtractMethod
XicExtractMethod
Definition types.h:278
pappso::Enums::XicExtractMethod::sum
@ sum
sum of intensities
Definition types.h:279
pappso::Enums::XicExtractMethod::max
@ max
maximum of intensities
Definition types.h:280
pappso::Enums::PrecisionUnit
PrecisionUnit
Definition types.h:96
pappso::Enums::PrecisionUnit::ppm
@ ppm
Definition types.h:99
pappso::Enums::PrecisionUnit::dalton
@ dalton
Definition types.h:98
pappso::masschroq::PeakQualityCategory
PeakQualityCategory
Definition types.h:42
pappso::masschroq::PeakQualityCategory::a
@ a
peak detected using a single direct MS2 observation
Definition types.h:46
pappso::masschroq::PeakQualityCategory::ab
@ ab
Definition types.h:47
pappso::masschroq::PeakQualityCategory::missed
@ missed
no peak found at all
Definition types.h:60
pappso::masschroq::PeakQualityCategory::aa
@ aa
best possible : more than one direct MS2 fragmentation in same MSRUN
Definition types.h:45
pappso::masschroq::PeakQualityCategory::zab
@ zab
Definition types.h:51
pappso::masschroq::PeakQualityCategory::c
@ c
Definition types.h:54
pappso::masschroq::PeakQualityCategory::nomatch
@ nomatch
Definition types.h:43
pappso::masschroq::PeakQualityCategory::d
@ d
Definition types.h:56
pappso::masschroq::PeakQualityCategory::b
@ b
Definition types.h:52
pappso::masschroq::PeakQualityCategory::za
@ za
Definition types.h:50
pappso::masschroq::PeakQualityCategory::last
@ last
Definition types.h:61
pappso::masschroq::PeakQualityCategory::zaa
@ zaa
Definition types.h:49
pappso::masschroq::PeakQualityCategory::post_matching
@ post_matching
Definition types.h:58
pappsoexception.h