Loading...
Searching...
No Matches
timsdiaslices.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/vendors/tims/timsdiaslices.cpp
* \date 02/07/2024
* \brief handle specific data for DIA MS runs
*/
/*******************************************************************************
* Copyright (c) 2024 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 "timsdiaslices.h"
#include "pappsomspp/core/exception/exceptionnotfound.h"
#include <iterator>
#include <QSqlError>
namespace pappso
{
bool
TimsDiaSlices::MsMsWindow::isMzInRange(double mz) const
{
double half_window = IsolationWidth / 2;
if(mz < (IsolationMz - half_window))
return false;
if(mz > (IsolationMz + half_window))
return false;
return true;
}
TimsDiaSlices::MsMsWindowGroupList::~MsMsWindowGroupList()
{
for(MsMsWindowGroup *p_group : *this)
{
delete p_group;
}
}
void
TimsDiaSlices::MsMsWindowGroupList::addInGroup(const MsMsWindow &window)
{
std::size_t group_id = window.WindowGroup;
auto it_in_list = std::find_if(begin(), end(), [group_id](const MsMsWindowGroup *group) {
if(group->WindowGroup == group_id)
return true;
return false;
});
if(it_in_list == end())
{
qDebug();
MsMsWindowGroup *new_group = new MsMsWindowGroup();
new_group->WindowGroup = group_id;
new_group->push_back(window);
push_back(new_group);
}
else
{
qDebug();
(*it_in_list)->push_back(window);
std::sort(
(*it_in_list)->begin(), (*it_in_list)->end(), [](const MsMsWindow &a, const MsMsWindow &b) {
return (a.ScanNumBegin < b.ScanNumBegin);
});
std::size_t i = 0;
for(MsMsWindow &window : *(*it_in_list))
{
window.SliceIndex = i;
i++;
}
}
qDebug();
}
TimsDiaSlices::MsMsWindowGroup *
TimsDiaSlices::MsMsWindowGroupList::getWindowGroupPtrByGroupId(std::size_t window_group_id) const
{
auto it_in_list = std::find_if(begin(), end(), [window_group_id](const MsMsWindowGroup *group) {
if(group->WindowGroup == window_group_id)
return true;
return false;
});
if(it_in_list == end())
{
throw pappso::ExceptionNotFound(
QObject::tr("MsMsWindowGroup %1 not found").arg(window_group_id));
}
return *it_in_list;
}
TimsDiaSlices::TimsDiaSlices(QSqlQuery &query, TimsData *tims_data_origin)
: mp_timsDataOrigin(tims_data_origin)
{
/*
CREATE TABLE IF NOT EXISTS "DiaFrameMsMsWindows" (
"WindowGroup" INTEGER NOT NULL,
"ScanNumBegin" INTEGER NOT NULL,
"ScanNumEnd" INTEGER NOT NULL,
"IsolationMz" REAL NOT NULL,
"IsolationWidth" REAL NOT NULL,
"CollisionEnergy" REAL NOT NULL,
FOREIGN KEY("WindowGroup") REFERENCES "FrameMsMsWindowGroups"("Id"),
PRIMARY KEY("WindowGroup","ScanNumBegin")
) WITHOUT ROWID;
*/
if(!query.exec("SELECT WindowGroup, ScanNumBegin, ScanNumEnd, IsolationMz, "
"IsolationWidth, CollisionEnergy FROM DiaFrameMsMsWindows;"))
{
qDebug();
throw ExceptionNotFound(QObject::tr("ERROR : executing %1 :\n%2")
.arg(query.lastQuery())
.arg(query.lastError().text()));
}
else
{
qDebug() << query.size();
if(query.size() == 0)
{
qDebug();
// FIXME: this exception is thrown, but my file is DDA.
// That's not a nice info...
throw ExceptionNotFound(
QObject::tr("ERROR : DiaFrameMsMsWindows table is empty in SqlLite database"));
}
MsMsWindow msms_window;
while(query.next())
{
qDebug();
msms_window.WindowGroup = query.value(0).toLongLong();
msms_window.ScanNumBegin = query.value(1).toLongLong();
msms_window.ScanNumEnd = query.value(2).toLongLong();
msms_window.IsolationMz = query.value(3).toDouble();
msms_window.IsolationWidth = query.value(4).toDouble();
msms_window.CollisionEnergy = query.value(5).toDouble();
qDebug();
m_msMsWindowGroupList.addInGroup(msms_window);
}
if(m_msMsWindowGroupList.size() == 0)
{
qDebug();
// FIXME: this exception is thrown, but my file is DDA.
// That's not a nice info...
throw ExceptionNotFound(
QObject::tr("ERROR : no DiaFrameMsMsWindows in SqlLite database"));
}
}
qDebug();
std::size_t max_frame_id = 0;
if(!query.exec("SELECT Frame, WindowGroup FROM DiaFrameMsMsInfo;"))
{
qDebug();
throw pappso::ExceptionNotFound(
QObject::tr("ERROR : no DiaFrameMsMsInfo in SqlLite database"));
}
else
{
qDebug() << query.size();
if(query.size() == 0)
{
qDebug();
throw pappso::ExceptionNotFound(
QObject::tr("ERROR : no DiaFrameMsMsInfo in SqlLite database"));
}
while(query.next())
{
qDebug();
max_frame_id = query.value(0).toLongLong();
m_mapFrame2WindowGroupPtr[query.value(0).toLongLong()] =
m_msMsWindowGroupList.getWindowGroupPtrByGroupId(query.value(1).toLongLong());
}
if(m_mapFrame2WindowGroupPtr.size() == 0)
{
qDebug();
throw ExceptionNotFound(QObject::tr("ERROR : no DiaFrameMsMsInfo in SqlLite database"));
}
}
qDebug();
m_frameId2GlobalSliceIndexBegin.resize(max_frame_id + 1);
m_ms2frameId2Ms1FrameId.resize(max_frame_id + 1);
std::size_t last_ms1 = 0;
std::size_t previous_frame = 0;
std::size_t cumul_global_slice = 0;
m_ms1frameIdList.clear();
for(const std::pair<std::size_t, MsMsWindowGroup *> pair_frame_pgroup : m_mapFrame2WindowGroupPtr)
{
if(previous_frame != pair_frame_pgroup.first - 1)
{
last_ms1 = previous_frame + 1;
m_ms1frameIdList.push_back(last_ms1);
}
previous_frame = pair_frame_pgroup.first;
qDebug() << pair_frame_pgroup.first << " " << m_frameId2GlobalSliceIndexBegin.size();
FrameSliceRange slice_range;
qDebug() << pair_frame_pgroup.first;
slice_range.frame_id = pair_frame_pgroup.first;
slice_range.begin_global_slice_index = cumul_global_slice;
m_frameId2GlobalSliceIndexBegin[pair_frame_pgroup.first] = cumul_global_slice;
m_ms2frameId2Ms1FrameId[pair_frame_pgroup.first] = last_ms1;
cumul_global_slice += pair_frame_pgroup.second->size();
if(cumul_global_slice > 0)
slice_range.end_global_slice_index = cumul_global_slice - 1;
m_frameSliceRangeList.push_back(slice_range);
}
qDebug();
m_totalSlicesCount = cumul_global_slice;
}
TimsDiaSlices::~TimsDiaSlices()
{
}
const std::map<std::size_t, TimsDiaSlices::MsMsWindowGroup *> &
TimsDiaSlices::getMapFrame2WindowGroupPtr() const
{
return m_mapFrame2WindowGroupPtr;
}
const TimsDiaSlices::MsMsWindowGroupList &
TimsDiaSlices::getMsMsWindowGroupList() const
{
return m_msMsWindowGroupList;
}
std::size_t
TimsDiaSlices::getGlobalSliceIndexBeginByFrameId(std::size_t frame_id) const
{
return (m_frameId2GlobalSliceIndexBegin[frame_id]);
}
std::size_t
TimsDiaSlices::getFrameIdByGlobalSliceIndex(std::size_t global_slice_id) const
{
return (getFrameSliceRangeByGlobalSliceIndex(global_slice_id).frame_id);
}
const TimsDiaSlices::FrameSliceRange &
TimsDiaSlices::getFrameSliceRangeByGlobalSliceIndex(std::size_t global_slice_index) const
{
qDebug();
auto it = std::find_if(m_frameSliceRangeList.cbegin(),
m_frameSliceRangeList.cend(),
[global_slice_index](const FrameSliceRange &x) {
if(global_slice_index < x.begin_global_slice_index)
return false;
if(global_slice_index > x.end_global_slice_index)
return false;
return true;
});
if(it != m_frameSliceRangeList.cend())
{
return *it;
}
qDebug();
throw ExceptionNotFound(
QObject::tr("ERROR : GlobalSliceIndex %1 not found").arg(global_slice_index));
}
std::size_t
TimsDiaSlices::getTotalSlicesCount() const
{
return m_totalSlicesCount;
}
const TimsDiaSlices::MsMsWindow &
TimsDiaSlices::getMsMsWindowByGlobalSliceIndex(std::size_t global_slice_index) const
{
qDebug() << global_slice_index;
const TimsDiaSlices::FrameSliceRange &range =
getFrameSliceRangeByGlobalSliceIndex(global_slice_index);
qDebug() << "range.frame_id=" << range.frame_id
<< " range.begin_global_slice_index=" << range.begin_global_slice_index;
return m_mapFrame2WindowGroupPtr.at(range.frame_id)
->at(global_slice_index - range.begin_global_slice_index);
}
std::size_t
TimsDiaSlices::getLastMs1FrameIdByMs2FrameId(std::size_t frame_id) const
{
return m_ms2frameId2Ms1FrameId.at(frame_id);
}
TimsDataFastMap &
TimsDiaSlices::getCombinedMs2ScansByGlobalSliceIndex(std::size_t global_slice_index) const
{
qDebug();
TimsDataFastMap &raw_spectrum = TimsDataFastMap::getTimsDataFastMapInstance();
raw_spectrum.clear();
try
{
FrameSliceRange range = getFrameSliceRangeByGlobalSliceIndex(global_slice_index);
MsMsWindow window = m_mapFrame2WindowGroupPtr.at(range.frame_id)
->at(global_slice_index - range.begin_global_slice_index);
qDebug();
TimsFrameCstSPtr tims_frame;
tims_frame = mp_timsDataOrigin->getTimsFrameCstSPtrCached(range.frame_id);
qDebug();
/*combiner.combine(combiner_result,
tims_frame.get()->cumulateScanToTrace(
scan_mobility_start, scan_mobility_end));*/
tims_frame.get()->combineScansInTofIndexIntensityMap(
raw_spectrum, window.ScanNumBegin, window.ScanNumEnd);
qDebug();
}
catch(PappsoException &error)
{
throw PappsoException(QObject::tr("ERROR in %1 (global_slice_index=%2):\n%3")
.arg(__FUNCTION__)
.arg(global_slice_index)
.arg(error.qwhat()));
}
catch(std::exception &error)
{
qDebug() << QString("Failure %1 ").arg(error.what());
}
return raw_spectrum;
qDebug();
}
void
TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex(const MsRunIdCstSPtr &msrun_id,
QualifiedMassSpectrum &mass_spectrum,
std::size_t global_slice_index,
bool want_binary_data) const
{
qDebug();
try
{
FrameSliceRange range = getFrameSliceRangeByGlobalSliceIndex(global_slice_index);
MsMsWindow window = m_mapFrame2WindowGroupPtr.at(range.frame_id)
->at(global_slice_index - range.begin_global_slice_index);
MassSpectrumId spectrum_id;
spectrum_id.setSpectrumIndex(global_slice_index);
spectrum_id.setNativeId(
QString("global_slice_index=%1 frame=%2 begin=%3 end=%4 group=%5 slice=%6")
.arg(global_slice_index)
.arg(range.frame_id)
.arg(window.ScanNumBegin)
.arg(window.ScanNumEnd)
.arg(window.WindowGroup)
.arg(window.SliceIndex));
spectrum_id.setMsRunId(msrun_id);
mass_spectrum.setMassSpectrumId(spectrum_id);
mass_spectrum.setMsLevel(2);
// mass_spectrum.setPrecursorSpectrumIndex(spectrum_descr.ms1_index);
mass_spectrum.setEmptyMassSpectrum(true);
qDebug();
// get precursor ion data
// mass_spectrum.appendPrecursorIonData(spectrum_descr.precursor_ion_data);
mass_spectrum.setPrecursorNativeId(QString("frame_id=%1 begin=%2 end=%3 group=%4 slice=%5")
.arg(m_ms2frameId2Ms1FrameId.at(range.frame_id))
.arg(window.ScanNumBegin)
.arg(window.ScanNumEnd)
.arg(window.WindowGroup)
.arg(window.SliceIndex));
mass_spectrum.setParameterValue(QualifiedMassSpectrumParameter::IsolationMz,
window.IsolationMz);
mass_spectrum.setParameterValue(QualifiedMassSpectrumParameter::IsolationMzWidth,
window.IsolationWidth);
mass_spectrum.setParameterValue(QualifiedMassSpectrumParameter::CollisionEnergy,
window.CollisionEnergy);
qDebug() << window.ScanNumBegin;
mass_spectrum.setParameterValue(QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexBegin,
(qulonglong)window.ScanNumBegin);
qDebug() << window.ScanNumEnd;
mass_spectrum.setParameterValue(QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexEnd,
(qulonglong)window.ScanNumEnd);
qDebug();
TimsFrameBaseCstSPtr tims_frame;
if(want_binary_data)
{
qDebug() << "bindec";
tims_frame = mp_timsDataOrigin->getTimsFrameCstSPtrCached(range.frame_id);
}
else
{
tims_frame = mp_timsDataOrigin->getTimsFrameBaseCstSPtrCached(range.frame_id);
}
mass_spectrum.setRtInSeconds(tims_frame.get()->getRtInSeconds());
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::IonMobOneOverK0Begin,
tims_frame.get()->getOneOverK0Transformation(window.ScanNumBegin));
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::IonMobOneOverK0End,
tims_frame.get()->getOneOverK0Transformation(window.ScanNumEnd));
qDebug();
/*combiner.combine(combiner_result,
tims_frame.get()->cumulateScanToTrace(
scan_mobility_start, scan_mobility_end));*/
if(want_binary_data)
{
TimsDataFastMap &raw_spectrum = TimsDataFastMap::getTimsDataFastMapInstance();
raw_spectrum.clear();
tims_frame.get()->combineScansInTofIndexIntensityMap(
raw_spectrum, window.ScanNumBegin, window.ScanNumEnd);
Trace trace;
if(m_builtinMs2Centroid)
{
// raw_spectrum.removeArtefactualSpike();
raw_spectrum.builtInCentroid();
}
trace = tims_frame.get()->getTraceFromTofIndexIntensityMap(raw_spectrum);
if(trace.size() > 0)
{
mass_spectrum.setMassSpectrumSPtr(MassSpectrum(trace).makeMassSpectrumSPtr());
mass_spectrum.setEmptyMassSpectrum(false);
}
else
{
mass_spectrum.setMassSpectrumSPtr(nullptr);
mass_spectrum.setEmptyMassSpectrum(true);
}
}
qDebug();
}
catch(PappsoException &error)
{
throw PappsoException(QObject::tr("ERROR in %1 (global_slice_index=%2):\n%3")
.arg(__FUNCTION__)
.arg(global_slice_index)
.arg(error.qwhat()));
}
catch(std::exception &error)
{
qDebug() << QString("Failure %1 ").arg(error.what());
}
qDebug();
}
void
TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex(const MsRunIdCstSPtr &msrun_id,
QualifiedMassSpectrum &mass_spectrum,
std::size_t global_slice_index,
bool want_binary_data,
int rt_position) const
{
qDebug();
try
{
FrameSliceRange range = getFrameSliceRangeByGlobalSliceIndex(global_slice_index);
MsMsWindow window = m_mapFrame2WindowGroupPtr.at(range.frame_id)
->at(global_slice_index - range.begin_global_slice_index);
std::size_t ms1_frame_id = getLastMs1FrameIdByMs2FrameId(range.frame_id);
if(rt_position != 0)
{
std::size_t i = 0;
for(i = 0; i < m_ms1frameIdList.size(); i++)
{
if(m_ms1frameIdList.at(i) == ms1_frame_id)
break;
}
long index = (long)i + rt_position;
if((index > -1) && (index < (long)m_ms1frameIdList.size()))
ms1_frame_id = m_ms1frameIdList.at(index);
}
MassSpectrumId spectrum_id;
spectrum_id.setSpectrumIndex(global_slice_index);
spectrum_id.setNativeId(
QString("global_slice_index=%1 frame=%2 begin=%3 end=%4 group=%5 slice=%6")
.arg(global_slice_index)
.arg(ms1_frame_id)
.arg(window.ScanNumBegin)
.arg(window.ScanNumEnd)
.arg(window.WindowGroup)
.arg(window.SliceIndex));
spectrum_id.setMsRunId(msrun_id);
mass_spectrum.setMassSpectrumId(spectrum_id);
mass_spectrum.setMsLevel(1);
// mass_spectrum.setPrecursorSpectrumIndex(spectrum_descr.ms1_index);
mass_spectrum.setEmptyMassSpectrum(true);
qDebug();
// get precursor ion data
// mass_spectrum.appendPrecursorIonData(spectrum_descr.precursor_ion_data);
qDebug() << window.ScanNumBegin;
mass_spectrum.setParameterValue(QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexBegin,
(qulonglong)window.ScanNumBegin);
qDebug() << window.ScanNumEnd;
mass_spectrum.setParameterValue(QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexEnd,
(qulonglong)window.ScanNumEnd);
qDebug();
TimsFrameBaseCstSPtr tims_frame;
if(want_binary_data)
{
qDebug() << "bindec";
tims_frame = mp_timsDataOrigin->getTimsFrameCstSPtrCached(ms1_frame_id);
}
else
{
tims_frame = mp_timsDataOrigin->getTimsFrameBaseCstSPtrCached(ms1_frame_id);
}
mass_spectrum.setRtInSeconds(tims_frame.get()->getRtInSeconds());
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::IonMobOneOverK0Begin,
tims_frame.get()->getOneOverK0Transformation(window.ScanNumBegin));
mass_spectrum.setParameterValue(
QualifiedMassSpectrumParameter::IonMobOneOverK0End,
tims_frame.get()->getOneOverK0Transformation(window.ScanNumEnd));
qDebug();
/*combiner.combine(combiner_result,
tims_frame.get()->cumulateScanToTrace(
scan_mobility_start, scan_mobility_end));*/
if(want_binary_data)
{
double mz = (window.IsolationMz - (window.IsolationWidth / 2));
qDebug() << mz;
quint32 tof_index_begin =
tims_frame.get()->getMzCalibrationInterfaceSPtr().get()->getTofIndexFromMz(mz);
mz = (window.IsolationMz + (window.IsolationWidth / 2));
qDebug() << mz;
quint32 tof_index_end =
tims_frame.get()->getMzCalibrationInterfaceSPtr().get()->getTofIndexFromMz(mz);
qDebug() << "tof_index_begin=" << tof_index_begin << " tof_index_end=" << tof_index_end;
TimsDataFastMap &raw_spectrum = TimsDataFastMap::getTimsDataFastMapInstance();
raw_spectrum.clear();
tims_frame.get()->combineScansInTofIndexIntensityMap(
raw_spectrum, window.ScanNumBegin, window.ScanNumEnd, tof_index_begin, tof_index_end);
Trace trace;
if(m_builtinMs2Centroid)
{
// raw_spectrum.removeArtefactualSpike();
raw_spectrum.builtInCentroid();
}
trace = tims_frame.get()->getTraceFromTofIndexIntensityMap(raw_spectrum);
if(trace.size() > 0)
{
mass_spectrum.setMassSpectrumSPtr(MassSpectrum(trace).makeMassSpectrumSPtr());
mass_spectrum.setEmptyMassSpectrum(false);
}
else
{
mass_spectrum.setMassSpectrumSPtr(nullptr);
mass_spectrum.setEmptyMassSpectrum(true);
}
}
qDebug();
}
catch(PappsoException &error)
{
throw PappsoException(QObject::tr("ERROR in %1 (global_slice_index=%2):\n%3")
.arg(__FUNCTION__)
.arg(global_slice_index)
.arg(error.qwhat()));
}
catch(std::exception &error)
{
qDebug() << QString("Failure %1 ").arg(error.what());
}
qDebug();
}
} // namespace pappso
pappso::ExceptionNotFound
Definition exceptionnotfound.h:32
pappso::MassSpectrumId
Definition massspectrumid.h:41
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::MassSpectrum
Class to represent a mass spectrum.
Definition massspectrum.h:70
pappso::PappsoException
Definition pappsoexception.h:41
pappso::PappsoException::what
const char * what() const noexcept override
Definition pappsoexception.h:72
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition pappsoexception.h:66
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:430
pappso::QualifiedMassSpectrum::setMassSpectrumId
void setMassSpectrumId(const MassSpectrumId &iD)
Set the MassSpectrumId.
Definition qualifiedmassspectrum.cpp:146
pappso::QualifiedMassSpectrum::setMsLevel
void setMsLevel(uint ms_level)
Set the mass spectrum level.
Definition qualifiedmassspectrum.cpp:181
pappso::QualifiedMassSpectrum::setParameterValue
void setParameterValue(QualifiedMassSpectrumParameter parameter, const QVariant &value)
Definition qualifiedmassspectrum.cpp:472
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::QualifiedMassSpectrum::setEmptyMassSpectrum
void setEmptyMassSpectrum(bool is_empty_mass_spectrum)
Definition qualifiedmassspectrum.cpp:166
pappso::TimsDataFastMap
replacement for std::map
Definition timsdatafastmap.h:46
pappso::TimsDataFastMap::builtInCentroid
void builtInCentroid()
simple filter to agregate counts on neigbhor mobility slots (+1)
Definition timsdatafastmap.cpp:117
pappso::TimsDataFastMap::getTimsDataFastMapInstance
static TimsDataFastMap & getTimsDataFastMapInstance()
Definition timsdatafastmap.cpp:40
pappso::TimsDataFastMap::clear
void clear()
Definition timsdatafastmap.cpp:202
pappso::TimsData
Definition timsdata.h:68
pappso::TimsDiaSlices::m_ms2frameId2Ms1FrameId
std::vector< std::size_t > m_ms2frameId2Ms1FrameId
Definition timsdiaslices.h:143
pappso::TimsDiaSlices::getCombinedMs2ScansByGlobalSliceIndex
TimsDataFastMap & getCombinedMs2ScansByGlobalSliceIndex(std::size_t global_slice_index) const
Definition timsdiaslices.cpp:318
pappso::TimsDiaSlices::getGlobalSliceIndexBeginByFrameId
std::size_t getGlobalSliceIndexBeginByFrameId(std::size_t frame_id) const
Definition timsdiaslices.cpp:256
pappso::TimsDiaSlices::getLastMs1FrameIdByMs2FrameId
std::size_t getLastMs1FrameIdByMs2FrameId(std::size_t frame_id) const
Definition timsdiaslices.cpp:310
pappso::TimsDiaSlices::~TimsDiaSlices
~TimsDiaSlices()
Definition timsdiaslices.cpp:240
pappso::TimsDiaSlices::getFrameSliceRangeByGlobalSliceIndex
const FrameSliceRange & getFrameSliceRangeByGlobalSliceIndex(std::size_t global_slice_index) const
Definition timsdiaslices.cpp:267
pappso::TimsDiaSlices::m_msMsWindowGroupList
MsMsWindowGroupList m_msMsWindowGroupList
Definition timsdiaslices.h:140
pappso::TimsDiaSlices::getMsMsWindowByGlobalSliceIndex
const MsMsWindow & getMsMsWindowByGlobalSliceIndex(std::size_t global_slice_index) const
Definition timsdiaslices.cpp:297
pappso::TimsDiaSlices::m_builtinMs2Centroid
bool m_builtinMs2Centroid
enable builtin centroid on raw tims integers by default
Definition timsdiaslices.h:149
pappso::TimsDiaSlices::m_ms1frameIdList
std::vector< std::size_t > m_ms1frameIdList
Definition timsdiaslices.h:144
pappso::TimsDiaSlices::m_mapFrame2WindowGroupPtr
std::map< std::size_t, MsMsWindowGroup * > m_mapFrame2WindowGroupPtr
Definition timsdiaslices.h:141
pappso::TimsDiaSlices::m_totalSlicesCount
std::size_t m_totalSlicesCount
Definition timsdiaslices.h:151
pappso::TimsDiaSlices::getFrameIdByGlobalSliceIndex
std::size_t getFrameIdByGlobalSliceIndex(std::size_t global_slice_id) const
Definition timsdiaslices.cpp:261
pappso::TimsDiaSlices::m_frameId2GlobalSliceIndexBegin
std::vector< std::size_t > m_frameId2GlobalSliceIndexBegin
Definition timsdiaslices.h:142
pappso::TimsDiaSlices::getMs2QualifiedSpectrumByGlobalSliceIndex
void getMs2QualifiedSpectrumByGlobalSliceIndex(const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, std::size_t global_slice_index, bool want_binary_data) const
Definition timsdiaslices.cpp:357
pappso::TimsDiaSlices::getMapFrame2WindowGroupPtr
const std::map< std::size_t, MsMsWindowGroup * > & getMapFrame2WindowGroupPtr() const
Definition timsdiaslices.cpp:245
pappso::TimsDiaSlices::getMs1QualifiedSpectrumByGlobalSliceIndex
void getMs1QualifiedSpectrumByGlobalSliceIndex(const MsRunIdCstSPtr &msrun_id, QualifiedMassSpectrum &mass_spectrum, std::size_t global_slice_index, bool want_binary_data, int rt_position=0) const
get MS1 spectrum corresponding to the given slice extract MS1 mz range and mobility range correspondi...
Definition timsdiaslices.cpp:498
pappso::TimsDiaSlices::TimsDiaSlices
TimsDiaSlices(QSqlQuery &query, TimsData *tims_data_origin)
Definition timsdiaslices.cpp:110
pappso::TimsDiaSlices::m_frameSliceRangeList
std::vector< FrameSliceRange > m_frameSliceRangeList
Definition timsdiaslices.h:145
pappso::TimsDiaSlices::getTotalSlicesCount
std::size_t getTotalSlicesCount() const
get the number of DIA MS2 slices analyzed by PASEF
Definition timsdiaslices.cpp:291
pappso::TimsDiaSlices::getMsMsWindowGroupList
const MsMsWindowGroupList & getMsMsWindowGroupList() const
Definition timsdiaslices.cpp:250
pappso::TimsDiaSlices::mp_timsDataOrigin
TimsData * mp_timsDataOrigin
Definition timsdiaslices.h:139
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:152
exceptionnotfound.h
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:43
pappso::PeptideIonNter::a
@ a
Definition peptide.h:77
pappso::PeptideIonNter::b
@ b
Definition peptide.h:74
pappso::PeptideIonCter::x
@ x
Definition peptide.h:92
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
pappso::QualifiedMassSpectrumParameter::IsolationMzWidth
@ IsolationMzWidth
m/z isolation window width (left + right)
Definition qualifiedmassspectrum.h:59
pappso::QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexBegin
@ TimsFrameIonMobScanIndexBegin
Definition qualifiedmassspectrum.h:55
pappso::QualifiedMassSpectrumParameter::TimsFrameIonMobScanIndexEnd
@ TimsFrameIonMobScanIndexEnd
Definition qualifiedmassspectrum.h:56
pappso::QualifiedMassSpectrumParameter::CollisionEnergy
@ CollisionEnergy
Bruker's timsTOF collision energy.
Definition qualifiedmassspectrum.h:61
pappso::QualifiedMassSpectrumParameter::IonMobOneOverK0Begin
@ IonMobOneOverK0Begin
1/K0 range's begin value
Definition qualifiedmassspectrum.h:51
pappso::QualifiedMassSpectrumParameter::IonMobOneOverK0End
@ IonMobOneOverK0End
1/K0 range's end value
Definition qualifiedmassspectrum.h:52
pappso::QualifiedMassSpectrumParameter::IsolationMz
@ IsolationMz
Isolation m/z value.
Definition qualifiedmassspectrum.h:58
pappso::TimsFrameCstSPtr
std::shared_ptr< const TimsFrame > TimsFrameCstSPtr
Definition timsframe.h:44
pappso::TimsDiaSlices::FrameSliceRange
Definition timsdiaslices.h:129
pappso::TimsDiaSlices::FrameSliceRange::frame_id
std::size_t frame_id
Definition timsdiaslices.h:130
pappso::TimsDiaSlices::FrameSliceRange::begin_global_slice_index
std::size_t begin_global_slice_index
Definition timsdiaslices.h:131
pappso::TimsDiaSlices::MsMsWindowGroupList
Definition timsdiaslices.h:71
pappso::TimsDiaSlices::MsMsWindowGroupList::getWindowGroupPtrByGroupId
MsMsWindowGroup * getWindowGroupPtrByGroupId(std::size_t window_group_id) const
Definition timsdiaslices.cpp:93
pappso::TimsDiaSlices::MsMsWindowGroupList::addInGroup
void addInGroup(const MsMsWindow &window)
Definition timsdiaslices.cpp:56
pappso::TimsDiaSlices::MsMsWindowGroupList::~MsMsWindowGroupList
~MsMsWindowGroupList()
Definition timsdiaslices.cpp:47
pappso::TimsDiaSlices::MsMsWindowGroup
Definition timsdiaslices.h:66
pappso::TimsDiaSlices::MsMsWindowGroup::WindowGroup
std::size_t WindowGroup
Definition timsdiaslices.h:67
pappso::TimsDiaSlices::MsMsWindow
Definition timsdiaslices.h:51
pappso::TimsDiaSlices::MsMsWindow::IsolationMz
double IsolationMz
Definition timsdiaslices.h:60
pappso::TimsDiaSlices::MsMsWindow::ScanNumBegin
std::size_t ScanNumBegin
Definition timsdiaslices.h:58
pappso::TimsDiaSlices::MsMsWindow::CollisionEnergy
double CollisionEnergy
Definition timsdiaslices.h:62
pappso::TimsDiaSlices::MsMsWindow::WindowGroup
std::size_t WindowGroup
Definition timsdiaslices.h:57
pappso::TimsDiaSlices::MsMsWindow::isMzInRange
bool isMzInRange(double mz) const
tell if given mz is in range for this window
Definition timsdiaslices.cpp:37
pappso::TimsDiaSlices::MsMsWindow::SliceIndex
std::size_t SliceIndex
Definition timsdiaslices.h:56
pappso::TimsDiaSlices::MsMsWindow::ScanNumEnd
std::size_t ScanNumEnd
Definition timsdiaslices.h:59
pappso::TimsDiaSlices::MsMsWindow::IsolationWidth
double IsolationWidth
Definition timsdiaslices.h:61
timsdiaslices.h