libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
timsdiaslices.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/vendors/tims/timsdiaslices.h
3 * \date 02/07/2024
4 * \brief handle specific data for DIA MS runs
5 */
6
7/*******************************************************************************
8 * Copyright (c) 2024 Olivier Langella <Olivier.Langella@u-psud.fr>.
9 *
10 * This file is part of the PAPPSOms++ library.
11 *
12 * PAPPSOms++ is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * PAPPSOms++ is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
24 *
25 ******************************************************************************/
26
27#pragma once
28#include "timsdata.h"
29
30namespace pappso
31{
32
33/**
34 * @todo write docs
35 */
37{
38 public:
39 /**
40 * Default constructor
41 */
42 TimsDiaSlices(QSqlQuery &query, TimsData *tims_data_origin);
43
44 /**
45 * Destructor
46 */
48
50 {
51 /** @brief tell if given mz is in range for this window
52 */
53 bool isMzInRange(double mz) const;
54
55 std::size_t SliceIndex = 0;
56 std::size_t WindowGroup;
57 std::size_t ScanNumBegin;
58 std::size_t ScanNumEnd;
62 };
63
64 struct MsMsWindowGroup : std::vector<MsMsWindow>
65 {
66 std::size_t WindowGroup;
67 };
68
69 struct MsMsWindowGroupList : std::vector<MsMsWindowGroup *>
70 {
72
73 void addInGroup(const MsMsWindow &window);
75 getWindowGroupPtrByGroupId(std::size_t window_group_id) const;
76 };
77
78 const MsMsWindowGroupList &getMsMsWindowGroupList() const;
79
80 const std::map<std::size_t, MsMsWindowGroup *> &
81 getMapFrame2WindowGroupPtr() const;
82
83 std::size_t getGlobalSliceIndexBeginByFrameId(std::size_t frame_id) const;
84
85 std::size_t getFrameIdByGlobalSliceIndex(std::size_t global_slice_id) const;
86
87
88 /** @brief get the number of DIA MS2 slices analyzed by PASEF
89 */
90 std::size_t getTotalSlicesCount() const;
91
92
93 const MsMsWindow &
94 getMsMsWindowByGlobalSliceIndex(std::size_t global_slice_index) const;
95
96
98 getCombinedMs2ScansByGlobalSliceIndex(std::size_t global_slice_index) const;
99
100
101 void getMs2QualifiedSpectrumByGlobalSliceIndex(
102 const MsRunIdCstSPtr &msrun_id,
103 QualifiedMassSpectrum &mass_spectrum,
104 std::size_t global_slice_index,
105 bool want_binary_data) const;
106
107
108 /** @brief get MS1 spectrum corresponding to the given slice
109 * extract MS1 mz range and mobility range corresponding to a global slice
110 * @param msrun_id
111 * @param mass_spectrum
112 * @param global_slice_index
113 * @param want_binary_data
114 * @param rt_position relative MS1 frame retention time : 0 latest MS1 frame,
115 * +1 next MS1 frame, -1 previous MS1 frame
116 */
117 void getMs1QualifiedSpectrumByGlobalSliceIndex(
118 const MsRunIdCstSPtr &msrun_id,
119 QualifiedMassSpectrum &mass_spectrum,
120 std::size_t global_slice_index,
121 bool want_binary_data,
122 int rt_position = 0) const;
123
124 std::size_t getLastMs1FrameIdByMs2FrameId(std::size_t frame_id) const;
125
126 private:
128 {
129 std::size_t frame_id;
132 };
133
134 const FrameSliceRange &
135 getFrameSliceRangeByGlobalSliceIndex(std::size_t global_slice_index) const;
136
137 private:
140 std::map<std::size_t, MsMsWindowGroup *> m_mapFrame2WindowGroupPtr;
141 std::vector<std::size_t> m_frameId2GlobalSliceIndexBegin;
142 std::vector<std::size_t> m_ms2frameId2Ms1FrameId;
143 std::vector<std::size_t> m_ms1frameIdList;
144 std::vector<FrameSliceRange> m_frameSliceRangeList;
145
146 /** @brief enable builtin centroid on raw tims integers by default
147 */
148 bool m_builtinMs2Centroid = true;
149
151};
152} // namespace pappso
Class representing a fully specified mass spectrum.
replacement for std::map
std::vector< std::size_t > m_ms2frameId2Ms1FrameId
MsMsWindowGroupList m_msMsWindowGroupList
std::vector< std::size_t > m_ms1frameIdList
std::map< std::size_t, MsMsWindowGroup * > m_mapFrame2WindowGroupPtr
std::size_t m_totalSlicesCount
std::vector< std::size_t > m_frameId2GlobalSliceIndexBegin
std::vector< FrameSliceRange > m_frameSliceRangeList
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46
main Tims data handler