Loading...
Searching...
No Matches
timsdata.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/vendors/tims/timsdata.cpp
* \date 27/08/2019
* \author Olivier Langella
* \brief main Tims data handler
*/
/*******************************************************************************
* Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.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 "timsdata.h"
#include "../../exception/exceptionnotfound.h"
#include "../../exception/exceptioninterrupted.h"
#include "../../processing/combiners/tracepluscombiner.h"
#include <QDebug>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QMutexLocker>
#include <QThread>
#include <set>
#include <QtConcurrent>
#include "timsddaprecursors.h"
#include "timsdiaslices.h"
namespace pappso
{
TimsData::TimsData(QDir timsDataDirectory)
: m_timsDataDirectory(timsDataDirectory)
{
qDebug() << "Start of construction of TimsData";
mpa_mzCalibrationStore = new MzCalibrationStore();
if(!m_timsDataDirectory.exists())
{
throw PappsoException(
QObject::tr("ERROR TIMS data directory %1 not found")
.arg(m_timsDataDirectory.absolutePath()));
}
if(!QFileInfo(m_timsDataDirectory.absoluteFilePath("analysis.tdf")).exists())
{
throw PappsoException(
QObject::tr("ERROR TIMS data directory, %1 sqlite file not found")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf")));
}
// Open the database
QSqlDatabase qdb = openDatabaseConnection();
QSqlQuery q(qdb);
if(!q.exec("select Key, Value from GlobalMetadata where "
"Key='TimsCompressionType';"))
{
qDebug();
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, executing SQL "
"command %2:\n%3\n%4\n%5")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(q.lastQuery())
.arg(q.lastError().databaseText())
.arg(q.lastError().driverText())
.arg(q.lastError().nativeErrorCode()));
}
int compression_type = 0;
if(q.next())
{
compression_type = q.value(1).toInt();
}
qDebug() << " compression_type=" << compression_type;
mpa_timsBinDec = new TimsBinDec(
QFileInfo(m_timsDataDirectory.absoluteFilePath("analysis.tdf_bin")),
compression_type);
qDebug();
try
{
qDebug();
mpa_timsDdaPrecursors = new TimsDdaPrecursors(q, this);
}
catch(pappso::ExceptionNotFound &not_found)
{
qDebug();
mpa_timsDdaPrecursors = nullptr;
}
qDebug();
try
{
qDebug();
mpa_timsDiaSlices = new TimsDiaSlices(q, this);
}
catch(pappso::ExceptionNotFound &not_found)
{
qDebug();
mpa_timsDiaSlices = nullptr;
}
fillFrameIdDescrList();
// get number of scans
if(!q.exec("SELECT SUM(NumScans),COUNT(Id) FROM Frames"))
{
qDebug();
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, executing SQL "
"command %2:\n%3\n%4\n%5")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(q.lastQuery())
.arg(qdb.lastError().databaseText())
.arg(qdb.lastError().driverText())
.arg(qdb.lastError().nativeErrorCode()));
}
if(q.next())
{
qDebug();
m_totalScanCount = q.value(0).toLongLong();
m_frameCount = q.value(1).toLongLong();
}
if(!q.exec("select * from MzCalibration;"))
{
qDebug();
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, executing SQL "
"command %2:\n%3\n%4\n%5")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(q.lastQuery())
.arg(q.lastError().databaseText())
.arg(q.lastError().driverText())
.arg(q.lastError().nativeErrorCode()));
}
while(q.next())
{
QSqlRecord record = q.record();
m_mapMzCalibrationRecord.insert(
std::pair<int, QSqlRecord>(record.value(0).toInt(), record));
}
// m_mapTimsCalibrationRecord
if(!q.exec("select * from TimsCalibration;"))
{
qDebug();
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, executing SQL "
"command %2:\n%3\n%4\n%5")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(q.lastQuery())
.arg(q.lastError().databaseText())
.arg(q.lastError().driverText())
.arg(q.lastError().nativeErrorCode()));
}
while(q.next())
{
QSqlRecord record = q.record();
m_mapTimsCalibrationRecord.insert(
std::pair<int, QSqlRecord>(record.value(0).toInt(), record));
}
// store frames
if(!q.exec("select Frames.TimsId, Frames.AccumulationTime, " // 1
"Frames.MzCalibration, " // 2
"Frames.T1, Frames.T2, " // 4
"Frames.Time, Frames.MsMsType, Frames.TimsCalibration, " // 7
"Frames.Id " // 8
" FROM Frames;"))
{
qDebug();
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, executing SQL "
"command %2:\n%3\n%4\n%5")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(q.lastQuery())
.arg(q.lastError().databaseText())
.arg(q.lastError().driverText())
.arg(q.lastError().nativeErrorCode()));
}
m_mapFramesRecord.resize(m_frameCount + 1);
while(q.next())
{
QSqlRecord record = q.record();
TimsFrameRecord &frame_record =
m_mapFramesRecord[record.value(8).toULongLong()];
frame_record.frame_id = record.value(8).toULongLong();
frame_record.tims_offset = record.value(0).toULongLong();
frame_record.accumulation_time = record.value(1).toDouble();
frame_record.mz_calibration_id = record.value(2).toULongLong();
frame_record.frame_t1 = record.value(3).toDouble();
frame_record.frame_t2 = record.value(4).toDouble();
frame_record.frame_time = record.value(5).toDouble();
frame_record.msms_type = record.value(6).toInt();
frame_record.tims_calibration_id = record.value(7).toULongLong();
}
qDebug();
}
QSqlDatabase
TimsData::openDatabaseConnection() const
{
QString database_connection_name = QString("%1_%2")
.arg(m_timsDataDirectory.absolutePath())
.arg((quintptr)QThread::currentThread());
// Open the database
QSqlDatabase qdb = QSqlDatabase::database(database_connection_name);
if(!qdb.isValid())
{
qDebug() << database_connection_name;
qdb = QSqlDatabase::addDatabase("QSQLITE", database_connection_name);
qdb.setDatabaseName(m_timsDataDirectory.absoluteFilePath("analysis.tdf"));
}
if(!qdb.open())
{
qDebug();
throw PappsoException(
QObject::tr("ERROR opening TIMS sqlite database file %1, database name "
"%2 :\n%3\n%4\n%5")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(database_connection_name)
.arg(qdb.lastError().databaseText())
.arg(qdb.lastError().driverText())
.arg(qdb.lastError().nativeErrorCode()));
}
return qdb;
}
TimsData::TimsData([[maybe_unused]] const TimsData &other)
{
qDebug();
}
TimsData::~TimsData()
{
// m_qdb.close();
if(mpa_timsBinDec != nullptr)
{
delete mpa_timsBinDec;
}
if(mpa_mzCalibrationStore != nullptr)
{
delete mpa_mzCalibrationStore;
}
if(mpa_timsDdaPrecursors != nullptr)
{
delete mpa_timsDdaPrecursors;
}
if(mpa_timsDiaSlices != nullptr)
{
delete mpa_timsDiaSlices;
}
}
void
TimsData::fillFrameIdDescrList()
{
qDebug();
QSqlDatabase qdb = openDatabaseConnection();
QSqlQuery q =
qdb.exec(QString("SELECT Id, NumScans FROM "
"Frames ORDER BY Id"));
if(q.lastError().isValid())
{
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, executing SQL "
"command %2:\n%3\n%4\n%5")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(q.lastQuery())
.arg(qdb.lastError().databaseText())
.arg(qdb.lastError().driverText())
.arg(qdb.lastError().nativeErrorCode()));
}
TimsFrameSPtr tims_frame;
bool index_found = false;
std::size_t timsId;
/** @brief number of scans in mobility dimension (number of TOF scans)
*/
std::size_t numberScans;
std::size_t cumulScans = 0;
while(q.next() && (!index_found))
{
timsId = q.value(0).toULongLong();
numberScans = q.value(1).toULongLong();
// qDebug() << timsId;
m_thousandIndexToFrameIdDescrListIndex.insert(
std::pair<std::size_t, std::size_t>((cumulScans / 1000),
m_frameIdDescrList.size()));
m_frameIdDescrList.push_back({timsId, numberScans, cumulScans});
cumulScans += numberScans;
}
qDebug();
}
std::pair<std::size_t, std::size_t>
TimsData::getScanCoordinateFromRawIndex(std::size_t raw_index) const
{
return getScanCoordinatesByGlobalScanIndex(raw_index);
}
std::pair<std::size_t, std::size_t>
TimsData::getScanCoordinatesByGlobalScanIndex(std::size_t raw_index) const
{
std::size_t fast_access = raw_index / 1000;
qDebug() << " fast_access=" << fast_access;
auto map_it = m_thousandIndexToFrameIdDescrListIndex.find(fast_access);
if(map_it == m_thousandIndexToFrameIdDescrListIndex.end())
{
throw ExceptionNotFound(
QObject::tr("ERROR raw index %1 not found (fast_access)")
.arg(raw_index));
}
std::size_t start_point_index = map_it->second;
while((start_point_index > 0) &&
(m_frameIdDescrList[start_point_index].m_globalScanIndex > raw_index))
{
start_point_index--;
}
for(std::size_t i = start_point_index; i < m_frameIdDescrList.size(); i++)
{
if(raw_index < (m_frameIdDescrList[i].m_globalScanIndex +
m_frameIdDescrList[i].m_scanCount))
{
return std::pair<std::size_t, std::size_t>(
m_frameIdDescrList[i].m_frameId,
raw_index - m_frameIdDescrList[i].m_globalScanIndex);
}
}
throw ExceptionNotFound(
QObject::tr("ERROR raw index %1 not found").arg(raw_index));
}
std::size_t
TimsData::getRawIndexFromCoordinate(std::size_t frame_id,
std::size_t index) const
{
return getGlobalScanIndexByScanCoordinates(frame_id, index);
}
std::size_t
TimsData::getGlobalScanIndexByScanCoordinates(std::size_t frame_id,
std::size_t index) const
{
for(auto frameDescr : m_frameIdDescrList)
{
if(frameDescr.m_frameId == frame_id)
{
return frameDescr.m_globalScanIndex + index;
}
}
throw ExceptionNotFound(
QObject::tr("ERROR raw index with frame_id=%1 scan_index=%2 not found")
.arg(frame_id)
.arg(index));
}
/** @brief get a mass spectrum given its spectrum index
* @param raw_index a number begining at 0, corresponding to a Tims Scan in
* the order they lies in the binary data file
*/
MassSpectrumCstSPtr
TimsData::getMassSpectrumCstSPtrByRawIndex(std::size_t raw_index)
{
return getMassSpectrumCstSPtrByGlobalScanIndex(raw_index);
}
pappso::MassSpectrumCstSPtr
TimsData::getMassSpectrumCstSPtrByGlobalScanIndex(std::size_t raw_index)
{
qDebug() << " raw_index=" << raw_index;
try
{
auto coordinate = getScanCoordinatesByGlobalScanIndex(raw_index);
return getMassSpectrumCstSPtr(coordinate.first, coordinate.second);
}
catch(PappsoException &error)
{
throw PappsoException(
QObject::tr("Error TimsData::getMassSpectrumCstSPtrByRawIndex "
"raw_index=%1 :\n%2")
.arg(raw_index)
.arg(error.qwhat()));
}
}
TimsFrameBaseCstSPtr
TimsData::getTimsFrameBaseCstSPtr(std::size_t timsId)
{
qDebug() << " timsId=" << timsId;
const TimsFrameRecord &frame_record = m_mapFramesRecord[timsId];
if(timsId > m_totalScanCount)
{
throw ExceptionNotFound(
QObject::tr("ERROR Frames database id %1 not found").arg(timsId));
}
TimsFrameBaseSPtr tims_frame;
tims_frame = std::make_shared<TimsFrameBase>(
TimsFrameBase(timsId, frame_record.tims_offset));
auto it_map_record =
m_mapMzCalibrationRecord.find(frame_record.mz_calibration_id);
if(it_map_record != m_mapMzCalibrationRecord.end())
{
double T1_frame = frame_record.frame_t1; // Frames.T1
double T2_frame = frame_record.frame_t2; // Frames.T2
tims_frame.get()->setMzCalibrationInterfaceSPtr(
mpa_mzCalibrationStore->getInstance(
T1_frame, T2_frame, it_map_record->second));
}
else
{
throw ExceptionNotFound(
QObject::tr("ERROR MzCalibration database id %1 not found")
.arg(frame_record.mz_calibration_id));
}
tims_frame.get()->setAcqDurationInMilliseconds(
frame_record.accumulation_time);
tims_frame.get()->setRtInSeconds(frame_record.frame_time);
tims_frame.get()->setMsMsType(frame_record.msms_type);
auto it_map_record_tims_calibration =
m_mapTimsCalibrationRecord.find(frame_record.tims_calibration_id);
if(it_map_record_tims_calibration != m_mapTimsCalibrationRecord.end())
{
tims_frame.get()->setTimsCalibration(
it_map_record_tims_calibration->second.value(1).toInt(),
it_map_record_tims_calibration->second.value(2).toDouble(),
it_map_record_tims_calibration->second.value(3).toDouble(),
it_map_record_tims_calibration->second.value(4).toDouble(),
it_map_record_tims_calibration->second.value(5).toDouble(),
it_map_record_tims_calibration->second.value(6).toDouble(),
it_map_record_tims_calibration->second.value(7).toDouble(),
it_map_record_tims_calibration->second.value(8).toDouble(),
it_map_record_tims_calibration->second.value(9).toDouble(),
it_map_record_tims_calibration->second.value(10).toDouble(),
it_map_record_tims_calibration->second.value(11).toDouble());
}
else
{
throw ExceptionNotFound(
QObject::tr("ERROR TimsCalibration database id %1 not found")
.arg(frame_record.tims_calibration_id));
}
return tims_frame;
}
std::vector<std::size_t>
TimsData::getTimsMS1FrameIdsInRtRange(double rt_begin, double rt_end) const
{
qDebug() << " rt_begin=" << rt_begin << " rt_end=" << rt_end;
if(rt_begin < 0)
rt_begin = 0;
std::vector<std::size_t> tims_frameid_list;
QSqlDatabase qdb = openDatabaseConnection();
QSqlQuery q = qdb.exec(QString("SELECT Frames.Id FROM Frames WHERE "
"Frames.MsMsType=0 AND (Frames.Time>=%1) "
"AND (Frames.Time<=%2) ORDER BY "
"Frames.Time;")
.arg(rt_begin)
.arg(rt_end));
if(q.lastError().isValid())
{
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, database name %2, "
"executing SQL "
"command %3:\n%4\n%5\n%6")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(qdb.databaseName())
.arg(q.lastQuery())
.arg(qdb.lastError().databaseText())
.arg(qdb.lastError().driverText())
.arg(qdb.lastError().nativeErrorCode()));
}
while(q.next())
{
tims_frameid_list.push_back(q.value(0).toULongLong());
}
return tims_frameid_list;
}
std::vector<std::size_t>
TimsData::getTimsMS2FrameIdsInRtRange(double rt_begin, double rt_end) const
{
qDebug() << " rt_begin=" << rt_begin << " rt_end=" << rt_end;
if(rt_begin < 0)
rt_begin = 0;
std::vector<std::size_t> tims_frameid_list;
QSqlDatabase qdb = openDatabaseConnection();
QSqlQuery q =
qdb.exec(QString("SELECT Frames.Id FROM Frames WHERE "
"Frames.MsMsType=8 AND "
"(Frames.Time>=%1) AND (Frames.Time<=%2) ORDER BY "
"Frames.Time;")
.arg(rt_begin)
.arg(rt_end));
if(q.lastError().isValid())
{
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, database name %2, "
"executing SQL "
"command %3:\n%4\n%5\n%6")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(qdb.databaseName())
.arg(q.lastQuery())
.arg(qdb.lastError().databaseText())
.arg(qdb.lastError().driverText())
.arg(qdb.lastError().nativeErrorCode()));
}
while(q.next())
{
tims_frameid_list.push_back(q.value(0).toULongLong());
}
return tims_frameid_list;
}
TimsFrameCstSPtr
TimsData::getTimsFrameCstSPtr(std::size_t timsId)
{
qDebug() << " timsId=" << timsId
<< " m_mapFramesRecord.size()=" << m_mapFramesRecord.size();
/*
for(auto pair_i : m_mapFramesRecord)
{
qDebug() << " pair_i=" << pair_i.first;
}
*/
const TimsFrameRecord &frame_record = m_mapFramesRecord[timsId];
if(timsId > m_totalScanCount)
{
throw ExceptionNotFound(
QObject::tr("ERROR Frames database id %1 not found").arg(timsId));
}
TimsFrameSPtr tims_frame;
// QMutexLocker lock(&m_mutex);
tims_frame =
mpa_timsBinDec->getTimsFrameSPtrByOffset(timsId, m_mapFramesRecord);
// lock.unlock();
qDebug();
auto it_map_record =
m_mapMzCalibrationRecord.find(frame_record.mz_calibration_id);
if(it_map_record != m_mapMzCalibrationRecord.end())
{
double T1_frame = frame_record.frame_t1; // Frames.T1
double T2_frame = frame_record.frame_t2; // Frames.T2
tims_frame.get()->setMzCalibrationInterfaceSPtr(
mpa_mzCalibrationStore->getInstance(
T1_frame, T2_frame, it_map_record->second));
}
else
{
throw ExceptionNotFound(
QObject::tr(
"ERROR MzCalibration database id %1 not found for frame_id=%2")
.arg(frame_record.mz_calibration_id)
.arg(timsId));
}
tims_frame.get()->setAcqDurationInMilliseconds(
frame_record.accumulation_time);
tims_frame.get()->setRtInSeconds(frame_record.frame_time);
tims_frame.get()->setMsMsType(frame_record.msms_type);
qDebug();
auto it_map_record_tims_calibration =
m_mapTimsCalibrationRecord.find(frame_record.tims_calibration_id);
if(it_map_record_tims_calibration != m_mapTimsCalibrationRecord.end())
{
tims_frame.get()->setTimsCalibration(
it_map_record_tims_calibration->second.value(1).toInt(),
it_map_record_tims_calibration->second.value(2).toDouble(),
it_map_record_tims_calibration->second.value(3).toDouble(),
it_map_record_tims_calibration->second.value(4).toDouble(),
it_map_record_tims_calibration->second.value(5).toDouble(),
it_map_record_tims_calibration->second.value(6).toDouble(),
it_map_record_tims_calibration->second.value(7).toDouble(),
it_map_record_tims_calibration->second.value(8).toDouble(),
it_map_record_tims_calibration->second.value(9).toDouble(),
it_map_record_tims_calibration->second.value(10).toDouble(),
it_map_record_tims_calibration->second.value(11).toDouble());
}
else
{
throw ExceptionNotFound(
QObject::tr("ERROR TimsCalibration database id %1 not found")
.arg(frame_record.tims_calibration_id));
}
qDebug();
return tims_frame;
}
MassSpectrumCstSPtr
TimsData::getMassSpectrumCstSPtr(std::size_t timsId, std::size_t scanNum)
{
qDebug() << " timsId=" << timsId << " scanNum=" << scanNum;
TimsFrameCstSPtr frame = getTimsFrameCstSPtrCached(timsId);
return frame->getMassSpectrumCstSPtr(scanNum);
}
std::size_t
TimsData::getTotalNumberOfFrames() const
{
return m_frameCount;
}
std::size_t
TimsData::getFrameCount() const
{
return m_frameCount;
}
std::size_t
TimsData::getTotalNumberOfScans() const
{
return m_totalScanCount;
}
std::size_t
TimsData::getTotalScanCount() const
{
return m_totalScanCount;
}
unsigned int
TimsData::getMsLevelBySpectrumIndex(std::size_t index)
{
return getMsLevelByGlobalScanIndex(index);
}
unsigned int
TimsData::getMsLevelByGlobalScanIndex(std::size_t index)
{
auto coordinate = getScanCoordinatesByGlobalScanIndex(index);
auto tims_frame = getTimsFrameCstSPtrCached(coordinate.first);
return tims_frame.get()->getMsLevel();
}
void
TimsData::getQualifiedMassSpectrumByRawIndex(
const MsRunIdCstSPtr &msrun_id,
QualifiedMassSpectrum &mass_spectrum,
std::size_t global_scan_index,
bool want_binary_data)
{
return getQualifiedMassSpectrumByGlobalScanIndex(
msrun_id, mass_spectrum, global_scan_index, want_binary_data);
}
void
TimsData::getQualifiedMassSpectrumByGlobalScanIndex(
const MsRunIdCstSPtr &msrun_id,
QualifiedMassSpectrum &mass_spectrum,
std::size_t global_scan_index,
bool want_binary_data)
{
try
{
auto coordinate = getScanCoordinatesByGlobalScanIndex(global_scan_index);
TimsFrameBaseCstSPtr tims_frame;
if(want_binary_data)
{
tims_frame = getTimsFrameCstSPtrCached(coordinate.first);
}
else
{
tims_frame = getTimsFrameBaseCstSPtrCached(coordinate.first);
}
MassSpectrumId spectrum_id;
spectrum_id.setSpectrumIndex(global_scan_index);
spectrum_id.setMsRunId(msrun_id);
spectrum_id.setNativeId(
QString("frame_id=%1 scan_index=%2 global_scan_index=%3")
.arg(coordinate.first)
.arg(coordinate.second)
.arg(global_scan_index));
mass_spectrum.setMassSpectrumId(spectrum_id);
mass_spectrum.setMsLevel(tims_frame.get()->getMsLevel());
mass_spectrum.setRtInSeconds(tims_frame.get()->getRtInSeconds());
mass_spectrum.setDtInMilliSeconds(
tims_frame.get()->getDriftTimeInMilliseconds(coordinate.second));
// 1/K0
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::IonMobOneOverK0,
tims_frame.get()->getOneOverK0Transformation(coordinate.second));
mass_spectrum.setEmptyMassSpectrum(true);
if(want_binary_data)
{
mass_spectrum.setMassSpectrumSPtr(
tims_frame.get()->getMassSpectrumSPtr(coordinate.second));
if(mass_spectrum.size() > 0)
{
mass_spectrum.setEmptyMassSpectrum(false);
}
}
else
{
// if(tims_frame.get()->getNbrPeaks(coordinate.second) > 0)
//{
mass_spectrum.setEmptyMassSpectrum(false);
// }
}
if(tims_frame.get()->getMsLevel() > 1)
{
if(mpa_timsDdaPrecursors != nullptr)
{
auto spectrum_descr =
mpa_timsDdaPrecursors->getSpectrumDescrWithScanCoordinates(
coordinate);
if(spectrum_descr.precursor_id > 0)
{
mass_spectrum.appendPrecursorIonData(
spectrum_descr.precursor_ion_data);
MassSpectrumId spectrum_id;
std::size_t prec_spectrum_index =
getGlobalScanIndexByScanCoordinates(
spectrum_descr.parent_frame, coordinate.second);
mass_spectrum.setPrecursorSpectrumIndex(prec_spectrum_index);
mass_spectrum.setPrecursorNativeId(
QString("frame_id=%1 scan_index=%2 global_scan_index=%3")
.arg(spectrum_descr.parent_frame)
.arg(coordinate.second)
.arg(prec_spectrum_index));
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::IsolationMz,
spectrum_descr.isolationMz);
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::IsolationMzWidth,
spectrum_descr.isolationWidth);
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::CollisionEnergy,
spectrum_descr.collisionEnergy);
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::BrukerPrecursorIndex,
(quint64)spectrum_descr.precursor_id);
}
}
}
}
catch(PappsoException &error)
{
throw PappsoException(
QObject::tr("Error TimsData::getQualifiedMassSpectrumByRawIndex "
"spectrum_index=%1 :\n%2")
.arg(global_scan_index)
.arg(error.qwhat()));
}
}
Trace
TimsData::getTicChromatogram() const
{
// In the Frames table, each frame has a record describing the
// SummedIntensities for all the mobility spectra.
MapTrace rt_tic_map_trace;
using Pair = std::pair<double, double>;
using Map = std::map<double, double>;
using Iterator = Map::iterator;
QSqlDatabase qdb = openDatabaseConnection();
QSqlQuery q =
qdb.exec(QString("SELECT Time, SummedIntensities "
"FROM Frames WHERE MsMsType = 0 "
"ORDER BY Time;"));
if(q.lastError().isValid())
{
throw PappsoException(
QObject::tr("ERROR in TIMS sqlite database file %1, database name %2, "
"executing SQL "
"command %3:\n%4\n%5\n%6")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(qdb.databaseName())
.arg(q.lastQuery())
.arg(qdb.lastError().databaseText())
.arg(qdb.lastError().driverText())
.arg(qdb.lastError().nativeErrorCode()));
}
while(q.next())
{
bool ok = false;
int cumulated_results = 2;
double rt = q.value(0).toDouble(&ok);
cumulated_results -= ok;
double sumY = q.value(1).toDouble(&ok);
cumulated_results -= ok;
if(cumulated_results)
{
throw PappsoException(
QObject::tr(
"ERROR in TIMS sqlite database file: could not read either the "
"retention time or the summed intensities (%1, database name "
"%2, "
"executing SQL "
"command %3:\n%4\n%5\n%6")
.arg(m_timsDataDirectory.absoluteFilePath("analysis.tdf"))
.arg(qdb.databaseName())
.arg(q.lastQuery())
.arg(qdb.lastError().databaseText())
.arg(qdb.lastError().driverText())
.arg(qdb.lastError().nativeErrorCode()));
}
// Try to insert value sumY at key rt.
std::pair<Iterator, bool> res = rt_tic_map_trace.insert(Pair(rt, sumY));
if(!res.second)
{
// One other same rt value was seen already (like in ion mobility
// mass spectrometry, for example). Only increment the y value.
res.first->second += sumY;
}
}
// qDebug().noquote() << "The TIC chromatogram:\n"
//<< rt_tic_map_trace.toTrace().toString();
return rt_tic_map_trace.toTrace();
}
TimsFrameBaseCstSPtr
TimsData::getTimsFrameBaseCstSPtrCached(std::size_t timsId)
{
QMutexLocker locker(&m_mutex);
for(auto &tims_frame : m_timsFrameBaseCache)
{
if(tims_frame.get()->getId() == timsId)
{
m_timsFrameBaseCache.push_back(tims_frame);
if(m_timsFrameBaseCache.size() > m_cacheSize)
m_timsFrameBaseCache.pop_front();
return tims_frame;
}
}
m_timsFrameBaseCache.push_back(getTimsFrameBaseCstSPtr(timsId));
if(m_timsFrameBaseCache.size() > m_cacheSize)
m_timsFrameBaseCache.pop_front();
return m_timsFrameBaseCache.back();
}
TimsFrameCstSPtr
TimsData::getTimsFrameCstSPtrCached(std::size_t timsId)
{
qDebug();
QMutexLocker locker(&m_mutex);
for(auto &tims_frame : m_timsFrameCache)
{
if(tims_frame.get()->getId() == timsId)
{
m_timsFrameCache.push_back(tims_frame);
if(m_timsFrameCache.size() > m_cacheSize)
m_timsFrameCache.pop_front();
return tims_frame;
}
}
TimsFrameCstSPtr frame_sptr = getTimsFrameCstSPtr(timsId);
// locker.relock();
qDebug();
m_timsFrameCache.push_back(frame_sptr);
if(m_timsFrameCache.size() > m_cacheSize)
m_timsFrameCache.pop_front();
qDebug();
return m_timsFrameCache.back();
/*
// the frame is not in the cache
if(std::find(m_someoneIsLoadingFrameId.begin(),
m_someoneIsLoadingFrameId.end(),
timsId) == m_someoneIsLoadingFrameId.end())
{
// not found, we are alone on this frame
m_someoneIsLoadingFrameId.push_back(timsId);
qDebug();
//locker.unlock();
TimsFrameCstSPtr frame_sptr = getTimsFrameCstSPtr(timsId);
// locker.relock();
qDebug();
m_someoneIsLoadingFrameId.erase(
std::find(m_someoneIsLoadingFrameId.begin(),
m_someoneIsLoadingFrameId.end(),
timsId));
m_timsFrameCache.push_back(frame_sptr);
if(m_timsFrameCache.size() > m_cacheSize)
m_timsFrameCache.pop_front();
qDebug();
return m_timsFrameCache.back();
}
else
{
// this frame is loading by someone else, we have to wait
qDebug();
// locker.unlock();
// std::size_t another_frame_id = timsId;
while(true)
{
QThread::usleep(1);
// locker.relock();
for(auto &tims_frame : m_timsFrameCache)
{
if(tims_frame.get()->getId() == timsId)
{
m_timsFrameCache.push_back(tims_frame);
return tims_frame;
}
}
// locker.unlock();
}
} // namespace pappso
*/
}
std::vector<double>
TimsData::getRetentionTimeLine() const
{
return getRetentionTimeLineInSeconds();
}
std::vector<double>
TimsData::getRetentionTimeLineInSeconds() const
{
std::vector<double> timeline;
timeline.reserve(m_mapFramesRecord.size());
for(const TimsFrameRecord &frame_record : m_mapFramesRecord)
{
if(frame_record.mz_calibration_id != 0)
{
timeline.push_back(frame_record.frame_time);
}
}
return timeline;
}
TimsDataFastMap &
TimsData::getRawMsBySpectrumIndex(std::size_t index)
{
return getScanByGlobalScanIndex(index);
}
TimsDataFastMap &
TimsData::getScanByGlobalScanIndex(std::size_t index)
{
qDebug() << " spectrum_index=" << index;
auto coordinate = getScanCoordinatesByGlobalScanIndex(index);
TimsFrameBaseCstSPtr tims_frame;
tims_frame = getTimsFrameCstSPtrCached(coordinate.first);
TimsDataFastMap &raw_spectrum = TimsDataFastMap::getTimsDataFastMapInstance();
raw_spectrum.clear();
tims_frame.get()->combineScansInTofIndexIntensityMap(
raw_spectrum, coordinate.second, coordinate.second);
return raw_spectrum;
}
const std::vector<FrameIdDescr> &
TimsData::getFrameIdDescrList() const
{
return m_frameIdDescrList;
}
const std::vector<TimsFrameRecord> &
TimsData::getTimsFrameRecordList() const
{
return m_mapFramesRecord;
}
const QDir &
TimsData::getTimsDataDirectory() const
{
return m_timsDataDirectory;
}
TimsDdaPrecursors *
TimsData::getTimsDdaPrecursorsPtr() const
{
if(mpa_timsDdaPrecursors == nullptr)
{
throw pappso::PappsoException("TimsData does not contain DDA precursors");
}
return mpa_timsDdaPrecursors;
}
TimsBinDec *
TimsData::getTimsBinDecPtr() const
{
return mpa_timsBinDec;
}
bool
TimsData::isDdaRun() const
{
if(mpa_timsDdaPrecursors == nullptr)
return false;
return true;
}
bool
pappso::TimsData::isDiaRun() const
{
if(mpa_timsDiaSlices == nullptr)
return false;
return true;
}
TimsDiaSlices *
TimsData::getTimsDiaSlicesPtr() const
{
qDebug();
if(mpa_timsDiaSlices == nullptr)
{
throw pappso::PappsoException("TimsData does not contain DIA slices");
}
return mpa_timsDiaSlices;
}
} // namespace pappso
pappso::ExceptionNotFound
Definition exceptionnotfound.h:32
pappso::MapTrace
Definition maptrace.h:34
pappso::MapTrace::toTrace
Trace toTrace() const
Definition maptrace.cpp:219
pappso::MassSpectrumId
Definition massspectrumid.h:40
pappso::MassSpectrumId::setNativeId
void setNativeId(const QString &native_id)
Definition massspectrumid.cpp:92
pappso::MassSpectrumId::setMsRunId
void setMsRunId(MsRunIdCstSPtr other)
Definition massspectrumid.cpp:77
pappso::MassSpectrumId::setSpectrumIndex
void setSpectrumIndex(std::size_t index)
Definition massspectrumid.cpp:106
pappso::MzCalibrationStore
Definition mzcalibrationstore.h:40
pappso::MzCalibrationStore::getInstance
MzCalibrationInterfaceSPtr getInstance(double T1_frame, double T2_frame, const QSqlRecord &mzcalibration_record)
Definition mzcalibrationstore.cpp:46
pappso::PappsoException
Definition pappsoexception.h:42
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition pappsoexception.h:68
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition qualifiedmassspectrum.h:99
pappso::QualifiedMassSpectrum::setPrecursorNativeId
void setPrecursorNativeId(const QString &native_id)
Set the scan native id of the precursor ion.
Definition qualifiedmassspectrum.cpp:443
pappso::QualifiedMassSpectrum::setDtInMilliSeconds
void setDtInMilliSeconds(pappso_double rt)
Set the drift time in milliseconds.
Definition qualifiedmassspectrum.cpp:224
pappso::QualifiedMassSpectrum::appendPrecursorIonData
void appendPrecursorIonData(const PrecursorIonData &precursor_ion_data)
Definition qualifiedmassspectrum.cpp:456
pappso::QualifiedMassSpectrum::setMassSpectrumId
void setMassSpectrumId(const MassSpectrumId &iD)
Set the MassSpectrumId.
Definition qualifiedmassspectrum.cpp:149
pappso::QualifiedMassSpectrum::setMsLevel
void setMsLevel(uint ms_level)
Set the mass spectrum level.
Definition qualifiedmassspectrum.cpp:184
pappso::QualifiedMassSpectrum::setPrecursorSpectrumIndex
void setPrecursorSpectrumIndex(std::size_t precursor_scan_num)
Set the scan number of the precursor ion.
Definition qualifiedmassspectrum.cpp:426
pappso::QualifiedMassSpectrum::setParameterValue
void setParameterValue(QualifiedMassSpectrumParameter parameter, const QVariant &value)
Definition qualifiedmassspectrum.cpp:487
pappso::QualifiedMassSpectrum::size
std::size_t size() const
Definition qualifiedmassspectrum.cpp:518
pappso::QualifiedMassSpectrum::setMassSpectrumSPtr
void setMassSpectrumSPtr(MassSpectrumSPtr massSpectrum)
Set the MassSpectrumSPtr.
Definition qualifiedmassspectrum.cpp:125
pappso::QualifiedMassSpectrum::setRtInSeconds
void setRtInSeconds(pappso_double rt)
Set the retention time in seconds.
Definition qualifiedmassspectrum.cpp:200
pappso::QualifiedMassSpectrum::setEmptyMassSpectrum
void setEmptyMassSpectrum(bool is_empty_mass_spectrum)
Definition qualifiedmassspectrum.cpp:169
pappso::TimsBinDec
Definition timsbindec.h:45
pappso::TimsBinDec::getTimsFrameSPtrByOffset
TimsFrameSPtr getTimsFrameSPtrByOffset(std::size_t frameId, const std::vector< pappso::TimsFrameRecord > &frame_record_list)
Definition timsbindec.cpp:147
pappso::TimsDataFastMap
replacement for std::map
Definition timsdatafastmap.h:46
pappso::TimsDataFastMap::getTimsDataFastMapInstance
static TimsDataFastMap & getTimsDataFastMapInstance()
Definition timsdatafastmap.cpp:41
pappso::TimsDataFastMap::clear
void clear()
Definition timsdatafastmap.cpp:204
pappso::TimsData
Definition timsdata.h:70
pappso::TimsData::getGlobalScanIndexByScanCoordinates
std::size_t getGlobalScanIndexByScanCoordinates(std::size_t frame_id, std::size_t index) const
Definition timsdata.cpp:381
pappso::TimsData::openDatabaseConnection
QSqlDatabase openDatabaseConnection() const
Definition timsdata.cpp:231
pappso::TimsData::getTotalScanCount
std::size_t getTotalScanCount() const
Definition timsdata.cpp:700
pappso::TimsData::getTimsDiaSlicesPtr
TimsDiaSlices * getTimsDiaSlicesPtr() const
Definition timsdata.cpp:1124
pappso::TimsData::getTimsFrameCstSPtr
TimsFrameCstSPtr getTimsFrameCstSPtr(std::size_t timsId)
get a Tims frame with his database ID
Definition timsdata.cpp:579
pappso::TimsData::mpa_timsDdaPrecursors
TimsDdaPrecursors * mpa_timsDdaPrecursors
Definition timsdata.h:255
pappso::TimsData::getTimsFrameRecordList
const std::vector< TimsFrameRecord > & getTimsFrameRecordList() const
Definition timsdata.cpp:1080
pappso::TimsData::m_frameIdDescrList
std::vector< FrameIdDescr > m_frameIdDescrList
store every frame id and corresponding sizes
Definition timsdata.h:274
pappso::TimsData::getTimsFrameCstSPtrCached
TimsFrameCstSPtr getTimsFrameCstSPtrCached(std::size_t timsId)
get a Tims frame with his database ID but look in the cache first
Definition timsdata.cpp:953
pappso::TimsData::getMassSpectrumCstSPtrByRawIndex
pappso::MassSpectrumCstSPtr getMassSpectrumCstSPtrByRawIndex(std::size_t raw_index)
get a mass spectrum given its spectrum index
Definition timsdata.cpp:404
pappso::TimsData::getScanByGlobalScanIndex
TimsDataFastMap & getScanByGlobalScanIndex(std::size_t index)
Definition timsdata.cpp:1059
pappso::TimsData::TimsDdaPrecursors
friend TimsDdaPrecursors
Definition timsdata.h:71
pappso::TimsData::~TimsData
virtual ~TimsData()
Definition timsdata.cpp:266
pappso::TimsData::getFrameIdDescrList
const std::vector< FrameIdDescr > & getFrameIdDescrList() const
Definition timsdata.cpp:1074
pappso::TimsData::getTotalNumberOfFrames
std::size_t getTotalNumberOfFrames() const
Get total number of frames.
Definition timsdata.cpp:679
pappso::TimsData::getTimsMS1FrameIdsInRtRange
std::vector< std::size_t > getTimsMS1FrameIdsInRtRange(double rt_begin, double rt_end) const
Definition timsdata.cpp:504
pappso::TimsData::getMassSpectrumCstSPtr
pappso::MassSpectrumCstSPtr getMassSpectrumCstSPtr(std::size_t timsId, std::size_t scanNum)
get a mass spectrum given the tims frame database id and scan number within tims frame
Definition timsdata.cpp:669
pappso::TimsData::getTimsBinDecPtr
TimsBinDec * getTimsBinDecPtr() const
Definition timsdata.cpp:1102
pappso::TimsData::TimsData
TimsData(QDir timsDataDirectory)
build using the tims data directory
Definition timsdata.cpp:46
pappso::TimsData::getQualifiedMassSpectrumByRawIndex
void getQualifiedMassSpectrumByRawIndex(const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, std::size_t global_scan_index, bool want_binary_data)
Definition timsdata.cpp:722
pappso::TimsData::getTimsMS2FrameIdsInRtRange
std::vector< std::size_t > getTimsMS2FrameIdsInRtRange(double rt_begin, double rt_end) const
Definition timsdata.cpp:541
pappso::TimsData::getTicChromatogram
Trace getTicChromatogram() const
Definition timsdata.cpp:848
pappso::TimsData::getTimsFrameBaseCstSPtrCached
TimsFrameBaseCstSPtr getTimsFrameBaseCstSPtrCached(std::size_t timsId)
Definition timsdata.cpp:932
pappso::TimsData::getQualifiedMassSpectrumByGlobalScanIndex
void getQualifiedMassSpectrumByGlobalScanIndex(const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, std::size_t global_scan_index, bool want_binary_data)
Definition timsdata.cpp:734
pappso::TimsData::m_timsFrameCache
std::deque< TimsFrameCstSPtr > m_timsFrameCache
Definition timsdata.h:261
pappso::TimsData::m_cacheSize
std::size_t m_cacheSize
Definition timsdata.h:260
pappso::TimsData::getScanCoordinateFromRawIndex
std::pair< std::size_t, std::size_t > getScanCoordinateFromRawIndex(std::size_t spectrum_index) const
Definition timsdata.cpp:333
pappso::TimsData::m_mapFramesRecord
std::vector< TimsFrameRecord > m_mapFramesRecord
Definition timsdata.h:267
pappso::TimsData::getMsLevelBySpectrumIndex
unsigned int getMsLevelBySpectrumIndex(std::size_t index)
Definition timsdata.cpp:706
pappso::TimsData::m_totalScanCount
std::size_t m_totalScanCount
Definition timsdata.h:258
pappso::TimsData::m_mapMzCalibrationRecord
std::map< int, QSqlRecord > m_mapMzCalibrationRecord
Definition timsdata.h:265
pappso::TimsData::m_mapTimsCalibrationRecord
std::map< int, QSqlRecord > m_mapTimsCalibrationRecord
Definition timsdata.h:266
pappso::TimsData::m_mutex
QMutex m_mutex
Definition timsdata.h:288
pappso::TimsData::fillFrameIdDescrList
void fillFrameIdDescrList()
private function to fill m_frameIdDescrList
Definition timsdata.cpp:288
pappso::TimsData::getTimsFrameBaseCstSPtr
TimsFrameBaseCstSPtr getTimsFrameBaseCstSPtr(std::size_t timsId)
get a Tims frame base (no binary data file access) with his database ID
Definition timsdata.cpp:430
pappso::TimsData::getMsLevelByGlobalScanIndex
unsigned int getMsLevelByGlobalScanIndex(std::size_t index)
Definition timsdata.cpp:713
pappso::TimsData::TimsDiaSlices
friend TimsDiaSlices
Definition timsdata.h:72
pappso::TimsData::m_timsDataDirectory
QDir m_timsDataDirectory
Definition timsdata.h:252
pappso::TimsData::mpa_mzCalibrationStore
MzCalibrationStore * mpa_mzCalibrationStore
Definition timsdata.h:269
pappso::TimsData::getMassSpectrumCstSPtrByGlobalScanIndex
pappso::MassSpectrumCstSPtr getMassSpectrumCstSPtrByGlobalScanIndex(std::size_t index)
Definition timsdata.cpp:410
pappso::TimsData::getRetentionTimeLineInSeconds
virtual std::vector< double > getRetentionTimeLineInSeconds() const
Definition timsdata.cpp:1037
pappso::TimsData::getRetentionTimeLine
virtual std::vector< double > getRetentionTimeLine() const
retention timeline get retention times along the MSrun in seconds
Definition timsdata.cpp:1031
pappso::TimsData::getTimsDataDirectory
const QDir & getTimsDataDirectory() const
Definition timsdata.cpp:1086
pappso::TimsData::getRawMsBySpectrumIndex
TimsDataFastMap & getRawMsBySpectrumIndex(std::size_t index)
get raw signal for a spectrum index only to use to see the raw signal
Definition timsdata.cpp:1053
pappso::TimsData::getFrameCount
std::size_t getFrameCount() const
Definition timsdata.cpp:686
pappso::TimsData::isDiaRun
bool isDiaRun() const
tells if this MS run is a DIA run
Definition timsdata.cpp:1116
pappso::TimsData::m_timsFrameBaseCache
std::deque< TimsFrameBaseCstSPtr > m_timsFrameBaseCache
Definition timsdata.h:262
pappso::TimsData::m_thousandIndexToFrameIdDescrListIndex
std::map< std::size_t, std::size_t > m_thousandIndexToFrameIdDescrListIndex
index to find quickly a frameId in the description list with the raw index of spectrum modulo 1000 @k...
Definition timsdata.h:281
pappso::TimsData::mpa_timsBinDec
TimsBinDec * mpa_timsBinDec
Definition timsdata.h:253
pappso::TimsData::isDdaRun
bool isDdaRun() const
tells if this MS run is a DDA run
Definition timsdata.cpp:1108
pappso::TimsData::getTotalNumberOfScans
std::size_t getTotalNumberOfScans() const
get the total number of scans
Definition timsdata.cpp:693
pappso::TimsData::getTimsDdaPrecursorsPtr
TimsDdaPrecursors * getTimsDdaPrecursorsPtr() const
Definition timsdata.cpp:1092
pappso::TimsData::mpa_timsDiaSlices
TimsDiaSlices * mpa_timsDiaSlices
Definition timsdata.h:256
pappso::TimsData::m_frameCount
std::size_t m_frameCount
Definition timsdata.h:259
pappso::TimsData::getRawIndexFromCoordinate
std::size_t getRawIndexFromCoordinate(std::size_t frame_id, std::size_t scan_num) const
Definition timsdata.cpp:373
pappso::TimsData::getScanCoordinatesByGlobalScanIndex
std::pair< std::size_t, std::size_t > getScanCoordinatesByGlobalScanIndex(std::size_t index) const
Definition timsdata.cpp:339
pappso::TimsDdaPrecursors
Definition timsddaprecursors.h:36
pappso::TimsDdaPrecursors::getSpectrumDescrWithScanCoordinates
SpectrumDescr getSpectrumDescrWithScanCoordinates(const std::pair< std::size_t, std::size_t > &scan_coordinates)
Definition timsddaprecursors.cpp:501
pappso::TimsDiaSlices
Definition timsdiaslices.h:37
pappso::TimsFrameBase
Definition timsframebase.h:49
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:148
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::TimsFrameBaseCstSPtr
std::shared_ptr< const TimsFrameBase > TimsFrameBaseCstSPtr
Definition timsframebase.h:42
pappso::TimsFrameSPtr
std::shared_ptr< TimsFrame > TimsFrameSPtr
Definition timsframe.h:42
pappso::PrecisionUnit::res
@ res
pappso::TimsFrameBaseSPtr
std::shared_ptr< TimsFrameBase > TimsFrameBaseSPtr
Definition timsframebase.h:41
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition massspectrum.h:57
pappso::QualifiedMassSpectrumParameter::IsolationMzWidth
@ IsolationMzWidth
m/z isolation window width (left + right)
pappso::QualifiedMassSpectrumParameter::CollisionEnergy
@ CollisionEnergy
Bruker's timsTOF collision energy.
pappso::QualifiedMassSpectrumParameter::IsolationMz
@ IsolationMz
Isolation m/z value.
pappso::QualifiedMassSpectrumParameter::BrukerPrecursorIndex
@ BrukerPrecursorIndex
Bruker's timsTOF precursor index.
pappso::QualifiedMassSpectrumParameter::IonMobOneOverK0
@ IonMobOneOverK0
1/kO value
pappso::DataKind::rt
@ rt
Retention time.
pappso::TimsFrameCstSPtr
std::shared_ptr< const TimsFrame > TimsFrameCstSPtr
Definition timsframe.h:43
pappso::TimsFrameRecord
Definition timsframerecord.h:35
pappso::TimsFrameRecord::accumulation_time
double accumulation_time
Definition timsframerecord.h:38
pappso::TimsFrameRecord::frame_t2
double frame_t2
Definition timsframerecord.h:41
pappso::TimsFrameRecord::frame_t1
double frame_t1
Definition timsframerecord.h:40
pappso::TimsFrameRecord::frame_id
std::size_t frame_id
Definition timsframerecord.h:36
pappso::TimsFrameRecord::msms_type
int msms_type
Definition timsframerecord.h:43
pappso::TimsFrameRecord::frame_time
double frame_time
Definition timsframerecord.h:42
pappso::TimsFrameRecord::mz_calibration_id
std::size_t mz_calibration_id
Definition timsframerecord.h:39
pappso::TimsFrameRecord::tims_offset
std::size_t tims_offset
Definition timsframerecord.h:37
pappso::TimsFrameRecord::tims_calibration_id
std::size_t tims_calibration_id
Definition timsframerecord.h:44
timsdata.h
main Tims data handler
timsddaprecursors.h
handle specific data for DDA MS runs
timsdiaslices.h
handle specific data for DIA MS runs