libpappsomspp
Library for mass spectrometry
pappso::MsRunXicExtractorFactory Class Reference

factory to build different kinds of XIC extractors More...

#include <msrunxicextractorfactory.h>

Public Member Functions

MsRunXicExtractorInterfaceSp buildMsRunXicExtractorSp (MsRunReaderSPtr &msrun_reader) const
 build a simple XIC extractor that directly uses Proeowizard library to read and extract XICs building the xic extractor is fast, but extracting each XIC is slow More...
 
void setTmpDir (const QString &dir_name)
 set the temporary working directory More...
 
void setMsRunXicExtractorFactoryType (pappso::MsRunXicExtractorFactoryType type)
 sets the xic extractor type More...
 

Static Public Member Functions

static MsRunXicExtractorFactorygetInstance ()
 singleton to get the only instance of the factory More...
 

Private Member Functions

 MsRunXicExtractorFactory ()
 
virtual ~MsRunXicExtractorFactory ()
 

Private Attributes

QString m_tmpDirName
 
MsRunXicExtractorFactoryType m_type = MsRunXicExtractorFactoryType::nose
 

Static Private Attributes

static MsRunXicExtractorFactory m_instance
 

Detailed Description

factory to build different kinds of XIC extractors

Definition at line 67 of file msrunxicextractorfactory.h.

Constructor & Destructor Documentation

◆ MsRunXicExtractorFactory()

pappso::MsRunXicExtractorFactory::MsRunXicExtractorFactory ( )
private

Definition at line 52 of file msrunxicextractorfactory.cpp.

53 {
54 }

◆ ~MsRunXicExtractorFactory()

pappso::MsRunXicExtractorFactory::~MsRunXicExtractorFactory ( )
privatevirtual

Definition at line 55 of file msrunxicextractorfactory.cpp.

56 {
57 }

Member Function Documentation

◆ buildMsRunXicExtractorSp()

MsRunXicExtractorInterfaceSp pappso::MsRunXicExtractorFactory::buildMsRunXicExtractorSp ( MsRunReaderSPtr msrun_reader) const

build a simple XIC extractor that directly uses Proeowizard library to read and extract XICs building the xic extractor is fast, but extracting each XIC is slow

Parameters
msrun_readerthe MsRun reader on which the XIC extractor will run

Definition at line 72 of file msrunxicextractorfactory.cpp.

74 {
75 
76  pappso::TimsMsRunReaderMs2 *tims2_reader =
77  dynamic_cast<pappso::TimsMsRunReaderMs2 *>(msrun_reader.get());
78  if(tims2_reader == nullptr)
79  {
80  // NO TIMS
83  {
84  std::shared_ptr<MsRunXicExtractor> msrun_xic_extractor_sp =
85  std::make_shared<MsRunXicExtractor>(
86  MsRunXicExtractor(msrun_reader));
87  return (msrun_xic_extractor_sp);
88  }
90  {
91 
92  std::shared_ptr<MsRunXicExtractorDisk> msrun_xic_extractor_sp =
93  std::make_shared<MsRunXicExtractorDisk>(
94  MsRunXicExtractorDisk(msrun_reader, QDir(m_tmpDirName)));
95 
96  msrun_xic_extractor_sp.get()->prepareExtractor();
97  return (msrun_xic_extractor_sp);
98  }
100  {
101 
102  std::shared_ptr<MsRunXicExtractorDiskBuffer> msrun_xic_extractor_sp =
103  std::make_shared<MsRunXicExtractorDiskBuffer>(
104  MsRunXicExtractorDiskBuffer(msrun_reader, QDir(m_tmpDirName)));
105  msrun_xic_extractor_sp.get()->prepareExtractor();
106  return (msrun_xic_extractor_sp);
107  }
108  }
109  else
110  {
111  // TIMS
112  std::shared_ptr<TimsDirectXicExtractor> msrun_xic_extractor_sp =
113  std::make_shared<TimsDirectXicExtractor>(msrun_reader);
114  return (msrun_xic_extractor_sp);
115  }
116  return nullptr;
117 }
MsRunXicExtractorFactoryType m_type

References pappso::direct, pappso::disk, pappso::diskbuffer, m_tmpDirName, m_type, and pappso::nose.

◆ getInstance()

MsRunXicExtractorFactory & pappso::MsRunXicExtractorFactory::getInstance ( )
static

singleton to get the only instance of the factory

Definition at line 46 of file msrunxicextractorfactory.cpp.

47 {
48  return m_instance;
49 }
static MsRunXicExtractorFactory m_instance

References m_instance.

◆ setMsRunXicExtractorFactoryType()

void pappso::MsRunXicExtractorFactory::setMsRunXicExtractorFactoryType ( pappso::MsRunXicExtractorFactoryType  type)

sets the xic extractor type

Parameters
typesee the documentation of enumerations

Definition at line 65 of file msrunxicextractorfactory.cpp.

67 {
68  m_type = type;
69 }

References m_type.

◆ setTmpDir()

void pappso::MsRunXicExtractorFactory::setTmpDir ( const QString &  dir_name)

set the temporary working directory

Definition at line 60 of file msrunxicextractorfactory.cpp.

61 {
62  m_tmpDirName = dir_name;
63 }

References m_tmpDirName.

Member Data Documentation

◆ m_instance

MsRunXicExtractorFactory pappso::MsRunXicExtractorFactory::m_instance
staticprivate
Initial value:

Definition at line 97 of file msrunxicextractorfactory.h.

Referenced by getInstance().

◆ m_tmpDirName

QString pappso::MsRunXicExtractorFactory::m_tmpDirName
private

Definition at line 98 of file msrunxicextractorfactory.h.

Referenced by buildMsRunXicExtractorSp(), and setTmpDir().

◆ m_type

MsRunXicExtractorFactoryType pappso::MsRunXicExtractorFactory::m_type = MsRunXicExtractorFactoryType::nose
private

The documentation for this class was generated from the following files: