libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::MsFileAccessor Class Reference

#include <msfileaccessor.h>

Public Member Functions

 MsFileAccessor (const QString &file_name, const QString &xml_prefix)
 
 MsFileAccessor (const MsFileAccessor &other)
 
virtual ~MsFileAccessor ()
 
const QString & getFileName () const
 
MsDataFormat getFileFormat () const
 get the raw format of mz data
 
const OboPsiModTerm getOboPsiModTermFileFormat () const
 get OboPsiModTerm corresponding to the raw format of mz data
 
const OboPsiModTermgetOboPsiModTermNativeIDFormat () const
 get OboPsiModTerm corresponding to the nativeID format format of mz data
 
FileReaderType getFileReaderType () const
 get the file reader type
 
void setPreferredFileReaderType (MsDataFormat format, FileReaderType reader_type)
 given an mz format, explicitly set the preferred reader
 
FileReaderType getpreferredFileReaderType (MsDataFormat format)
 
std::vector< MsRunIdCstSPtrgetMsRunIds ()
 
void setSelectedMsRunId (MsRunIdCstSPtr ms_run_id_csp)
 
MsRunIdCstSPtr getSelectedMsRunId () const
 
MsRunReaderSPtr msRunReaderSPtr (MsRunIdCstSPtr ms_run_id)
 
MsRunReaderSPtr msRunReaderSPtr (std::size_t ms_run_id_index)
 
MsRunReaderSPtr msRunReaderSPtrForSelectedMsRunId ()
 
MsRunReaderSPtr getMsRunReaderSPtrByRunId (const QString &run_id, const QString &xml_id)
 get an msrun reader by finding the run_id in file
 
TimsMsRunReaderMs2SPtr buildTimsMsRunReaderMs2SPtr ()
 if possible, builds directly a dedicated Tims TOF tdf file reader
 

Static Public Member Functions

static MsRunReaderSPtr buildMsRunReaderSPtr (MsRunIdCstSPtr ms_run_id)
 get an MsRunReader directly from a valid MsRun ID
 
static MsRunReaderSPtr buildMsRunReaderSPtr (MsRunIdCstSPtr ms_run_id, pappso::FileReaderType preferred_file_reader_type)
 get an MsRunReader directly from a valid MsRun ID
 

Private Attributes

QString m_fileName
 
const QString m_xmlPrefix
 
MsDataFormat m_fileFormat = MsDataFormat::unknown
 
FileReaderType m_fileReaderType
 
std::map< MsDataFormat, FileReaderTypem_preferredFileReaderTypeMap
 
MsRunIdCstSPtr mcsp_selectedMsRunId = nullptr
 
OboPsiModTerm m_oboPsiModTermNativeIDFormat
 

Detailed Description

Definition at line 27 of file msfileaccessor.h.

Constructor & Destructor Documentation

◆ MsFileAccessor() [1/2]

pappso::MsFileAccessor::MsFileAccessor ( const QString &  file_name,
const QString &  xml_prefix 
)

Definition at line 35 of file msfileaccessor.cpp.

37 : m_fileName(file_name), m_xmlPrefix(xml_prefix)
38{
39 QFile file(file_name);
40 if(!file.exists())
41 throw(ExceptionNotFound(QObject::tr("File %1 not found.")
42 .arg(QFileInfo(file_name).absoluteFilePath())));
43
44
46 m_oboPsiModTermNativeIDFormat.m_name = "no nativeID format";
48 "No nativeID format indicates that the file tagged with this term does not "
49 "contain spectra that can have a nativeID format.";
50}
OboPsiModTerm m_oboPsiModTermNativeIDFormat

References pappso::OboPsiModTerm::m_accession, pappso::OboPsiModTerm::m_definition, pappso::OboPsiModTerm::m_name, and m_oboPsiModTermNativeIDFormat.

◆ MsFileAccessor() [2/2]

pappso::MsFileAccessor::MsFileAccessor ( const MsFileAccessor other)

Definition at line 53 of file msfileaccessor.cpp.

