libpappsomspp
Library for mass spectrometry
|
#include <utils.h>
Static Public Member Functions | |
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) |
0.11 would return 0 (no empty decimal) 2.001 would return 2 1000.0001254 would return 3 | |
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 | 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) |
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) |
static AaModificationP | translateAaModificationFromUnimod (const QString &unimod_accession) |
Static Public Attributes | |
static QRegularExpression | unsignedDoubleNumberNoExponentialRegExp |
static QRegularExpression | anythingButDigitDotDash = QRegularExpression("[^\\d^\\.^-]+") |
static QRegularExpression | signedDoubleNumberExponentialRegExp |
static QRegularExpression | xyMassDataFormatRegExp |
static QRegularExpression | mzListDataFormatRegExp |
Regular expression matching <m/z value><non-numerical*> | |
static QRegularExpression | sizetListDataFormatRegExp |
Regular expression matching <size_t><non-numerical*> | |
static QRegularExpression | endOfLineRegExp = QRegularExpression("^\\s+$") |
Regular expression that tracks the end of line in text files. | |
|
static |
Tell if both double values, are equal within the double representation capabilities of the platform.
Definition at line 299 of file utils.cpp.
Referenced by pappso::Trace::removeZeroYDataPoints().
|
static |
|
static |
|
static |
Definition at line 367 of file utils.cpp.
|
static |
|
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 258 of file utils.cpp.
Referenced by pappso::masschroq::PrecursorParser::setQualifiedMassSpectrum().
|
static |
Definition at line 501 of file utils.cpp.
References pappso::Enums::pwiz, pappso::Enums::tims, pappso::Enums::tims_frames, and pappso::Enums::xy.
Referenced by pappso::MsFileAccessor::getMsRunIds().
|
static |
Definition at line 72 of file utils.cpp.
Referenced by pappso::GrpGroup::getGroupingId(), pappso::GrpPeptide::getGroupingId(), pappso::GrpProtein::getGroupingId(), pappso::GrpSubGroup::getGroupingId(), pappso::BafAsciiFileReader::getMsRunIds(), pappso::PwizMsFileReader::getMsRunIds(), and pappso::XyMsFileReader::getMsRunIds().
|
static |
Definition at line 623 of file utils.cpp.
References PAPPSOMSPP_VERSION.
Referenced by pappso::cbor::psm::SageFileReader::SageFileReader(), pappso::cbor::psm::PsmFileScanProcessAndCopy::informationsReady(), and pappso::cbor::CborStreamWriter::writeInformations().
|
static |
Definition at line 631 of file utils.cpp.
References pappso::MzRange::contains(), pappso::PrecisionFactory::getDaltonInstance(), pappso::AaModification::getInstance(), pappso::AaModification::getInstanceCustomizedMod(), pappso::AaModification::getMass(), and pappso::Enums::methionine.
Referenced by pappso::cbor::psm::SageReader::getStaticModificationList(), pappso::cbor::psm::SageReader::getVariableModificationList(), and pappso::PeptideProFormaParser::parseStringToPeptide().
|
static |
Convenience function to return a string describing the MzFormat of a file.
Definition at line 458 of file utils.cpp.
References pappso::Enums::abSciexT2D, pappso::Enums::abSciexWiff, pappso::Enums::agilentMassHunter, pappso::Enums::brukerBaf, pappso::Enums::brukerBafAscii, pappso::Enums::brukerFid, pappso::Enums::brukerTims, pappso::Enums::brukerYep, pappso::Enums::MGF, pappso::Enums::msn, pappso::Enums::mz5, pappso::Enums::mzML, pappso::Enums::mzXML, pappso::Enums::SQLite3, pappso::Enums::thermoRaw, pappso::Enums::watersRaw, and pappso::Enums::xy.
|
static |
|
static |
Definition at line 290 of file utils.cpp.
Referenced by pappso::MsRunDataSetTreeNode::toString(), and pappso::QualifiedMassSpectrum::toString().
|
static |
Definition at line 150 of file utils.cpp.
|
static |
Definition at line 140 of file utils.cpp.
Referenced by pappso::MassSpectrumMinusCombiner::combine(), pappso::MassSpectrumPlusCombiner::combine(), pappso::TraceMinusCombiner::combine(), and pappso::TracePlusCombiner::combine().
|
static |
Definition at line 388 of file utils.cpp.
|
static |
Definition at line 419 of file utils.cpp.
|
static |
Convenience function to return a string describing the ion type.
Definition at line 537 of file utils.cpp.
References pappso::Enums::a, pappso::Enums::ao, pappso::Enums::astar, pappso::Enums::b, pappso::Enums::bo, pappso::Enums::bp, pappso::Enums::bstar, pappso::Enums::c, pappso::Enums::x, pappso::Enums::y, pappso::Enums::yo, pappso::Enums::yp, pappso::Enums::ystar, and pappso::Enums::z.
|
static |
Convenience function to return a string naming the precision.
Definition at line 611 of file utils.cpp.
References pappso::precisionUnitMap.
|
static |
Convenience function to return a string describing the specglob experimental spectrum data point.
Definition at line 592 of file utils.cpp.
References pappso::specglob::both, pappso::specglob::native, and pappso::specglob::symmetric.
|
static |
Convenience function to return a string describing the specglob alingment type.
Definition at line 517 of file utils.cpp.
References pappso::specglob::align, pappso::specglob::nonAlign, and pappso::specglob::reAlign.
Referenced by pappso::cbor::psm::PsmFeatures::parameterMapReady(), pappso::specglob::PeptideModel::toProForma(), and pappso::specglob::PeptideModel::toString().
|
static |
Definition at line 162 of file utils.cpp.
References pappso::c.
Referenced by pappso::PwizMsFileReader::initialize(), and pappso::PwizMsRunReader::initialize().
|
static |
Definition at line 707 of file utils.cpp.
References pappso::AaModification::getInstance().
|
static |
|
static |
|
static |
0.11 would return 0 (no empty decimal) 2.001 would return 2 1000.0001254 would return 3
Determine the number of zero decimals between the decimal point and the first non-zero decimal.
value | the value to be analyzed |
Definition at line 102 of file utils.cpp.
Referenced by pappso::MzIntegrationParams::createArbitraryBins(), pappso::BasePlotWidget::drawXScopeSpanFeatures(), and pappso::BasePlotWidget::drawYScopeSpanFeatures().
|
static |
|
static |
Regular expression that tracks the end of line in text files.
Definition at line 69 of file utils.h.
Referenced by pappso::XyMsRunReader::accept(), pappso::BafAsciiFileReader::initialize(), pappso::XyMsFileReader::initialize(), and pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile().
|
static |
|
static |
|
static |
|
static |
Definition at line 54 of file utils.h.
Referenced by pappso::BafAsciiMsRunReader::craftLineParserRegExpPattern(), and pappso::BafAsciiFileReader::initialize().
|
static |
Regular expression matching <numerical value><non-numerical*><numerical value>
Definition at line 60 of file utils.h.
Referenced by pappso::XyMsRunReader::accept(), pappso::DataPoint::initialize(), pappso::XyMsFileReader::initialize(), and pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile().