| 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 <[email protected]>. |
| 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"cxx . . $ `<file>/src/pappsomspp/core/vendors/tims/timsdata.h`/ |
| 29 | #include "pappsomspp/export-import-config.h"cxx . . $ `<file>/src/pappsomspp/export-import-config.h`/ |
| 30 | |
| 31 | namespace pappsocxx . . $ pappso/ |
| 32 | { |
| 33 | |
| 34 | /** |
| 35 | * @todo write docs |
| 36 | */ |
| 37 | class PMSPP_LIB_DECLcxx . . $ `src/pappsomspp/export-import-config.h:10:9`! TimsDiaSlicescxx . . $ pappso/TimsDiaSlices# |
| 38 | { |
| 39 | public: |
| 40 | /** |
| 41 | * Default constructor |
| 42 | */ |
| 43 | TimsDiaSlicescxx . . $ pappso/TimsDiaSlices#TimsDiaSlices(eaaddd21341244ff).(QSqlQuerycxx . . $ QSqlQuery# &query, TimsDatacxx . . $ pappso/TimsData# *tims_data_origin); |
| 44 | |
| 45 | /** |
| 46 | * Destructor |
| 47 | */ |
| 48 | ~cxx . . $ pappso/TimsDiaSlices#`~TimsDiaSlices`(49f6e7a06ebc5aa8).TimsDiaSlicescxx . . $ pappso/TimsDiaSlices#(); |
| 49 | |
| 50 | struct MsMsWindowcxx . . $ pappso/TimsDiaSlices#MsMsWindow# |
| 51 | { |
| 52 | /** @brief tell if given mz is in range for this window |
| 53 | */ |
| 54 | bool isMzInRangecxx . . $ pappso/TimsDiaSlices#MsMsWindow#isMzInRange(b32f3370ca1a96a1).(double mz) const; |
| 55 | |
| 56 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# SliceIndexcxx . . $ pappso/TimsDiaSlices#MsMsWindow#SliceIndex. = 0; |
| 57 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# WindowGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindow#WindowGroup.; |
| 58 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# ScanNumBegincxx . . $ pappso/TimsDiaSlices#MsMsWindow#ScanNumBegin.; |
| 59 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# ScanNumEndcxx . . $ pappso/TimsDiaSlices#MsMsWindow#ScanNumEnd.; |
| 60 | double IsolationMzcxx . . $ pappso/TimsDiaSlices#MsMsWindow#IsolationMz.; |
| 61 | double IsolationWidthcxx . . $ pappso/TimsDiaSlices#MsMsWindow#IsolationWidth.; |
| 62 | double CollisionEnergycxx . . $ pappso/TimsDiaSlices#MsMsWindow#CollisionEnergy.; |
| 63 | }; |
| 64 | |
| 65 | struct MsMsWindowGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroup# : stdcxx . . $ std/::vectorcxx . . $ std/vector#<MsMsWindowcxx . . $ pappso/TimsDiaSlices#MsMsWindow#> |
| 66 | { |
| 67 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# WindowGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroup#WindowGroup.; |
| 68 | }; |
| 69 | |
| 70 | struct MsMsWindowGroupListcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroupList# : stdcxx . . $ std/::vectorcxx . . $ std/vector#<MsMsWindowGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroup# *> |
| 71 | { |
| 72 | ~cxx . . $ pappso/TimsDiaSlices#MsMsWindowGroupList#`~MsMsWindowGroupList`(49f6e7a06ebc5aa8).MsMsWindowGroupListcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroupList#(); |
| 73 | |
| 74 | void addInGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroupList#addInGroup(dea6d988410c3f83).(const MsMsWindowcxx . . $ pappso/TimsDiaSlices#MsMsWindow# &window); |
| 75 | MsMsWindowGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroup# * |
| 76 | getWindowGroupPtrByGroupIdcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroupList#getWindowGroupPtrByGroupId(6ef57fcdec48fd6a).(stdcxx . . $ std/::size_tcxx . . $ std/size_t# window_group_id) const; |
| 77 | }; |
| 78 | |
| 79 | const MsMsWindowGroupListcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroupList# &getMsMsWindowGroupListcxx . . $ pappso/TimsDiaSlices#getMsMsWindowGroupList(ab42c3c3bbfd749c).() const; |
| 80 | |
| 81 | const stdcxx . . $ std/::mapcxx . . $ std/map#<stdcxx . . $ std/::size_tcxx . . $ std/size_t#, MsMsWindowGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroup# *> & |
| 82 | getMapFrame2WindowGroupPtrcxx . . $ pappso/TimsDiaSlices#getMapFrame2WindowGroupPtr(7bcbf75c80d8a5b4).() const; |
| 83 | |
| 84 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# getGlobalSliceIndexBeginByFrameIdcxx . . $ pappso/TimsDiaSlices#getGlobalSliceIndexBeginByFrameId(611be0c07d97f8b8).(stdcxx . . $ std/::size_tcxx . . $ std/size_t# frame_id) const; |
| 85 | |
| 86 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# getFrameIdByGlobalSliceIndexcxx . . $ pappso/TimsDiaSlices#getFrameIdByGlobalSliceIndex(611be0c07d97f8b8).(stdcxx . . $ std/::size_tcxx . . $ std/size_t# global_slice_id) const; |
| 87 | |
| 88 | |
| 89 | /** @brief get the number of DIA MS2 slices analyzed by PASEF |
| 90 | */ |
| 91 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# getTotalSlicesCountcxx . . $ pappso/TimsDiaSlices#getTotalSlicesCount(fe4d2d262d4164a8).() const; |
| 92 | |
| 93 | |
| 94 | const MsMsWindowcxx . . $ pappso/TimsDiaSlices#MsMsWindow# & |
| 95 | getMsMsWindowByGlobalSliceIndexcxx . . $ pappso/TimsDiaSlices#getMsMsWindowByGlobalSliceIndex(7175b28707369d02).(stdcxx . . $ std/::size_tcxx . . $ std/size_t# global_slice_index) const; |
| 96 | |
| 97 | |
| 98 | TimsDataFastMapcxx . . $ pappso/TimsDataFastMap# & |
| 99 | getCombinedMs2ScansByGlobalSliceIndexcxx . . $ pappso/TimsDiaSlices#getCombinedMs2ScansByGlobalSliceIndex(f05083bc80ccacde).(stdcxx . . $ std/::size_tcxx . . $ std/size_t# global_slice_index) const; |
| 100 | |
| 101 | |
| 102 | void getMs2QualifiedSpectrumByGlobalSliceIndexcxx . . $ pappso/TimsDiaSlices#getMs2QualifiedSpectrumByGlobalSliceIndex(cce79d4ef52840b2).( |
| 103 | const MsRunIdCstSPtrcxx . . $ pappso/MsRunIdCstSPtr# &msrun_id, |
| 104 | QualifiedMassSpectrumcxx . . $ pappso/QualifiedMassSpectrum# &mass_spectrum, |
| 105 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# global_slice_index, |
| 106 | bool want_binary_data) const; |
| 107 | |
| 108 | |
| 109 | /** @brief get MS1 spectrum corresponding to the given slice |
| 110 | * extract MS1 mz range and mobility range corresponding to a global slice |
| 111 | * @param msrun_id |
| 112 | * @param mass_spectrum |
| 113 | * @param global_slice_index |
| 114 | * @param want_binary_data |
| 115 | * @param rt_position relative MS1 frame retention time : 0 latest MS1 frame, |
| 116 | * +1 next MS1 frame, -1 previous MS1 frame |
| 117 | */ |
| 118 | void getMs1QualifiedSpectrumByGlobalSliceIndexcxx . . $ pappso/TimsDiaSlices#getMs1QualifiedSpectrumByGlobalSliceIndex(f89c9b0bb8bb2b4).( |
| 119 | const MsRunIdCstSPtrcxx . . $ pappso/MsRunIdCstSPtr# &msrun_id, |
| 120 | QualifiedMassSpectrumcxx . . $ pappso/QualifiedMassSpectrum# &mass_spectrum, |
| 121 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# global_slice_index, |
| 122 | bool want_binary_data, |
| 123 | int rt_position = 0) const; |
| 124 | |
| 125 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# getLastMs1FrameIdByMs2FrameIdcxx . . $ pappso/TimsDiaSlices#getLastMs1FrameIdByMs2FrameId(611be0c07d97f8b8).(stdcxx . . $ std/::size_tcxx . . $ std/size_t# frame_id) const; |
| 126 | |
| 127 | private: |
| 128 | struct FrameSliceRangecxx . . $ pappso/TimsDiaSlices#FrameSliceRange# |
| 129 | { |
| 130 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# frame_idcxx . . $ pappso/TimsDiaSlices#FrameSliceRange#frame_id.; |
| 131 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# begin_global_slice_indexcxx . . $ pappso/TimsDiaSlices#FrameSliceRange#begin_global_slice_index.; |
| 132 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# end_global_slice_indexcxx . . $ pappso/TimsDiaSlices#FrameSliceRange#end_global_slice_index.; |
| 133 | }; |
| 134 | |
| 135 | const FrameSliceRangecxx . . $ pappso/TimsDiaSlices#FrameSliceRange# & |
| 136 | getFrameSliceRangeByGlobalSliceIndexcxx . . $ pappso/TimsDiaSlices#getFrameSliceRangeByGlobalSliceIndex(a61498b73a72d878).(stdcxx . . $ std/::size_tcxx . . $ std/size_t# global_slice_index) const; |
| 137 | |
| 138 | private: |
| 139 | TimsDatacxx . . $ pappso/TimsData# *mp_timsDataOrigincxx . . $ pappso/TimsDiaSlices#mp_timsDataOrigin.; |
| 140 | MsMsWindowGroupListcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroupList# m_msMsWindowGroupListcxx . . $ pappso/TimsDiaSlices#m_msMsWindowGroupList.; |
| 141 | stdcxx . . $ std/::mapcxx . . $ std/map#<stdcxx . . $ std/::size_tcxx . . $ std/size_t#, MsMsWindowGroupcxx . . $ pappso/TimsDiaSlices#MsMsWindowGroup# *> m_mapFrame2WindowGroupPtrcxx . . $ pappso/TimsDiaSlices#m_mapFrame2WindowGroupPtr.; |
| 142 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::size_tcxx . . $ std/size_t#> m_frameId2GlobalSliceIndexBegincxx . . $ pappso/TimsDiaSlices#m_frameId2GlobalSliceIndexBegin.; |
| 143 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::size_tcxx . . $ std/size_t#> m_ms2frameId2Ms1FrameIdcxx . . $ pappso/TimsDiaSlices#m_ms2frameId2Ms1FrameId.; |
| 144 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::size_tcxx . . $ std/size_t#> m_ms1frameIdListcxx . . $ pappso/TimsDiaSlices#m_ms1frameIdList.; |
| 145 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<FrameSliceRangecxx . . $ pappso/TimsDiaSlices#FrameSliceRange#> m_frameSliceRangeListcxx . . $ pappso/TimsDiaSlices#m_frameSliceRangeList.; |
| 146 | |
| 147 | /** @brief enable builtin centroid on raw tims integers by default |
| 148 | */ |
| 149 | bool m_builtinMs2Centroidcxx . . $ pappso/TimsDiaSlices#m_builtinMs2Centroid. = true; |
| 150 | |
| 151 | stdcxx . . $ std/::size_tcxx . . $ std/size_t# m_totalSlicesCountcxx . . $ pappso/TimsDiaSlices#m_totalSlicesCount.; |
| 152 | }; |
| 153 | } // namespace pappso |