Loading...
Searching...
No Matches
psmfilereaderbase.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/processing/cbor/psm/psmfilereaderbase.h
* \date 05/07/2025
* \author Olivier Langella
* \brief Base class to read CBOR PSM file
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of PAPPSOms-tools.
*
* PAPPSOms-tools 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-tools 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-tools. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include "psmfilereaderbase.h"
#include "pappsomspp/core/pappsoexception.h"
#include <QDebug>
#include "../../../peptide/peptideproformaparser.h"
#include <QCborArray>
#include <qlogging.h>
#include <qobject.h>
namespace pappso
{
namespace cbor
{
namespace psm
{
PsmFileReaderBase::PsmFileReaderBase() : CborStreamReaderInterface()
{
}
PsmFileReaderBase::~PsmFileReaderBase()
{
// qWarning() << "~PsmFileReaderBase";
}
void
PsmFileReaderBase::readCbor(QIODevice *cborp, pappso::UiMonitorInterface &monitor)
{
qDebug();
initCborReader(cborp);
qDebug();
if(mpa_cborReader->isMap())
{
readRoot(monitor);
}
qDebug();
}
void
PsmFileReaderBase::readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor)
{
qDebug();
initCborReader(cborp);
qDebug();
if(mpa_cborReader->isMap())
{
readRoot(monitor);
}
qDebug();
}
bool
PsmFileReaderBase::currentProteinRefListContainsDecoy() const
{
for(auto &it : m_currentPsmProteinRefList)
{
if(!m_proteinMap.getByAccession(it.accession).isTarget)
return true;
}
return false;
}
bool
PsmFileReaderBase::currentProteinRefListContainsTarget() const
{
for(auto &it : m_currentPsmProteinRefList)
{
if(m_proteinMap.getByAccession(it.accession).isTarget)
return true;
}
return false;
}
void
PsmFileReaderBase::readRoot(pappso::UiMonitorInterface &monitor)
{
qDebug();
mpa_cborReader->enterContainer();
getExpectedString();
if(m_expectedString == "informations")
{
qDebug() << m_expectedString;
readInformations(monitor);
getExpectedString();
qDebug() << m_expectedString;
if(m_expectedString == "log")
{
qDebug() << m_expectedString;
readLog(monitor);
getExpectedString();
}
logReady(monitor);
}
else
{
throw pappso::PappsoException("ERROR: expecting informations element");
}
qDebug() << m_expectedString;
if(m_expectedString == "parameter_map")
{
qDebug();
readParameterMap(monitor);
}
else
{
throw pappso::PappsoException("ERROR: expecting parameter_map element");
}
getExpectedString();
m_targetFastaFiles.clear();
m_decoyFastaFiles.clear();
if(m_expectedString == "target_fasta_files")
{
mpa_cborReader->readArray(m_targetFastaFiles);
getExpectedString();
}
if(m_expectedString == "decoy_fasta_files")
{
mpa_cborReader->readArray(m_decoyFastaFiles);
getExpectedString();
}
fastaFilesReady(monitor);
if(m_expectedString == "protein_map")
{
readProteinMap(monitor);
getExpectedString();
}
if(m_expectedString == "sample_list")
{
sampleListStarted(monitor);
mpa_cborReader->enterContainer(); // array
while(!mpa_cborReader->lastError() && mpa_cborReader->hasNext())
{
readSample(monitor);
}
mpa_cborReader->leaveContainer(); // array
sampleListFinished(monitor);
}
else
{
throw pappso::PappsoException(
QObject::tr("ERROR: expecting sample_list element not %1").arg(m_expectedString));
}
mpa_cborReader->leaveContainer(); // whole file
if(!mpa_cborReader->lastError() && mpa_cborReader->hasNext())
{
readRoot(monitor);
}
}
void
PsmFileReaderBase::readInformations(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
bool is_ok;
// m_cborInformations.clear();
is_ok = mpa_cborReader->readCborMap(m_cborInformations);
if(!is_ok)
{
throw pappso::PappsoException("ERROR: PSM cbor header informations not well formed");
}
qDebug() << m_cborInformations.keys();
if(m_cborInformations.value("type").toString() != "psm")
{
QStringList all_keys;
for(auto it_k : m_cborInformations.keys())
{
all_keys << it_k.toString();
}
throw pappso::PappsoException(
QObject::tr("ERROR: this file does not contain PSM data but %1 and %2")
.arg(m_cborInformations.value("type").toString())
.arg(all_keys.join(" ")));
}
informationsReady(monitor);
}
void
PsmFileReaderBase::readLog(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
bool is_ok;
// m_cborInformations.clear();
is_ok = mpa_cborReader->readCborArray(m_cborLog);
if(!is_ok)
{
throw pappso::PappsoException("ERROR: PSM cbor header log not well formed");
}
}
void
PsmFileReaderBase::readParameterMap(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
bool is_ok;
m_cborParameterMap.clear();
is_ok = mpa_cborReader->readCborMap(m_cborParameterMap);
if(!is_ok)
{
throw pappso::PappsoException("ERROR: PSM cbor parameter_map not well formed");
}
parameterMapReady(monitor);
}
void
PsmFileReaderBase::readProteinMap(pappso::UiMonitorInterface &monitor)
{
m_proteinMap.readMap(*mpa_cborReader);
proteinMapReady(monitor);
}
PsmFileReaderBase::PsmProteinRef
PsmFileReaderBase::readPsmProteinRef(bool &is_ok)
{
PsmProteinRef protein_ref;
protein_ref.accession = "";
protein_ref.positions.clear();
mpa_cborReader->enterContainer();
getExpectedString();
qDebug() << m_expectedString;
if(m_expectedString == "accession")
{
is_ok = mpa_cborReader->decodeString(protein_ref.accession);
if(!is_ok)
{
throw pappso::PappsoException("ERROR: protein accession is not a string");
}
}
else
{
throw pappso::PappsoException("ERROR: expecting accession element in PSM protein_list");
}
getExpectedString();
qDebug() << m_expectedString;
if(m_expectedString == "positions")
{
mpa_cborReader->readArray(protein_ref.positions);
// mpa_cborReader->next();
}
else
{
throw pappso::PappsoException(
QString("ERROR: expecting positions element in PSM protein_list not %1")
.arg(m_expectedString));
}
mpa_cborReader->leaveContainer();
qDebug() << "end";
return protein_ref;
}
PsmFile
PsmFileReaderBase::readPsmFile(bool &is_ok)
{
is_ok = false;
PsmFile file;
mpa_cborReader->enterContainer();
getExpectedString();
if(m_expectedString == "name")
{
if(!mpa_cborReader->decodeString(file.name))
{
throw pappso::PappsoException("file name is not a string");
}
is_ok = true;
}
else
{
throw pappso::PappsoException("ERROR: expecting name element in file");
}
mpa_cborReader->leaveContainer();
return file;
}
void
PsmFileReaderBase::writePsmFile(pappso::cbor::CborStreamWriter &writer, const PsmFile &psm_file)
{
writer.startMap();
writer.append("name");
writer.append(psm_file.name);
writer.endMap();
}
void
PsmFileReaderBase::writePsmFileList(pappso::cbor::CborStreamWriter &writer,
const std::vector<PsmFile> &file_list)
{
writer.startArray();
for(auto &psm_file : file_list)
{
writePsmFile(writer, psm_file);
}
writer.endArray();
}
void
PsmFileReaderBase::readSample(pappso::UiMonitorInterface &monitor)
{
//"name": "tandem2017_nopatch_20120906_balliau_extract_1_A01_urnb-1",
qDebug();
mpa_cborReader->enterContainer();
getExpectedString();
qDebug() << m_expectedString;
if(m_expectedString == "name")
{
if(!mpa_cborReader->decodeString(m_currentSampleName))
{
throw pappso::PappsoException("sample name is not a string");
}
}
else
{
throw pappso::PappsoException("ERROR reading sample : expecting name element in sample");
}
//"identification_file_list": [{ "name":
//"/home/langella/data1/tandem/tandem2017_nopatch_20120906_balliau_extract_1_A01_urnb-1.xml",
//}],
getExpectedString();
qDebug() << m_expectedString;
m_currentIdentificationFileList.clear();
if(m_expectedString == "identification_file_list")
{
bool is_ok;
mpa_cborReader->enterContainer();
while(!mpa_cborReader->lastError() && mpa_cborReader->hasNext())
{
try
{
m_currentIdentificationFileList.push_back(readPsmFile(is_ok));
}
catch(const pappso::PappsoException &error)
{
throw pappso::PappsoException(
QObject::tr("ERROR reading sample/identification_file_list : %1")
.arg(error.qwhat()));
}
}
mpa_cborReader->leaveContainer();
getExpectedString();
}
//"peaklist_file": {"name": "tandem2017_nopatch_20120906_balliau_extract_1_A01_urnb-1.mzml"
//},
if(m_expectedString == "peaklist_file")
{
bool is_ok;
try
{
m_currentPeaklistFile = readPsmFile(is_ok);
}
catch(const pappso::PappsoException &error)
{
throw pappso::PappsoException(
QObject::tr("ERROR reading sample/peaklist_file : %1").arg(error.qwhat()));
}
}
else
{
throw pappso::PappsoException("ERROR: expecting peaklist_file element in sample");
}
//"scan_list": [
sampleStarted(monitor);
getExpectedString();
if(m_expectedString == "scan_list")
{
if(!mpa_cborReader->isArray())
{
throw pappso::PappsoException("ERROR in scan_list: expecting an array");
}
mpa_cborReader->enterContainer(); // array
while(!mpa_cborReader->lastError() && mpa_cborReader->hasNext())
{
readScan(monitor);
}
mpa_cborReader->leaveContainer();
}
else
{
throw pappso::PappsoException("ERROR: expecting scan_list element in sample");
}
mpa_cborReader->leaveContainer();
sampleFinished(monitor);
}
void
PsmFileReaderBase::readScan(pappso::UiMonitorInterface &monitor)
{
qDebug();
m_cborScanId.clear();
if(!mpa_cborReader->isMap())
{
throw pappso::PappsoException("ERROR in scan: expecting a map");
}
mpa_cborReader->enterContainer();
//"id": {
//"index": 1976
//},
qDebug() << "scan begin";
QString last_expected_string = m_expectedString;
getExpectedString();
qDebug() << m_expectedString;
if(m_expectedString == "id")
{
if(!mpa_cborReader->readCborMap(m_cborScanId))
{
throw pappso::PappsoException(QObject::tr("id element in scan is not a cbor map"));
}
}
else
{
throw pappso::PappsoException(
QObject::tr(
"ERROR: expecting id element in scan not %1, sample %2, last expected string %3")
.arg(m_expectedString)
.arg(m_currentSampleName)
.arg(last_expected_string));
}
//"precursor": {
//"z": 2,
//"mz": 1120.529471
//},
getExpectedString();
m_cborScanPrecursor.clear();
qDebug() << m_expectedString;
if(m_expectedString == "precursor")
{
if(!mpa_cborReader->readCborMap(m_cborScanPrecursor))
{
throw pappso::PappsoException(QObject::tr("precursor element in scan is not a cbor map"));
}
}
else
{
throw pappso::PappsoException(QObject::tr("ERROR: expecting precursor element after id in "
"scan not %1, sample %2, last expected string %3")
.arg(m_expectedString)
.arg(m_currentSampleName)
.arg(last_expected_string));
}
//"ms2": {PSM CBOR format documentation
//"rt": 12648.87,
//"mz" :[1,2,3,4],
//"intensity" : [1,2,3,4]
//},
getExpectedString();
qDebug() << m_expectedString;
m_cborScanMs2.clear();
if(m_expectedString == "ms2")
{
if(!mpa_cborReader->readCborMap(m_cborScanMs2))
{
throw pappso::PappsoException(
QObject::tr("ms2 element after precursor in scan is not a cbor map %1 %2:\n%3")
.arg(m_currentSampleName)
.arg(m_cborScanId.value("index").toInteger())
.arg(mpa_cborReader->lastError().toString()));
}
}
else
{
throw pappso::PappsoException(
QObject::tr(
"ERROR: expecting ms2 element in scan not %1, sample %2, last expected string %3")
.arg(m_expectedString)
.arg(m_currentSampleName)
.arg(last_expected_string));
}
getExpectedString();
qDebug() << m_expectedString;
if(m_expectedString == "props")
{
bool is_ok;
is_ok = mpa_cborReader->readCborMap(m_cborScanProps);
if(!is_ok)
{
throw pappso::PappsoException("ERROR: props element in scan is not well formed");
}
if(!getExpectedString())
{
throw pappso::PappsoException(
QObject::tr("ERROR: expecting psm_list element in scan %1").arg(m_currentPsmProforma));
}
}
//"psm_list": [
scanStarted(monitor);
if(m_expectedString == "psm_list")
{
qDebug() << "psm_list";
if(!mpa_cborReader->isArray())
{
throw pappso::PappsoException("ERROR in psm_list: expecting an array");
}
mpa_cborReader->enterContainer();
while(!mpa_cborReader->lastError() && mpa_cborReader->hasNext())
{
readPsm(monitor);
}
mpa_cborReader->leaveContainer();
}
mpa_cborReader->leaveContainer();
qDebug() << "scan end";
scanFinished(monitor);
qDebug();
}
void
PsmFileReaderBase::readPsm(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
qDebug();
bool is_ok;
if(!mpa_cborReader->isMap())
{
throw pappso::PappsoException("ERROR in psm: expecting a map");
}
mpa_cborReader->enterContainer();
getExpectedString();
// "proforma": "AQEEM[+15.99491]AQVAK",
if(m_expectedString == "proforma")
{
if(!mpa_cborReader->decodeString(m_currentPsmProforma))
{
throw pappso::PappsoException("ERROR: proforma element in psm-scan is not a string");
}
}
else
{
throw pappso::PappsoException("ERROR: expecting proforma element in psm-scan");
}
//"protein_list" : [
//{
//"accession": "GRMZM2G083841_P01",
//"position": [15,236]
//}
//],
getExpectedString();
m_currentPsmProteinRefList.clear();
qDebug() << m_expectedString;
if(m_expectedString == "protein_list")
{
mpa_cborReader->enterContainer(); // array
while(!mpa_cborReader->lastError() && mpa_cborReader->hasNext())
{
m_currentPsmProteinRefList.push_back(readPsmProteinRef(is_ok));
if(!is_ok)
{
qDebug();
throw pappso::PappsoException(
QObject::tr("ERROR: reading protein_list element in psm-scan"));
}
}
// qDebug() << mpa_cborReader->type();
mpa_cborReader->leaveContainer(); // array
}
else
{
throw pappso::PappsoException("ERROR: expecting protein_list element in psm-scan");
}
// props: {
m_cborScanPsmProps.clear();
//"eval": {
qDebug();
m_cborScanPsmEval.clear();
getExpectedString();
qDebug() << m_expectedString;
if(m_expectedString == "props")
{
is_ok = mpa_cborReader->readCborMap(m_cborScanPsmProps);
if(!is_ok)
{
throw pappso::PappsoException("ERROR: props element in psm-scan is not well formed");
}
if(!getExpectedString())
{
throw pappso::PappsoException(
QObject::tr("ERROR: expecting eval element in psm-scan %1").arg(m_currentPsmProforma));
}
}
if(m_expectedString == "eval")
{
is_ok = mpa_cborReader->readCborMap(m_cborScanPsmEval);
if(!is_ok)
{
throw pappso::PappsoException("ERROR: eval element in psm-scan is not well formed");
}
}
else
{
throw pappso::PappsoException(
QObject::tr("ERROR: expecting eval element in psm-scan %1 not %2 in %3 %4 %5")
.arg(m_currentPsmProforma)
.arg(m_expectedString)
.arg(__FILE__)
.arg(__FUNCTION__)
.arg(__LINE__));
}
qDebug() << m_expectedString;
mpa_cborReader->leaveContainer();
qDebug();
psmReady(monitor);
}
void
PsmFileReaderBase::psmReady(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
// PSM is ready, do what you want :)
}
void
PsmFileReaderBase::informationsReady(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::parameterMapReady(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::logReady(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::fastaFilesReady(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::proteinMapReady(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::sampleStarted(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::scanStarted(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::scanFinished(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::sampleFinished(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
pappso::PeptideSp
PsmFileReaderBase::getCurrentPsmPeptideSp() const
{
pappso::PeptideSp peptide_sp;
if(m_currentPsmProforma.isEmpty())
{
throw pappso::PappsoException(QObject::tr("ERROR: m_currentPsmProforma is empty"));
}
else
{
peptide_sp = pappso::PeptideProFormaParser::parseString(m_currentPsmProforma);
}
return peptide_sp;
}
pappso::QualifiedMassSpectrumSPtr
PsmFileReaderBase::getCurrentQualifiedMassSpectrumSPtr() const
{
if(m_currentPeaklistFile.name.isEmpty())
{
throw pappso::PappsoException(QObject::tr("ERROR: m_currentPeaklistFile is empty"));
}
if(m_cborScanId.isEmpty())
{
throw pappso::PappsoException(QObject::tr("ERROR: m_cborScanId is empty"));
}
if(m_cborScanPrecursor.isEmpty())
{
throw pappso::PappsoException(QObject::tr("ERROR: m_cborScanPrecursor is empty"));
}
if(!m_cborScanId.keys().contains("index"))
{
throw pappso::PappsoException("There is no scan index");
}
if(m_cborScanMs2.isEmpty())
{
throw pappso::PappsoException(QObject::tr("ERROR: m_cborScanMs2 is empty"));
}
else
{
if(!m_cborScanMs2.keys().contains("mz"))
{
throw pappso::PappsoException("There is no ms2 mz values");
}
if(!m_cborScanMs2.keys().contains("intensity"))
{
throw pappso::PappsoException("There is no ms2 intensity values");
}
}
pappso::MsRunId msrun_id(m_currentPeaklistFile.name);
msrun_id.setSampleName(m_currentSampleName);
pappso::MsRunIdCstSPtr msrun_id_sp = std::make_shared<const pappso::MsRunId>(msrun_id);
pappso::MassSpectrumId ms_id(msrun_id_sp);
ms_id.setSpectrumIndex(m_cborScanId.value("index").toInteger());
// native_id
if(m_cborScanId.keys().contains("native_id"))
{
ms_id.setNativeId(m_cborScanId.value("native_id").toString());
}
std::vector<DataPoint> data_point_vector;
std::size_t i = 0;
for(auto cbor_mz_value : m_cborScanMs2.value("mz").toArray())
{
data_point_vector.push_back(
{cbor_mz_value.toDouble(), m_cborScanMs2.value("intensity").toArray().at(i).toDouble()});
i++;
}
MassSpectrum mass_spectrum(data_point_vector);
pappso::PrecursorIonData precursor_ion_data;
pappso::QualifiedMassSpectrum qualified_mass_spectrum(ms_id);
qualified_mass_spectrum.setMassSpectrumSPtr(mass_spectrum.makeMassSpectrumSPtr());
qualified_mass_spectrum.setMsLevel(2);
if(m_cborScanPrecursor.keys().contains("z"))
{
precursor_ion_data.charge = m_cborScanPrecursor.value("z").toInteger();
}
if(m_cborScanPrecursor.keys().contains("mz"))
{
precursor_ion_data.mz = m_cborScanPrecursor.value("mz").toDouble();
}
if(m_cborScanPrecursor.keys().contains("intensity"))
{
precursor_ion_data.intensity = m_cborScanPrecursor.value("intensity").toDouble();
}
qualified_mass_spectrum.appendPrecursorIonData(precursor_ion_data);
if(m_cborScanMs2.keys().contains("rt"))
{
qualified_mass_spectrum.setRtInSeconds(m_cborScanMs2.value("rt").toDouble());
}
return qualified_mass_spectrum.makeQualifiedMassSpectrumSPtr();
}
void
PsmFileReaderBase::sampleListStarted(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
void
PsmFileReaderBase::sampleListFinished(pappso::UiMonitorInterface &monitor [[maybe_unused]])
{
}
double
PsmFileReaderBase::getPrecursorMass(double mz_prec, uint charge) const
{
// compute precursor mass given the charge state
mz_prec = mz_prec * (double)charge;
mz_prec -= (MHPLUS * (double)charge);
return mz_prec;
}
} // namespace psm
} // namespace cbor
} // namespace pappso
pappso::MassSpectrumId
Definition massspectrumid.h:41
pappso::MassSpectrumId::setNativeId
void setNativeId(const QString &native_id)
Definition massspectrumid.cpp:92
pappso::MassSpectrumId::setSpectrumIndex
void setSpectrumIndex(std::size_t index)
Definition massspectrumid.cpp:106
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition massspectrum.h:70
pappso::MassSpectrum::makeMassSpectrumSPtr
MassSpectrumSPtr makeMassSpectrumSPtr() const
Definition massspectrum.cpp:128
pappso::MsRunId
MS run identity MsRunId identifies an MS run with a unique ID (XmlId) and contains eventually informa...
Definition msrunid.h:54
pappso::MsRunId::setSampleName
void setSampleName(const QString &name)
set a sample name for this MsRunId
Definition msrunid.cpp:77
pappso::PappsoException
Definition pappsoexception.h:41
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition pappsoexception.h:66
pappso::PeptideProFormaParser::parseString
static PeptideSp parseString(const QString &pepstr)
Definition peptideproformaparser.cpp:228
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition qualifiedmassspectrum.h:99
pappso::QualifiedMassSpectrum::appendPrecursorIonData
void appendPrecursorIonData(const PrecursorIonData &precursor_ion_data)
Definition qualifiedmassspectrum.cpp:443
pappso::QualifiedMassSpectrum::setMsLevel
void setMsLevel(uint ms_level)
Set the mass spectrum level.
Definition qualifiedmassspectrum.cpp:181
pappso::QualifiedMassSpectrum::makeQualifiedMassSpectrumSPtr
QualifiedMassSpectrumSPtr makeQualifiedMassSpectrumSPtr() const
Definition qualifiedmassspectrum.cpp:107
pappso::QualifiedMassSpectrum::setMassSpectrumSPtr
void setMassSpectrumSPtr(MassSpectrumSPtr massSpectrum)
Set the MassSpectrumSPtr.
Definition qualifiedmassspectrum.cpp:122
pappso::QualifiedMassSpectrum::setRtInSeconds
void setRtInSeconds(pappso_double rt)
Set the retention time in seconds.
Definition qualifiedmassspectrum.cpp:197
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::cbor::CborStreamReaderInterface::CborStreamReaderInterface
CborStreamReaderInterface()
Definition cborstreamreaderinterface.cpp:30
pappso::cbor::CborStreamReaderInterface::m_expectedString
QString m_expectedString
Definition cborstreamreaderinterface.h:69
pappso::cbor::CborStreamReaderInterface::initCborReader
void initCborReader(QFile *pcborfile)
Definition cborstreamreaderinterface.cpp:80
pappso::cbor::CborStreamReaderInterface::getExpectedString
bool getExpectedString()
Definition cborstreamreaderinterface.cpp:54
pappso::cbor::CborStreamReaderInterface::mpa_cborReader
CborStreamReader * mpa_cborReader
Definition cborstreamreaderinterface.h:68
pappso::cbor::CborStreamWriter
overrides QCborStreamWriter base class to provide convenient functions
Definition cborstreamwriter.h:45
pappso::cbor::psm::PsmFileReaderBase::m_cborLog
QCborArray m_cborLog
Definition psmfilereaderbase.h:134
pappso::cbor::psm::PsmFileReaderBase::m_currentPsmProteinRefList
std::vector< PsmProteinRef > m_currentPsmProteinRefList
Definition psmfilereaderbase.h:143
pappso::cbor::psm::PsmFileReaderBase::m_currentPeaklistFile
PsmFile m_currentPeaklistFile
Definition psmfilereaderbase.h:131
pappso::cbor::psm::PsmFileReaderBase::getCurrentQualifiedMassSpectrumSPtr
pappso::QualifiedMassSpectrumSPtr getCurrentQualifiedMassSpectrumSPtr() const
get the qualified Spectrum for the current PSM
Definition psmfilereaderbase.cpp:745
pappso::cbor::psm::PsmFileReaderBase::getCurrentPsmPeptideSp
pappso::PeptideSp getCurrentPsmPeptideSp() const
Definition psmfilereaderbase.cpp:730
pappso::cbor::psm::PsmFileReaderBase::m_targetFastaFiles
QStringList m_targetFastaFiles
Definition psmfilereaderbase.h:127
pappso::cbor::psm::PsmFileReaderBase::currentProteinRefListContainsTarget
bool currentProteinRefListContainsTarget() const
tells if the current PSM has a target accession
Definition psmfilereaderbase.cpp:96
pappso::cbor::psm::PsmFileReaderBase::m_decoyFastaFiles
QStringList m_decoyFastaFiles
Definition psmfilereaderbase.h:128
pappso::cbor::psm::PsmFileReaderBase::sampleListStarted
virtual void sampleListStarted(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:832
pappso::cbor::psm::PsmFileReaderBase::writePsmFileList
void writePsmFileList(CborStreamWriter &writer, const std::vector< PsmFile > &file_list)
Definition psmfilereaderbase.cpp:333
pappso::cbor::psm::PsmFileReaderBase::m_currentSampleName
QString m_currentSampleName
Definition psmfilereaderbase.h:130
pappso::cbor::psm::PsmFileReaderBase::m_cborScanProps
QCborMap m_cborScanProps
Definition psmfilereaderbase.h:139
pappso::cbor::psm::PsmFileReaderBase::~PsmFileReaderBase
virtual ~PsmFileReaderBase() override
Definition psmfilereaderbase.cpp:48
pappso::cbor::psm::PsmFileReaderBase::getPrecursorMass
double getPrecursorMass(double mz_prec, uint charge) const
convenient function do compute precusor ion mass
Definition psmfilereaderbase.cpp:843
pappso::cbor::psm::PsmFileReaderBase::logReady
virtual void logReady(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:694
pappso::cbor::psm::PsmFileReaderBase::scanStarted
virtual void scanStarted(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:715
pappso::cbor::psm::PsmFileReaderBase::readPsm
virtual void readPsm(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:573
pappso::cbor::psm::PsmFileReaderBase::readLog
virtual void readLog(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:221
pappso::cbor::psm::PsmFileReaderBase::proteinMapReady
virtual void proteinMapReady(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:705
pappso::cbor::psm::PsmFileReaderBase::m_cborScanPsmProps
QCborMap m_cborScanPsmProps
Definition psmfilereaderbase.h:141
pappso::cbor::psm::PsmFileReaderBase::sampleStarted
virtual void sampleStarted(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:710
pappso::cbor::psm::PsmFileReaderBase::PsmFileReaderBase
PsmFileReaderBase()
Definition psmfilereaderbase.cpp:44
pappso::cbor::psm::PsmFileReaderBase::currentProteinRefListContainsDecoy
bool currentProteinRefListContainsDecoy() const
tells if the current PSM has a decoy accession
Definition psmfilereaderbase.cpp:85
pappso::cbor::psm::PsmFileReaderBase::readPsmFile
PsmFile readPsmFile(bool &is_ok)
Definition psmfilereaderbase.cpp:300
pappso::cbor::psm::PsmFileReaderBase::m_proteinMap
PsmProteinMap m_proteinMap
Definition psmfilereaderbase.h:129
pappso::cbor::psm::PsmFileReaderBase::readParameterMap
virtual void readParameterMap(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:235
pappso::cbor::psm::PsmFileReaderBase::m_currentPsmProforma
QString m_currentPsmProforma
Definition psmfilereaderbase.h:142
pappso::cbor::psm::PsmFileReaderBase::readCbor
void readCbor(QFile *cborp, pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:70
pappso::cbor::psm::PsmFileReaderBase::m_cborScanPrecursor
QCborMap m_cborScanPrecursor
Definition psmfilereaderbase.h:137
pappso::cbor::psm::PsmFileReaderBase::readScan
virtual void readScan(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:442
pappso::cbor::psm::PsmFileReaderBase::readInformations
virtual void readInformations(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:194
pappso::cbor::psm::PsmFileReaderBase::scanFinished
virtual void scanFinished(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:720
pappso::cbor::psm::PsmFileReaderBase::sampleListFinished
virtual void sampleListFinished(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:837
pappso::cbor::psm::PsmFileReaderBase::psmReady
virtual void psmReady(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:678
pappso::cbor::psm::PsmFileReaderBase::informationsReady
virtual void informationsReady(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:684
pappso::cbor::psm::PsmFileReaderBase::m_cborParameterMap
QCborMap m_cborParameterMap
Definition psmfilereaderbase.h:135
pappso::cbor::psm::PsmFileReaderBase::m_cborInformations
QCborMap m_cborInformations
Definition psmfilereaderbase.h:133
pappso::cbor::psm::PsmFileReaderBase::readRoot
void readRoot(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:108
pappso::cbor::psm::PsmFileReaderBase::m_currentIdentificationFileList
std::vector< PsmFile > m_currentIdentificationFileList
Definition psmfilereaderbase.h:132
pappso::cbor::psm::PsmFileReaderBase::writePsmFile
void writePsmFile(CborStreamWriter &writer, const PsmFile &psm_file)
Definition psmfilereaderbase.cpp:324
pappso::cbor::psm::PsmFileReaderBase::fastaFilesReady
virtual void fastaFilesReady(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:700
pappso::cbor::psm::PsmFileReaderBase::m_cborScanId
QCborMap m_cborScanId
Definition psmfilereaderbase.h:136
pappso::cbor::psm::PsmFileReaderBase::m_cborScanMs2
QCborMap m_cborScanMs2
Definition psmfilereaderbase.h:138
pappso::cbor::psm::PsmFileReaderBase::parameterMapReady
virtual void parameterMapReady(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:689
pappso::cbor::psm::PsmFileReaderBase::readProteinMap
virtual void readProteinMap(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:249
pappso::cbor::psm::PsmFileReaderBase::readSample
virtual void readSample(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:346
pappso::cbor::psm::PsmFileReaderBase::m_cborScanPsmEval
QCborMap m_cborScanPsmEval
Definition psmfilereaderbase.h:140
pappso::cbor::psm::PsmFileReaderBase::readPsmProteinRef
PsmProteinRef readPsmProteinRef(bool &is_ok)
Definition psmfilereaderbase.cpp:257
pappso::cbor::psm::PsmFileReaderBase::sampleFinished
virtual void sampleFinished(pappso::UiMonitorInterface &monitor)
Definition psmfilereaderbase.cpp:725
pappso::cbor::psm
Definition cborscanmapbase.h:40
pappso::cbor
Definition cborstreamreader.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::QualifiedMassSpectrumSPtr
std::shared_ptr< QualifiedMassSpectrum > QualifiedMassSpectrumSPtr
Definition qualifiedmassspectrum.h:43
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
pappso::uint
unsigned int uint
Definition types.h:67
pappsoexception.h
peptideproformaparser.h
psmfilereaderbase.h
pappso::PrecursorIonData
Definition qualifiedmassspectrum.h:75
pappso::PrecursorIonData::mz
double mz
Definition qualifiedmassspectrum.h:76
pappso::PrecursorIonData::intensity
double intensity
Definition qualifiedmassspectrum.h:78
pappso::PrecursorIonData::charge
int charge
Definition qualifiedmassspectrum.h:77
pappso::cbor::psm::PsmFileReaderBase::PsmProteinRef
Definition psmfilereaderbase.h:71
pappso::cbor::psm::PsmFileReaderBase::PsmProteinRef::accession
QString accession
Definition psmfilereaderbase.h:72
pappso::cbor::psm::PsmFileReaderBase::PsmProteinRef::positions
std::vector< std::size_t > positions
Definition psmfilereaderbase.h:73
pappso::cbor::psm::PsmFile
Definition psmfilereaderbase.h:47
pappso::cbor::psm::PsmFile::name
QString name
Definition psmfilereaderbase.h:48