libpappsomspp
Library for mass spectrometry
msrunxicextractorfactory.cpp
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/xicextractor/msrunxicextractorfactory.cpp
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 
35 
36 namespace pappso
37 {
38 
39 
40 MsRunXicExtractorFactory MsRunXicExtractorFactory::m_instance =
41  MsRunXicExtractorFactory();
42 
43 MsRunXicExtractorFactory &
45 {
46  return m_instance;
47 }
48 
49 
51 {
52 }
54 {
55 }
56 
57 void
58 MsRunXicExtractorFactory::setTmpDir(const QString &dir_name)
59 {
60  m_tmpDirName = dir_name;
61 }
64  MsRunReaderSPtr &msrun_reader) const
65 {
66  std::shared_ptr<MsRunXicExtractor> msrun_xic_extractor_sp =
67  std::make_shared<MsRunXicExtractor>(MsRunXicExtractor(msrun_reader));
68  return (msrun_xic_extractor_sp);
69 }
70 
73  MsRunReaderSPtr &msrun_reader) const
74 {
75  std::shared_ptr<MsRunXicExtractorDisk> msrun_xic_extractor_sp =
76  std::make_shared<MsRunXicExtractorDisk>(
77  MsRunXicExtractorDisk(msrun_reader, QDir(m_tmpDirName)));
78 
79  msrun_xic_extractor_sp.get()->prepareExtractor();
80  return (msrun_xic_extractor_sp);
81 }
82 
85  MsRunReaderSPtr &msrun_reader) const
86 {
87  std::shared_ptr<MsRunXicExtractorDiskBuffer> msrun_xic_extractor_sp =
88  std::make_shared<MsRunXicExtractorDiskBuffer>(
89  MsRunXicExtractorDiskBuffer(msrun_reader, QDir(m_tmpDirName)));
90  msrun_xic_extractor_sp.get()->prepareExtractor();
91  return (msrun_xic_extractor_sp);
92 }
93 
94 } // namespace pappso
msrunxicextractor.h
pappso::MsRunXicExtractorFactory::buildMsRunXicExtractorSp
MsRunXicExtractorInterfaceSp buildMsRunXicExtractorSp(MsRunReaderSPtr &msrun_reader) const
build a simple XIC extractor that directly uses Proeowizard library to read and extract XICs building...
Definition: msrunxicextractorfactory.cpp:63
msrunxicextractorfactory.h
factory to build XIC extractor on an MsRun file
pappso::MsRunXicExtractorFactory::buildMsRunXicExtractorDiskBufferSp
MsRunXicExtractorInterfaceSp buildMsRunXicExtractorDiskBufferSp(MsRunReaderSPtr &msrun_reader) const
build Xic extractor that first read the whole MsRun, put it on disk using a write cache and extract X...
Definition: msrunxicextractorfactory.cpp:84
pappso::MsRunXicExtractorFactory::buildMsRunXicExtractorDiskSp
MsRunXicExtractorInterfaceSp buildMsRunXicExtractorDiskSp(MsRunReaderSPtr &msrun_reader) const
build Xic extractor that first read the whole MsRun, put it on disk and extract XICs more quickly Thi...
Definition: msrunxicextractorfactory.cpp:72
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:151
pappso::MsRunXicExtractorFactory::m_tmpDirName
QString m_tmpDirName
Definition: msrunxicextractorfactory.h:44
pappso::MsRunXicExtractorDisk
Definition: msrunxicextractordisk.h:45
msrunxicextractordisk.h
MsRunReader based XIC extractor featuring disk cache.
pappso::MsRunXicExtractorFactory::m_instance
static MsRunXicExtractorFactory m_instance
Definition: msrunxicextractorfactory.h:43
pappso::MsRunXicExtractorFactory::setTmpDir
void setTmpDir(const QString &dir_name)
set the temporary working directory
Definition: msrunxicextractorfactory.cpp:58
pappso::MsRunXicExtractorFactory::~MsRunXicExtractorFactory
virtual ~MsRunXicExtractorFactory()
Definition: msrunxicextractorfactory.cpp:53
msrunxicextractordiskbuffer.h
proteowizard based XIC extractor featuring disk cache + write buffer
pappso::MsRunXicExtractorFactory::getInstance
static MsRunXicExtractorFactory & getInstance()
singleton to get the only instance of the factory
Definition: msrunxicextractorfactory.cpp:44
pappso::MsRunXicExtractor
Definition: msrunxicextractor.h:42
pappso::MsRunXicExtractorDiskBuffer
Definition: msrunxicextractordiskbuffer.h:44
pappso::MsRunXicExtractorFactory::MsRunXicExtractorFactory
MsRunXicExtractorFactory()
Definition: msrunxicextractorfactory.cpp:50
pappso::MsRunXicExtractorInterfaceSp
std::shared_ptr< MsRunXicExtractorInterface > MsRunXicExtractorInterfaceSp
Definition: msrunxicextractorinterface.h:41