54 : m_fileName(other.m_fileName),
55 m_xmlPrefix(other.m_xmlPrefix),
56 m_fileFormat(other.m_fileFormat),
57 m_fileReaderType(other.m_fileReaderType)
58{
59 m_oboPsiModTermNativeIDFormat = other.m_oboPsiModTermNativeIDFormat;
60}
FileReaderType m_fileReaderType

References m_oboPsiModTermNativeIDFormat.

◆ ~MsFileAccessor()

pappso::MsFileAccessor::~MsFileAccessor ( )
virtual

Definition at line 62 of file msfileaccessor.cpp.

63{
64}

Member Function Documentation

◆ buildMsRunReaderSPtr() [1/2]

MsRunReaderSPtr pappso::MsFileAccessor::buildMsRunReaderSPtr ( MsRunIdCstSPtr  ms_run_id)
static

get an MsRunReader directly from a valid MsRun ID

no need to check the file format or filename : all is already part of the msrunid

Parameters
ms_run_idmsrun identifier
Returns
msrun reader shared pointer

Definition at line 507 of file msfileaccessor.cpp.

508{
510}
static MsRunReaderSPtr buildMsRunReaderSPtr(MsRunIdCstSPtr ms_run_id)
get an MsRunReader directly from a valid MsRun ID
@ tims
TimsMsRunReader : each scan is returned as a mass spectrum.

References buildMsRunReaderSPtr(), and pappso::tims.

Referenced by buildMsRunReaderSPtr().

◆ buildMsRunReaderSPtr() [2/2]

MsRunReaderSPtr pappso::MsFileAccessor::buildMsRunReaderSPtr ( MsRunIdCstSPtr  ms_run_id,
pappso::FileReaderType  preferred_file_reader_type 
)
static

get an MsRunReader directly from a valid MsRun ID

no need to check the file format or filename : all is already part of the msrunid

Parameters
ms_run_idmsrun identifier
preferred_file_reader_typethe preferred file reader type to use (depending on the mz format)
Returns
msrun reader shared pointer

Definition at line 513 of file msfileaccessor.cpp.

515{
516 QFile file(ms_run_id.get()->getFileName());
517 if(!file.exists())
518 throw(ExceptionNotFound(
519 QObject::tr("unable to build a reader : file %1 not found.")
520 .arg(QFileInfo(ms_run_id.get()->getFileName()).absoluteFilePath())));
521
522 MsDataFormat file_format = ms_run_id.get()->getMsDataFormat();
523
524 if(file_format == MsDataFormat::xy)
525 {
526 // qDebug() << "Returning a XyMsRunReader.";
527
528 return std::make_shared<XyMsRunReader>(ms_run_id);
529 }
530 else if(file_format == MsDataFormat::brukerBafAscii)
531 {
532 // qDebug() << "Returning a XyMsRunReader.";
533
534 return std::make_shared<BafAsciiMsRunReader>(ms_run_id);
535 }
536 else if(file_format == MsDataFormat::unknown)
537 {
538 throw(PappsoException(
539 QObject::tr("unable to build a reader for %1 : unknown file format")
540 .arg(QFileInfo(ms_run_id.get()->getFileName()).absoluteFilePath())));
541 }
542
543 else if(file_format == MsDataFormat::brukerTims)
544 {
545 if(preferred_file_reader_type == pappso::FileReaderType::tims)
546 {
547 return std::make_shared<TimsMsRunReader>(ms_run_id);
548 }
549 else if(preferred_file_reader_type == pappso::FileReaderType::tims_ms2)
550 {
551 return std::make_shared<TimsMsRunReaderMs2>(ms_run_id);
552 }
553 else if(preferred_file_reader_type == pappso::FileReaderType::tims_frames)
554 {
555 qDebug()
556 << "returning std::make_shared<TimsFramesMsRunReader>(ms_run_id).";
557 return std::make_shared<TimsFramesMsRunReader>(ms_run_id);
558 }
559 // qDebug() << "by default, build a TimsMsRunReader.";
560 return std::make_shared<TimsMsRunReader>(ms_run_id);
561 }
562 else
563 {
564 // qDebug() << "Returning a PwizMsRunReader .";
565 return std::make_shared<PwizMsRunReader>(ms_run_id);
566 }
567}
MsDataFormat
Definition types.h:120
@ xy
(x,y) format
@ unknown
unknown format

