libpappsomspp
Library for mass spectrometry
msrunxicextractorfactory.h
Go to the documentation of this file.
1/**
2 * \file pappsomspp/xicextractor/msrunxicextractorfactory.h
3 * \date 07/05/2018
4 * \author Olivier Langella
5 * \brief factory to build XIC extractor on an MsRun file
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2018 Olivier Langella <Olivier.Langella@u-psud.fr>.
10 *
11 * This file is part of the PAPPSOms++ library.
12 *
13 * PAPPSOms++ is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms++ is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25 *
26 * Contributors:
27 * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
28 *implementation
29 ******************************************************************************/
30
31#pragma once
32
34
35
36namespace pappso
37{
38
39
40/** \def MsRunXicExtractorFactoryType the kind of xic extractor you want
41 * this may be usefull to choose if you want a direct extraction (no buffer, no
42 * temporary file) or an optimized xic extraction to save memory or cpu
43 *
44 */
45enum class MsRunXicExtractorFactoryType : std::int8_t
46{
47 nose = 0, ///< default factory
48 direct = 1, ///< build a simple XIC extractor that directly uses Proeowizard
49 ///< library to read and extract XICs building the xic extractor
50 ///< is fast, but extracting each XIC is slow
51 disk = 2, ///< build Xic extractor that first read the whole MsRun, put it on
52 ///< disk and extract XICs more quickly This needs some space on
53 ///< disk to store slices (1 dalton each) building the XIC extractor
54 ///< is slow extracting XIC from slices is a very quick operation
56 3, ///< build Xic extractor that first read the whole MsRun, put it on disk
57 ///< using a write cache and extract XICs more quickly This needs some
58 ///< space on disk to store slices (1 dalton each) building the XIC
59 ///< extractor is slower than buildMsRunXicExtractorPwizSp, but faster
60 ///< than buildMsRunXicExtractorDiskSp extracting XIC from slices is a
61 ///< very quick operation
62};
63
64
65/** @brief factory to build different kinds of XIC extractors
66 */
68{
69 public:
70 /** @brief singleton to get the only instance of the factory
71 */
72 static MsRunXicExtractorFactory &getInstance();
73
74 /** @brief build a simple XIC extractor that directly uses Proeowizard library
75 * to read and extract XICs building the xic extractor is fast, but extracting
76 * each XIC is slow
77 * @param msrun_reader the MsRun reader on which the XIC extractor will run
78 */
80 buildMsRunXicExtractorSp(MsRunReaderSPtr &msrun_reader) const;
81
82 /// set the temporary working directory
83 void setTmpDir(const QString &dir_name);
84
85 /** @brief sets the xic extractor type
86 * @param type see the documentation of enumerations
87 */
88 void
89 setMsRunXicExtractorFactoryType(pappso::MsRunXicExtractorFactoryType type);
90
91 private:
94
95
96 private:
98 QString m_tmpDirName;
100};
101
102} // namespace pappso
factory to build different kinds of XIC extractors
static MsRunXicExtractorFactory m_instance
#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< MsRunReader > MsRunReaderSPtr
Definition: msrunreader.h:56
std::shared_ptr< MsRunXicExtractorInterface > MsRunXicExtractorInterfaceSp