libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
msfileaccessor.h
Go to the documentation of this file.
1
2
#pragma once
3
4
#include <QString>
5
#include <QMetaType>
6
7
8
#include "
pappsomspp/core/types.h
"
9
#include "
pappsomspp/core/msrun/msrunreader.h
"
10
#include "
pappsomspp/core/msrun/msrunid.h
"
11
#include "
pappsomspp/export-import-config.h
"
12
#include "
pappsomspp/core/obo/obopsimodterm.h
"
13
14
15
namespace
pappso
16
{
17
18
class
TimsMsRunReaderMs2
;
19
typedef
std::shared_ptr<TimsMsRunReaderMs2>
TimsMsRunReaderMs2SPtr
;
20
21
// This class is used to access mass spectrometry data files. The file being
22
// opened and read might contain more than one MS run. The user of this class
23
// might request a vector of all these MS runs (in the form of a vector of
24
// MsRunIdCstSPtr. Once the MsRunIdCstSPtr of interest has been located by the
25
// caller, the caller might then request the MsRunReaderSPtr to use to read that
26
// MS run's data.
27
class
PMSPP_LIB_DECL
MsFileAccessor
28
{
29
public
:
30
MsFileAccessor
(
const
QString &file_name,
const
QString &xml_prefix);
31
MsFileAccessor
(
const
MsFileAccessor
&other);
32
virtual
~MsFileAccessor
();
33
34
const
QString &
getFileName
()
const
;
35
36
/** @brief get the raw format of mz data
37
*/
38
Enums::MsDataFormat
getFileFormat
()
const
;
39
40
41
/** @brief get OboPsiModTerm corresponding to the raw format of mz data
42
*/
43
const
OboPsiModTerm
getOboPsiModTermFileFormat
()
const
;
44
45
46
/** @brief get OboPsiModTerm corresponding to the nativeID format format of mz
47
* data
48
*/
49
const
OboPsiModTerm
&
getOboPsiModTermNativeIDFormat
()
const
;
50
51
52
/** @brief get the file reader type
53
*/
54
Enums::FileReaderType
getFileReaderType
()
const
;
55
56
/** @brief given an mz format, explicitly set the preferred reader
57
*/
58
void
setPreferredFileReaderType
(
Enums::MsDataFormat
format,
59
Enums::FileReaderType
reader_type);
60
Enums::FileReaderType
getpreferredFileReaderType
(
Enums::MsDataFormat
format);
61
62
std::vector<MsRunIdCstSPtr>
getMsRunIds
();
63
64
void
setSelectedMsRunId
(
MsRunIdCstSPtr
ms_run_id_csp);
65
MsRunIdCstSPtr
getSelectedMsRunId
()
const
;
66
67
MsRunReaderSPtr
msRunReaderSPtr
(
MsRunIdCstSPtr
ms_run_id);
68
MsRunReaderSPtr
msRunReaderSPtr
(std::size_t ms_run_id_index);
69
MsRunReaderSPtr
msRunReaderSPtrForSelectedMsRunId
();
70
71
/** @brief get an msrun reader by finding the run_id in file
72
*
73
* @param run_id identifier within file of the MSrun
74
* @param xml_id XML identifier given by the user to identify this MSrun in
75
* our experiment (not in the file)
76
*/
77
MsRunReaderSPtr
getMsRunReaderSPtrByRunId
(
const
QString &run_id,
78
const
QString &xml_id);
79
80
/** @brief get an MsRunReader directly from a valid MsRun ID
81
*
82
* no need to check the file format or filename : all is already part of the
83
* msrunid
84
*
85
* @param ms_run_id msrun identifier
86
* @return msrun reader shared pointer
87
*/
88
static
MsRunReaderSPtr
buildMsRunReaderSPtr
(
MsRunIdCstSPtr
ms_run_id);
89
90
/** @brief get an MsRunReader directly from a valid MsRun ID
91
*
92
* no need to check the file format or filename : all is already part of the
93
* msrunid
94
*
95
* @param ms_run_id msrun identifier
96
* @param preferred_file_reader_type the preferred file reader type to use
97
* (depending on the mz format)
98
* @return msrun reader shared pointer
99
*/
100
static
MsRunReaderSPtr
101
buildMsRunReaderSPtr
(
MsRunIdCstSPtr
ms_run_id,
102
Enums::FileReaderType
preferred_file_reader_type);
103
104
/** @brief if possible, builds directly a dedicated Tims TOF tdf file reader
105
*/
106
TimsMsRunReaderMs2SPtr
buildTimsMsRunReaderMs2SPtr
();
107
108
private
:
109
QString
m_fileName
;
110
111
// When opening more than one file concurrently in a determinate session, we
112
// need this prefix to craft unabiguous ms run ids.
113
const
QString
m_xmlPrefix
;
114
115
Enums::MsDataFormat
m_fileFormat
=
Enums::MsDataFormat::unknown
;
116
117
// Type of the file reader that could load the file.
118
Enums::FileReaderType
m_fileReaderType
;
119
120
std::map<Enums::MsDataFormat, Enums::FileReaderType>
m_preferredFileReaderTypeMap
;
121
122
MsRunIdCstSPtr
mcsp_selectedMsRunId
=
nullptr
;
123
124
OboPsiModTerm
m_oboPsiModTermNativeIDFormat
;
125
};
126
127
typedef
std::shared_ptr<MsFileAccessor>
MsFileAccessorSPtr
;
128
typedef
std::shared_ptr<const MsFileAccessor>
MsFileAccessorCstSPtr
;
129
130
}
// namespace pappso
pappso::MsFileAccessor::getOboPsiModTermNativeIDFormat
const OboPsiModTerm & getOboPsiModTermNativeIDFormat() const
get OboPsiModTerm corresponding to the nativeID format format of mz data
Definition
msfileaccessor.cpp:189
pappso::MsFileAccessor::getSelectedMsRunId
MsRunIdCstSPtr getSelectedMsRunId() const
Definition
msfileaccessor.cpp:385
pappso::MsFileAccessor::msRunReaderSPtr
MsRunReaderSPtr msRunReaderSPtr(MsRunIdCstSPtr ms_run_id)
Definition
msfileaccessor.cpp:422
pappso::MsFileAccessor::m_xmlPrefix
const QString m_xmlPrefix
Definition
msfileaccessor.h:113
pappso::MsFileAccessor::m_fileReaderType
Enums::FileReaderType m_fileReaderType
Definition
msfileaccessor.h:118
pappso::MsFileAccessor::m_fileFormat
Enums::MsDataFormat m_fileFormat
Definition
msfileaccessor.h:115
pappso::MsFileAccessor::setPreferredFileReaderType
void setPreferredFileReaderType(Enums::MsDataFormat format, Enums::FileReaderType reader_type)
given an mz format, explicitly set the preferred reader
Definition
msfileaccessor.cpp:342
pappso::MsFileAccessor::getFileFormat
Enums::MsDataFormat getFileFormat() const
get the raw format of mz data
Definition
msfileaccessor.cpp:70
pappso::MsFileAccessor::getFileReaderType
Enums::FileReaderType getFileReaderType() const
get the file reader type
Definition
msfileaccessor.cpp:373
pappso::MsFileAccessor::msRunReaderSPtrForSelectedMsRunId
MsRunReaderSPtr msRunReaderSPtrForSelectedMsRunId()
Definition
msfileaccessor.cpp:527
pappso::MsFileAccessor::m_fileName
QString m_fileName
Definition
msfileaccessor.h:109
pappso::MsFileAccessor::mcsp_selectedMsRunId
MsRunIdCstSPtr mcsp_selectedMsRunId
Definition
msfileaccessor.h:122
pappso::MsFileAccessor::getMsRunIds
std::vector< MsRunIdCstSPtr > getMsRunIds()
Definition
msfileaccessor.cpp:197
pappso::MsFileAccessor::m_oboPsiModTermNativeIDFormat
OboPsiModTerm m_oboPsiModTermNativeIDFormat
Definition
msfileaccessor.h:124
pappso::MsFileAccessor::setSelectedMsRunId
void setSelectedMsRunId(MsRunIdCstSPtr ms_run_id_csp)
Definition
msfileaccessor.cpp:379
pappso::MsFileAccessor::getOboPsiModTermFileFormat
const OboPsiModTerm getOboPsiModTermFileFormat() const
get OboPsiModTerm corresponding to the raw format of mz data
Definition
msfileaccessor.cpp:76
pappso::MsFileAccessor::getMsRunReaderSPtrByRunId
MsRunReaderSPtr getMsRunReaderSPtrByRunId(const QString &run_id, const QString &xml_id)
get an msrun reader by finding the run_id in file
Definition
msfileaccessor.cpp:602
pappso::MsFileAccessor::getpreferredFileReaderType
Enums::FileReaderType getpreferredFileReaderType(Enums::MsDataFormat format)
Definition
msfileaccessor.cpp:358
pappso::MsFileAccessor::MsFileAccessor
MsFileAccessor(const QString &file_name, const QString &xml_prefix)
Definition
msfileaccessor.cpp:33
pappso::MsFileAccessor::buildMsRunReaderSPtr
static MsRunReaderSPtr buildMsRunReaderSPtr(MsRunIdCstSPtr ms_run_id)
get an MsRunReader directly from a valid MsRun ID
Definition
msfileaccessor.cpp:535
pappso::MsFileAccessor::m_preferredFileReaderTypeMap
std::map< Enums::MsDataFormat, Enums::FileReaderType > m_preferredFileReaderTypeMap
Definition
msfileaccessor.h:120
pappso::MsFileAccessor::buildTimsMsRunReaderMs2SPtr
TimsMsRunReaderMs2SPtr buildTimsMsRunReaderMs2SPtr()
if possible, builds directly a dedicated Tims TOF tdf file reader
Definition
msfileaccessor.cpp:391
pappso::MsFileAccessor::getFileName
const QString & getFileName() const
Definition
msfileaccessor.cpp:64
pappso::OboPsiModTerm
Definition
obopsimodterm.h:34
pappso::TimsMsRunReaderMs2
Definition
timsmsrunreaderms2.h:39
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
msrunid.h
msrunreader.h
pappso::Enums::MsDataFormat
MsDataFormat
Definition
types.h:141
pappso::Enums::MsDataFormat::unknown
@ unknown
unknown format
Definition
types.h:142
pappso::Enums::FileReaderType
FileReaderType
Definition
types.h:168
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::MsRunReaderSPtr
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition
msrunreader.h:57
pappso::TimsMsRunReaderMs2SPtr
std::shared_ptr< TimsMsRunReaderMs2 > TimsMsRunReaderMs2SPtr
Definition
msfileaccessor.h:19
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition
msrunid.h:46
pappso::MsFileAccessorCstSPtr
std::shared_ptr< const MsFileAccessor > MsFileAccessorCstSPtr
Definition
msfileaccessor.h:128
pappso::MsFileAccessorSPtr
std::shared_ptr< MsFileAccessor > MsFileAccessorSPtr
Definition
msfileaccessor.h:127
obopsimodterm.h
types.h
pappsomspp
core
msfile
msfileaccessor.h
Generated on
for libpappsomspp by
1.17.0