References pappso::brukerBafAscii, pappso::brukerTims, pappso::tims, pappso::tims_frames, pappso::tims_ms2, pappso::unknown, and pappso::xy.

◆ buildTimsMsRunReaderMs2SPtr()

TimsMsRunReaderMs2SPtr pappso::MsFileAccessor::buildTimsMsRunReaderMs2SPtr ( )

if possible, builds directly a dedicated Tims TOF tdf file reader

Definition at line 373 of file msfileaccessor.cpp.

374{
375 // try TimsData reader
376 QString tims_dir = m_fileName;
377 if(!QFileInfo(tims_dir).isDir())
378 {
379 tims_dir = QFileInfo(m_fileName).absolutePath();
380 }
381 TimsMsFileReader tims_file_reader(tims_dir);
382
383 std::vector<MsRunIdCstSPtr> ms_run_ids =
384 tims_file_reader.getMsRunIds(m_xmlPrefix);
385
386 if(ms_run_ids.size())
387 {
388 // qDebug() << "Might well be handled using the Bruker code";
390 m_fileFormat = tims_file_reader.getFileFormat();
391 m_fileName = tims_dir;
392
393 return std::make_shared<TimsMsRunReaderMs2>(ms_run_ids.front());
394 }
395 else
396 {
397 throw(ExceptionNotPossible(
398 QObject::tr("Unable to read mz data directory %1 with TimsTOF reader.")
399 .arg(tims_dir)));
400 }
401}

References pappso::TimsMsFileReader::getFileFormat(), pappso::TimsMsFileReader::getMsRunIds(), m_fileFormat, m_fileName, m_fileReaderType, m_xmlPrefix, and pappso::tims_ms2.

◆ getFileFormat()

MsDataFormat pappso::MsFileAccessor::getFileFormat ( ) const

get the raw format of mz data

Definition at line 75 of file msfileaccessor.cpp.

76{
77 return m_fileFormat;
78}

References m_fileFormat.

Referenced by pappso::TandemWrapperRun::convertOrginalMsData2mzXmlData().

◆ getFileName()

const QString & pappso::MsFileAccessor::getFileName ( ) const

Definition at line 68 of file msfileaccessor.cpp.

69{
70 return m_fileName;
71}

References m_fileName.

◆ getFileReaderType()

FileReaderType pappso::MsFileAccessor::getFileReaderType ( ) const

get the file reader type

Definition at line 353 of file msfileaccessor.cpp.

354{
355 return m_fileReaderType;
356}

References m_fileReaderType.

◆ getMsRunIds()

std::vector< MsRunIdCstSPtr > pappso::MsFileAccessor::getMsRunIds ( )

Definition at line 196 of file msfileaccessor.cpp.

