libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
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
31
#include "
msrunxicextractorfactory.h
"
32
#include "
private/msrunxicextractor.h
"
33
#include "
private/msrunxicextractordisk.h
"
34
#include "
private/msrunxicextractordiskbuffer.h
"
35
#include "
pappsomspp/core/vendors/tims/xicextractor/timsdirectxicextractor.h
"
36
#include "
pappsomspp/core/msrun/private/timsmsrunreaderms2.h
"
37
38
namespace
pappso
39
{
40
41
42
MsRunXicExtractorFactory
MsRunXicExtractorFactory::m_instance
=
MsRunXicExtractorFactory
();
43
44
MsRunXicExtractorFactory
&
45
MsRunXicExtractorFactory::getInstance
()
46
{
47
return
m_instance
;
48
}
49
50
51
MsRunXicExtractorFactory::MsRunXicExtractorFactory
()
52
{
53
}
54
MsRunXicExtractorFactory::~MsRunXicExtractorFactory
()
55
{
56
}
57
58
void
59
MsRunXicExtractorFactory::setTmpDir
(
const
QString &dir_name)
60
{
61
m_tmpDirName
= dir_name;
62
}
63
void
64
MsRunXicExtractorFactory::setMsRunXicExtractorFactoryType
(
pappso::MsRunXicExtractorFactoryType
type)
65
{
66
m_type
= type;
67
}
68
69
MsRunXicExtractorInterfaceSp
70
MsRunXicExtractorFactory::buildMsRunXicExtractorSp
(
MsRunReaderSPtr
&msrun_reader)
const
71
{
72
73
pappso::TimsMsRunReaderMs2
*tims2_reader =
74
dynamic_cast<
pappso::TimsMsRunReaderMs2
*
>
(msrun_reader.get());
75
if
(tims2_reader ==
nullptr
)
76
{
77
// NO TIMS
78
if
((
m_type
==
MsRunXicExtractorFactoryType::nose
) ||
79
(
m_type
==
MsRunXicExtractorFactoryType::direct
))
80
{
81
std::shared_ptr<MsRunXicExtractor> msrun_xic_extractor_sp =
82
std::make_shared<MsRunXicExtractor>(
MsRunXicExtractor
(msrun_reader));
83
return
(msrun_xic_extractor_sp);
84
}
85
else
if
(
m_type
==
MsRunXicExtractorFactoryType::disk
)
86
{
87
88
std::shared_ptr<MsRunXicExtractorDisk> msrun_xic_extractor_sp =
89
std::make_shared<MsRunXicExtractorDisk>(
90
MsRunXicExtractorDisk
(msrun_reader, QDir(
m_tmpDirName
)));
91
92
msrun_xic_extractor_sp.get()->prepareExtractor();
93
return
(msrun_xic_extractor_sp);
94
}
95
else
if
(
m_type
==
MsRunXicExtractorFactoryType::diskbuffer
)
96
{
97
98
std::shared_ptr<MsRunXicExtractorDiskBuffer> msrun_xic_extractor_sp =
99
std::make_shared<MsRunXicExtractorDiskBuffer>(
100
MsRunXicExtractorDiskBuffer
(msrun_reader, QDir(
m_tmpDirName
)));
101
msrun_xic_extractor_sp.get()->prepareExtractor();
102
return
(msrun_xic_extractor_sp);
103
}
104
}
105
else
106
{
107
// TIMS
108
std::shared_ptr<TimsDirectXicExtractor> msrun_xic_extractor_sp =
109
std::make_shared<TimsDirectXicExtractor>(msrun_reader);
110
return
(msrun_xic_extractor_sp);
111
}
112
return
nullptr
;
113
}
114
115
116
}
// namespace pappso
pappso::MsRunXicExtractorDiskBuffer
Definition
msrunxicextractordiskbuffer.h:44
pappso::MsRunXicExtractorDisk
Definition
msrunxicextractordisk.h:45
pappso::MsRunXicExtractorFactory
factory to build different kinds of XIC extractors
Definition
msrunxicextractorfactory.h:68
pappso::MsRunXicExtractorFactory::m_type
MsRunXicExtractorFactoryType m_type
Definition
msrunxicextractorfactory.h:99
pappso::MsRunXicExtractorFactory::setTmpDir
void setTmpDir(const QString &dir_name)
set the temporary working directory
Definition
msrunxicextractorfactory.cpp:59
pappso::MsRunXicExtractorFactory::MsRunXicExtractorFactory
MsRunXicExtractorFactory()
Definition
msrunxicextractorfactory.cpp:51
pappso::MsRunXicExtractorFactory::~MsRunXicExtractorFactory
virtual ~MsRunXicExtractorFactory()
Definition
msrunxicextractorfactory.cpp:54
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:70
pappso::MsRunXicExtractorFactory::getInstance
static MsRunXicExtractorFactory & getInstance()
singleton to get the only instance of the factory
Definition
msrunxicextractorfactory.cpp:45
pappso::MsRunXicExtractorFactory::m_tmpDirName
QString m_tmpDirName
Definition
msrunxicextractorfactory.h:98
pappso::MsRunXicExtractorFactory::setMsRunXicExtractorFactoryType
void setMsRunXicExtractorFactoryType(pappso::MsRunXicExtractorFactoryType type)
sets the xic extractor type
Definition
msrunxicextractorfactory.cpp:64
pappso::MsRunXicExtractorFactory::m_instance
static MsRunXicExtractorFactory m_instance
Definition
msrunxicextractorfactory.h:97
pappso::MsRunXicExtractor
Definition
msrunxicextractor.h:42
pappso::TimsMsRunReaderMs2
Definition
timsmsrunreaderms2.h:39
msrunxicextractor.h
msrunxicextractordisk.h
msrunxicextractordiskbuffer.h
msrunxicextractorfactory.h
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::MsRunXicExtractorFactoryType
MsRunXicExtractorFactoryType
Definition
msrunxicextractorfactory.h:46
pappso::MsRunXicExtractorFactoryType::diskbuffer
@ diskbuffer
Definition
msrunxicextractorfactory.h:55
pappso::MsRunXicExtractorFactoryType::nose
@ nose
default factory
Definition
msrunxicextractorfactory.h:47
pappso::MsRunXicExtractorFactoryType::disk
@ disk
Definition
msrunxicextractorfactory.h:51
pappso::MsRunXicExtractorFactoryType::direct
@ direct
Definition
msrunxicextractorfactory.h:48
pappso::MsRunXicExtractorInterfaceSp
std::shared_ptr< MsRunXicExtractorInterface > MsRunXicExtractorInterfaceSp
Definition
msrunxicextractorinterface.h:42
timsdirectxicextractor.h
timsmsrunreaderms2.h
pappsomspp
core
xicextractor
msrunxicextractorfactory.cpp
Generated on
for libpappsomspp by
1.17.0