|
| static QString | getVersion () |
| static const QString | getLexicalOrderedString (unsigned int num) |
| static void | writeLexicalOrderedString (QTextStream *p_out, unsigned int num) |
| static int | zeroDecimalsInValue (pappso_double value) |
| | Determine the number of zero decimals between the decimal point and the first non-zero decimal.
|
| static pappso_double | roundToDecimals (pappso_double value, int decimal_places) |
| static long long int | roundToDecimal32bitsAsLongLongInt (pappso_double input) |
| static std::string | toUtf8StandardString (const QString &text) |
| static bool | writeToFile (const QString &text, const QString &file_name) |
| static bool | writeToFile (const std::vector< double > &data, int decimals, const QString &file_name) |
| static bool | appendToFile (const QString &text, const QString &file_name) |
| static std::size_t | extractScanNumberFromMzmlNativeId (const QString &spectrum_native_id) |
| static QString | pointerToString (const void *const pointer) |
| static bool | almostEqual (double value1, double value2, int decimalPlaces=10) |
| | Tell if both double values, are equal within the double representation capabilities of the platform.
|
| static double | roundValueToDecimalPlaces (double value, int decimal_places, bool round_up=true) |
| static double | nearestGreater (double value) |
| static QString | chronoTimePointDebugString (const QString &msg, std::chrono::system_clock::time_point chrono_time=std::chrono::system_clock::now()) |
| static QString | chronoIntervalDebugString (const QString &msg, std::chrono::system_clock::time_point chrono_start, std::chrono::system_clock::time_point chrono_finish=std::chrono::system_clock::now()) |
| static std::vector< double > | splitMzStringToDoubleVectorWithSpaces (const QString &text, std::size_t &error_count) |
| static std::vector< std::size_t > | splitSizetStringToSizetVectorWithSpaces (const QString &text, std::size_t &error_count) |
| static QString | booleanToString (bool value) |
| | convenient function to transform a boolean to QString "TRUE" or "FALSE" QString returned is readable by R
|
| static QString | msDataFormatAsString (Enums::MsDataFormat mz_format) |
| | Convenience function to return a string describing the MzFormat of a file.
|
| static QString | fileReaderTypeAsString (Enums::FileReaderType file_reader_type) |
| static QString | toString (specglob::SpectralAlignmentType type) |
| | Convenience function to return a string describing the specglob alingment type.
|
| static QString | toString (specglob::ExperimentalSpectrumDataPointType type) |
| | Convenience function to return a string describing the specglob experimental spectrum data point.
|
| static QString | toString (Enums::PrecisionUnit precision_unit) |
| | Convenience function to return a string naming the precision.
|
| static QString | toString (Enums::PeptideIon m_ionType) |
| | Convenience function to return a string describing the ion type.
|
| static AaModificationP | guessAaModificationPbyMonoisotopicMassDelta (Enums::AminoAcidChar aa, pappso_double mass, QChar position=' ') |
| | get the most suitable modification given an amino acid, a mass and a position
|
| static bool | isAminoAcidChar (Enums::AminoAcidChar x) |
| static AaModificationP | translateAaModificationFromUnimod (const QString &unimod_accession) |
| static QJsonArray | toJson (const std::vector< double > &myVec) |
| | convert vector of double into json array
|
Definition at line 50 of file utils.h.
| std::size_t pappso::Utils::extractScanNumberFromMzmlNativeId |
( |
const QString & | spectrum_native_id | ) |
|
|
static |
TODO activate this in a future release to ensure scan number for(auto i = 0; i < native_id_list.size(); i += 2) { if(native_id_list[i] == "scan") { return native_id_list[i + 1].toULong(); } }
throw ExceptionNotFound( QObject::tr("scan number not found in mzML native id %1") .arg(spectrum_native_id));
Definition at line 286 of file utils.cpp.
287{
288 qDebug() << " " << spectrum_native_id;
289 QStringList native_id_list = spectrum_native_id.split("=");
290 if(native_id_list.size() < 2)
291 {
292 throw ExceptionNotFound(
293 QObject::tr("scan number not found in mzML native id %1").arg(spectrum_native_id));
294 }
295 else
296 {
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311 return native_id_list.back().toULong();
312 }
313 return 0;
314}
Referenced by pappso::masschroq::PrecursorParser::setQualifiedMassSpectrum().
get the most suitable modification given an amino acid, a mass and a position
@aa amino acid @mass float m/z @position protein or peptide position in ['^','$', '[', ']'], default is a space
Definition at line 678 of file utils.cpp.
681{
683 {
684 throw pappso::PappsoException(
685 QObject::tr("Utils::guessAaModificationPbyMonoisotopicMassDelta => "
686 "not an amino acid %1")
687 .arg((char)aa));
688 }
690
694 pappso::MzRange(oxidation->
getMass(), precision).contains(mass))
695 {
696 return oxidation;
697 }
700 if(pappso::MzRange(iodoacetamide->
getMass(), precision).contains(mass))
701 {
702 return iodoacetamide;
703 }
706 if(pappso::MzRange(acetylated->
getMass(), precision).contains(mass))
707 {
708 return acetylated;
709 }
712 if(pappso::MzRange(phosphorylated->
getMass(), precision).contains(mass))
713 {
714 return phosphorylated;
715 }
717 if(pappso::MzRange(ammonia->
getMass(), precision).contains(mass))
718 {
719 return ammonia;
720 }
725 if(pappso::MzRange(dehydrated->
getMass(), precision).contains(mass))
726 {
728 {
729 return glu_pyroglu;
730 }
731 else
732 {
733 return dehydrated;
734 }
735 }
738 if(pappso::MzRange(dimethylated->
getMass(), precision).contains(mass))
739 {
740 return dimethylated;
741 }
742
744 if(pappso::MzRange(dimethylated_medium->
getMass(), precision).contains(mass))
745 {
746 return dimethylated_medium;
747 }
748
750 if(pappso::MzRange(dimethylated_heavy->
getMass(), precision).contains(mass))
751 {
752 return dimethylated_heavy;
753 }
755 if(pappso::MzRange(DimethylpyrroleAdduct->
getMass(), precision).contains(mass))
756 {
757 return DimethylpyrroleAdduct;
758 }
759
760
762
763 throw pappso::ExceptionNotFound(
764 QObject::tr("Utils::guessAaModificationPbyMonoisotopicMassDelta => "
765 "modification not found for mass %1")
766 .arg(mass));
767}
pappso_double getMass() const
static AaModificationP getInstance(const QString &accession)
static AaModificationP getInstanceCustomizedMod(pappso_double modificationMass)
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
static bool isAminoAcidChar(Enums::AminoAcidChar x)
const AaModification * AaModificationP
const PrecisionBase * PrecisionPtr
References pappso::MzRange::contains(), pappso::PrecisionFactory::getDaltonInstance(), pappso::AaModification::getInstance(), pappso::AaModification::getInstanceCustomizedMod(), pappso::AaModification::getMass(), pappso::Enums::glutamic_acid, isAminoAcidChar(), and pappso::Enums::methionine.
Referenced by pappso::cbor::psm::SageReader::getStaticModificationList(), pappso::cbor::psm::SageReader::getVariableModificationList(), pappso::PeptideProFormaParser::parseStringToPeptide(), and pappso::cbor::psm::MzIdentMlReader::readPeptide().