197{
198 // qDebug();
199
200 // Try the PwizMsFileReader
201
202 PwizMsFileReader pwiz_ms_file_reader(m_fileName);
203
204 std::vector<MsRunIdCstSPtr> ms_run_ids =
205 pwiz_ms_file_reader.getMsRunIds(m_xmlPrefix);
206 if(ms_run_ids.size())
207 {
208 qDebug() << "Might well be handled using the Pwiz code.";
209
210 m_fileFormat = pwiz_ms_file_reader.getFileFormat();
212
213 // But the user might have configured one preferred reader type.
214
216 if(pref != m_preferredFileReaderTypeMap.end())
217 {
218 m_fileReaderType = pref->second;
219 }
220
221 return ms_run_ids;
222 }
223
224 qDebug() << "The Pwiz reader did not work.";
225
226 // Try the TimsData reader
227
228 QString tims_dir = m_fileName;
229 if(!QFileInfo(tims_dir).isDir())
230 {
231 tims_dir = QFileInfo(m_fileName).absolutePath();
232 }
233
234 TimsMsFileReader tims_file_reader(tims_dir);
235
236 ms_run_ids = tims_file_reader.getMsRunIds(m_xmlPrefix);
237
238 if(ms_run_ids.size())
239 {
240 qDebug() << "Might well be handled using the Bruker code";
241
242 m_fileName = tims_dir;
243 m_fileFormat = tims_file_reader.getFileFormat();
245
247 if(pref != m_preferredFileReaderTypeMap.end())
248 {
249 m_fileReaderType = pref->second;
250 }
251
252 qDebug() << "Returning Bruker::tims ms run(s)."
253 << "with preferred reader type:"
255
256 return ms_run_ids;
257 }
258
259 qDebug() << "The Tims reader did not work.";
260
261 // Try the Baf->ascii export format from Bruker Compass
262
263 try
264 {
265 ms_run_ids.clear();
266 BafAsciiFileReader baf_ascii_ms_file_reader(m_fileName);
267
268 ms_run_ids = baf_ascii_ms_file_reader.getMsRunIds(m_xmlPrefix);
269
270 if(ms_run_ids.size())
271 {
272 qDebug() << "Might well be handled using the BafAscii code";
273
275
276 m_fileFormat = baf_ascii_ms_file_reader.getFileFormat();
277
279 {
280 ms_run_ids.clear();
281 }
282 else
283 {
284 return ms_run_ids;
285 }
286 }
287 }
288 catch(const pappso::PappsoException &error)
289 {
290 qDebug() << "This is not a BafAscii code file" << error.qwhat();
291 }
292
293
294 qDebug() << "The BafAscii reader did not work.";
295
296 // At this point try the XyMsFileReader
297
298 XyMsFileReader xy_ms_file_reader(m_fileName);
299
300 ms_run_ids = xy_ms_file_reader.getMsRunIds(m_xmlPrefix);
301
302 if(ms_run_ids.size())
303 {
304 qDebug() << "Might well be handled using the XY code";
305
307
308 m_fileFormat = xy_ms_file_reader.getFileFormat();
309
310 return ms_run_ids;
311 }
312
313 qDebug() << "The XY reader did not work.";
314
315 return ms_run_ids;
316}
std::map< MsDataFormat, FileReaderType > m_preferredFileReaderTypeMap
virtual const QString & qwhat() const
static QString fileReaderTypeAsString(FileReaderType file_reader_type)
Definition utils.cpp:519
@ pwiz
using libpwizlite

References pappso::bafascii, pappso::Utils::fileReaderTypeAsString(), pappso::BafAsciiFileReader::getFileFormat(), pappso::PwizMsFileReader::getFileFormat(), pappso::TimsMsFileReader::getFileFormat(), pappso::XyMsFileReader::getFileFormat(), pappso::BafAsciiFileReader::getMsRunIds(), pappso::PwizMsFileReader::getMsRunIds(), pappso::TimsMsFileReader::getMsRunIds(), pappso::XyMsFileReader::getMsRunIds(), m_fileFormat, m_fileName, m_fileReaderType, m_preferredFileReaderTypeMap, m_xmlPrefix, pappso::pwiz, pappso::PappsoException::qwhat(), pappso::tims, pappso::unknown, and pappso::xy.

Referenced by pappso::TandemWrapperRun::convertOrginalMsData2mzXmlData(), getMsRunReaderSPtrByRunId(), and msRunReaderSPtr().

◆ getMsRunReaderSPtrByRunId()

MsRunReaderSPtr pappso::MsFileAccessor::getMsRunReaderSPtrByRunId ( const QString &  run_id,
const QString &  xml_id 
)

get an msrun reader by finding the run_id in file

Parameters
run_ididentifier within file of the MSrun
xml_idXML identifier given by the user to identify this MSrun in our experiment (not in the file)

Definition at line 571 of file msfileaccessor.cpp.

573{
574 std::vector<MsRunIdCstSPtr> run_list = getMsRunIds();
575 MsRunReaderSPtr reader_sp;
576 for(MsRunIdCstSPtr &original_run_id : run_list)
577 {
578 if(original_run_id.get()->getRunId() == run_id)
579 {
580 MsRunId new_run_id(*original_run_id.get());
581 new_run_id.setXmlId(xml_id);
582
583 return msRunReaderSPtr(std::make_shared<MsRunId>(new_run_id));
584 }
585 }
586
587 if((run_id.isEmpty()) && (run_list.size() == 1))
588 {
589 MsRunId new_run_id(*run_list[0].get());
590 new_run_id.setXmlId(xml_id);
591
592 return msRunReaderSPtr(std::make_shared<MsRunId>(new_run_id));
593 }
594
595
596 if(reader_sp == nullptr)
597 {
598 throw(
599 ExceptionNotFound(QObject::tr("run id %1 not found in file %2")
600 .arg(run_id)
601 .arg(QFileInfo(m_fileName).absoluteFilePath())));
602 }
603 return reader_sp;
604}
MsRunReaderSPtr msRunReaderSPtr(MsRunIdCstSPtr ms_run_id)
std::vector< MsRunIdCstSPtr > getMsRunIds()
std::shared_ptr< MsRunReader > MsRunReaderSPtr
Definition msrunreader.h:56
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46

References getMsRunIds(), m_fileName, msRunReaderSPtr(), and pappso::MsRunId::setXmlId().

◆ getOboPsiModTermFileFormat()

const OboPsiModTerm pappso::MsFileAccessor::getOboPsiModTermFileFormat ( ) const

get OboPsiModTerm corresponding to the raw format of mz data

Definition at line 81 of file msfileaccessor.cpp.

82{
83 OboPsiModTerm term;
84
85 // is_a: MS:1000560 ! mass spectrometer file format
86 switch(m_fileFormat)
87 {
89 term.m_accession = "MS:1001560";
90 term.m_name = "SCIEX TOF/TOF T2D format";
91 term.m_definition =
92 "Applied Biosystems/MDS Analytical Technologies TOF/TOF instrument "
93 "export format.";
94 break;
96 term.m_accession = "MS:1000562";
97 term.m_name = "ABI WIFF format";
98 term.m_definition = "Applied Biosystems WIFF file format.";
99 break;
101 term.m_accession = "MS:1001509";
102 term.m_name = "Agilent MassHunter format";
103 term.m_definition =
104 "A data file format found in an Agilent MassHunter directory which "
105 "contains raw data acquired by an Agilent mass spectrometer.";
106 break;
108 break;
110 term.m_accession = "MS:1000825";
111 term.m_name = "Bruker FID format";
112 term.m_definition = "Bruker FID file format.";
113 break;
115 term.m_accession = "MS:1002817";
116 term.m_name = "Bruker TDF format";
117 term.m_definition = "Bruker TDF raw file format.";
118 break;
120 term.m_accession = "MS:1000567";
121 term.m_name = "Bruker/Agilent YEP format";
122 term.m_definition = "Bruker/Agilent YEP file format.";
123 break;
125 term.m_accession = "MS:1001062";
126 term.m_name = "Mascot MGF format";
127 term.m_definition = "Mascot MGF file format.";
128 break;
130 break;
132 term.m_accession = "MS:1001881";
133 term.m_name = "mz5 format";
134 term.m_definition = "mz5 file format, modelled after mzML.";
135 break;
137 term.m_accession = "MS:1000584";
138 term.m_name = "mzML format";
139 term.m_definition =
140 "Proteomics Standards Inititative mzML file format.";
141 break;
143 term.m_accession = "MS:1000566";
144 term.m_name = "ISB mzXML format";
145 term.m_definition = "Institute of Systems Biology mzXML file format.";
146 break;
148 break;
150
151 term.m_accession = "MS:1000563";
152 term.m_name = "Thermo RAW format";
153 term.m_definition = "Thermo Scientific RAW file format.";
154 break;
156 break;
158 term.m_accession = "MS:1000526";
159 term.m_name = "Waters raw format";
160 term.m_definition =
161 "Waters data file format found in a Waters RAW directory, generated "
162 "from an MS acquisition.";
163 break;
165 term.m_accession = "MS:1001369";
166 term.m_name = "BafAscii text format";
167 term.m_definition =
168 "Simple text file format obtained by exporting Bruker Baf to ascii "
169 "using Bruker software";
170 break;
171 case MsDataFormat::xy:
172 term.m_accession = "MS:1001369";
173 term.m_name = "text format";
174 term.m_definition =
175 "Simple text file format of \"m/z<separator>intensity\" value pairs "
176 "for a single mass spectrum, a PMF (or single MS2) search.";
177 break;
178 default:
179 break;
180 }
181
182 return term;
183}
@ SQLite3
SQLite3 format.
@ MGF
Mascot format.

References pappso::abSciexT2D, pappso::abSciexWiff, pappso::agilentMassHunter, pappso::brukerBaf, pappso::brukerBafAscii, pappso::brukerFid, pappso::brukerTims, pappso::brukerYep, pappso::OboPsiModTerm::m_accession, pappso::OboPsiModTerm::m_definition, m_fileFormat, pappso::OboPsiModTerm::m_name, pappso::MGF, pappso::msn, pappso::mz5, pappso::mzML, pappso::mzXML, pappso::SQLite3, pappso::thermoRaw, pappso::unknown, pappso::watersRaw, and pappso::xy.

◆ getOboPsiModTermNativeIDFormat()

const OboPsiModTerm & pappso::MsFileAccessor::getOboPsiModTermNativeIDFormat ( ) const

get OboPsiModTerm corresponding to the nativeID format format of mz data

Definition at line 187 of file msfileaccessor.cpp.

188{
189
190
192}

References m_oboPsiModTermNativeIDFormat.

◆ getpreferredFileReaderType()

FileReaderType pappso::MsFileAccessor::getpreferredFileReaderType ( MsDataFormat  format)

Definition at line 337 of file msfileaccessor.cpp.

338{
339 // qDebug();
340
341 auto ret = m_preferredFileReaderTypeMap.find(format);
342
343 if(ret != m_preferredFileReaderTypeMap.end())
344 {
345 return ret->second;
346 }
347
348 return m_fileReaderType;
349}

References m_fileReaderType, and m_preferredFileReaderTypeMap.

Referenced by msRunReaderSPtr().

◆ getSelectedMsRunId()

MsRunIdCstSPtr pappso::MsFileAccessor::getSelectedMsRunId ( ) const

Definition at line 367 of file msfileaccessor.cpp.

368{
370}
MsRunIdCstSPtr mcsp_selectedMsRunId

References mcsp_selectedMsRunId.

◆ msRunReaderSPtr() [1/2]

MsRunReaderSPtr pappso::MsFileAccessor::msRunReaderSPtr ( MsRunIdCstSPtr  ms_run_id)

Definition at line 405 of file msfileaccessor.cpp.

406{
407 // qDebug();
408
409 // We want to return a MsRunReader that accounts for the configuration that
410 // the user might have set.
411
412 if(m_fileName != ms_run_id->getFileName())
413 throw(ExceptionNotPossible(
414 QObject::tr("The MsRunId instance must have the name file name as the "
415 "MsFileAccessor.")));
416
418 {
419 // qDebug() << "Returning a PwizMsRunReader.";
420 auto pwiz_reader = std::make_shared<PwizMsRunReader>(ms_run_id);
422 pwiz_reader->getOboPsiModTermNativeIDFormat();
423 return pwiz_reader;
424 }
426 {
427 // qDebug() << "Returning a XyMsRunReader.";
428
429 return std::make_shared<XyMsRunReader>(ms_run_id);
430 }
432 {
433 // qDebug() << "Returning a TimsMsRunReader.";
434
435 return std::make_shared<TimsMsRunReader>(ms_run_id);
436 }
439 {
440 // qDebug() << "Returning a TimsFramesMsRunReader.";
441
442 return std::make_shared<TimsFramesMsRunReader>(ms_run_id);
443 }
445 {
446 // qDebug() << "Returning a TimsMsRunReaderMs2.";
447
448 return std::make_shared<TimsMsRunReaderMs2>(ms_run_id);
449 }
451 {
452 // qDebug() << "Returning a TimsMsRunReaderMs2.";
453
454 //qInfo() << "std::make_shared<TimsMsRunReaderDia>(ms_run_id);";
455 return std::make_shared<TimsMsRunReaderDia>(ms_run_id);
456 }
458 {
459 // qDebug() << "Returning a BafAsciiMsRunReader.";
460
461 return std::make_shared<BafAsciiMsRunReader>(ms_run_id);
462 }
464 {
465 if(ms_run_id.get()->getMsDataFormat() == MsDataFormat::xy)
466 {
467 return std::make_shared<XyMsRunReader>(ms_run_id);
468 }
469 else
470 {
471 auto pwiz_reader = std::make_shared<PwizMsRunReader>(ms_run_id);
473 pwiz_reader->getOboPsiModTermNativeIDFormat();
474 return pwiz_reader;
475 }
476 }
477 else
478 {
479 throw PappsoException(QObject::tr("No file format was found."));
480 }
481
482 return nullptr;
483}
FileReaderType getpreferredFileReaderType(MsDataFormat format)

References pappso::bafascii, getpreferredFileReaderType(), m_fileFormat, m_fileName, m_oboPsiModTermNativeIDFormat, pappso::pwiz, pappso::tims, pappso::tims_dia, pappso::tims_frames, pappso::tims_ms2, pappso::unknown, and pappso::xy.

Referenced by pappso::TandemWrapperRun::convertOrginalMsData2mzXmlData(), getMsRunReaderSPtrByRunId(), msRunReaderSPtr(), and msRunReaderSPtrForSelectedMsRunId().

◆ msRunReaderSPtr() [2/2]

MsRunReaderSPtr pappso::MsFileAccessor::msRunReaderSPtr ( std::size_t  ms_run_id_index)

Definition at line 487 of file msfileaccessor.cpp.

488{
489 std::vector<MsRunIdCstSPtr> ms_run_ids = getMsRunIds();
490 if(ms_run_id_index >= ms_run_ids.size())
491 throw PappsoException(QObject::tr("MsRunId request out-of-bound error."));
492
493 return msRunReaderSPtr(ms_run_ids.at(ms_run_id_index));
494}

References getMsRunIds(), and msRunReaderSPtr().

◆ msRunReaderSPtrForSelectedMsRunId()

MsRunReaderSPtr pappso::MsFileAccessor::msRunReaderSPtrForSelectedMsRunId ( )

Definition at line 498 of file msfileaccessor.cpp.

499{
500 // qDebug();
501
503}

References mcsp_selectedMsRunId, and msRunReaderSPtr().

◆ setPreferredFileReaderType()

void pappso::MsFileAccessor::setPreferredFileReaderType ( MsDataFormat  format,
FileReaderType  reader_type 
)

given an mz format, explicitly set the preferred reader

Definition at line 320 of file msfileaccessor.cpp.

322{
323 // qDebug();
324
325 auto ret = m_preferredFileReaderTypeMap.insert(
326 std::pair<MsDataFormat, FileReaderType>(format, reader_type));
327
328 if(!ret.second)
329 {
330 // replace
331 ret.first->second = reader_type;
332 }
333}

References m_preferredFileReaderTypeMap.

Referenced by pappso::TandemWrapperRun::convertOrginalMsData2mzXmlData().

◆ setSelectedMsRunId()

void pappso::MsFileAccessor::setSelectedMsRunId ( MsRunIdCstSPtr  ms_run_id_csp)

Definition at line 360 of file msfileaccessor.cpp.

361{
362 mcsp_selectedMsRunId = ms_run_id_csp;
363}

References mcsp_selectedMsRunId.

Member Data Documentation

◆ m_fileFormat

MsDataFormat pappso::MsFileAccessor::m_fileFormat = MsDataFormat::unknown
private

◆ m_fileName

QString pappso::MsFileAccessor::m_fileName
private

◆ m_fileReaderType

FileReaderType pappso::MsFileAccessor::m_fileReaderType
private

◆ m_oboPsiModTermNativeIDFormat

OboPsiModTerm pappso::MsFileAccessor::m_oboPsiModTermNativeIDFormat
private

◆ m_preferredFileReaderTypeMap

std::map<MsDataFormat, FileReaderType> pappso::MsFileAccessor::m_preferredFileReaderTypeMap
private

◆ m_xmlPrefix

const QString pappso::MsFileAccessor::m_xmlPrefix
private

Definition at line 113 of file msfileaccessor.h.

Referenced by buildTimsMsRunReaderMs2SPtr(), and getMsRunIds().

◆ mcsp_selectedMsRunId

MsRunIdCstSPtr pappso::MsFileAccessor::mcsp_selectedMsRunId = nullptr
private

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