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 34 of file msfileaccessor.cpp.

36 : m_fileName(file_name), m_xmlPrefix(xml_prefix)
37{
38 QFile file(file_name);
39 if(!file.exists())
40 throw(ExceptionNotFound(QObject::tr("File %1 not found.")
41 .arg(QFileInfo(file_name).absoluteFilePath())));
42
43
45 m_oboPsiModTermNativeIDFormat.m_name = "no nativeID format";
47 "No nativeID format indicates that the file tagged with this term does not "
48 "contain spectra that can have a nativeID format.";
49}
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 52 of file msfileaccessor.cpp.

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

References m_oboPsiModTermNativeIDFormat.

◆ ~MsFileAccessor()

pappso::MsFileAccessor::~MsFileAccessor ( )
virtual

Definition at line 61 of file msfileaccessor.cpp.

62{
63}

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 499 of file msfileaccessor.cpp.

500{
502}
static MsRunReaderSPtr buildMsRunReaderSPtr(MsRunIdCstSPtr ms_run_id)
get an MsRunReader directly from a valid MsRun ID

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 505 of file msfileaccessor.cpp.

507{
508 QFile file(ms_run_id.get()->getFileName());
509 if(!file.exists())
510 throw(ExceptionNotFound(
511 QObject::tr("unable to build a reader : file %1 not found.")
512 .arg(QFileInfo(ms_run_id.get()->getFileName()).absoluteFilePath())));
513
514 MsDataFormat file_format = ms_run_id.get()->getMsDataFormat();
515
516 if(file_format == MsDataFormat::xy)
517 {
518 // qDebug() << "Returning a XyMsRunReader.";
519
520 return std::make_shared<XyMsRunReader>(ms_run_id);
521 }
522 else if(file_format == MsDataFormat::brukerBafAscii)
523 {
524 // qDebug() << "Returning a XyMsRunReader.";
525
526 return std::make_shared<BafAsciiMsRunReader>(ms_run_id);
527 }
528 else if(file_format == MsDataFormat::unknown)
529 {
530 throw(PappsoException(
531 QObject::tr("unable to build a reader for %1 : unknown file format")
532 .arg(QFileInfo(ms_run_id.get()->getFileName()).absoluteFilePath())));
533 }
534
535 else if(file_format == MsDataFormat::brukerTims)
536 {
537 if(preferred_file_reader_type == pappso::FileReaderType::tims)
538 {
539 return std::make_shared<TimsMsRunReader>(ms_run_id);
540 }
541 else if(preferred_file_reader_type == pappso::FileReaderType::tims_ms2)
542 {
543 return std::make_shared<TimsMsRunReaderMs2>(ms_run_id);
544 }
545 else if(preferred_file_reader_type == pappso::FileReaderType::tims_frames)
546 {
547 qDebug()
548 << "returning std::make_shared<TimsFramesMsRunReader>(ms_run_id).";
549 return std::make_shared<TimsFramesMsRunReader>(ms_run_id);
550 }
551 // qDebug() << "by default, build a TimsMsRunReader.";
552 return std::make_shared<TimsMsRunReader>(ms_run_id);
553 }
554 else
555 {
556 // qDebug() << "Returning a PwizMsRunReader .";
557 return std::make_shared<PwizMsRunReader>(ms_run_id);
558 }
559}
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 372 of file msfileaccessor.cpp.

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

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 74 of file msfileaccessor.cpp.

75{
76 return m_fileFormat;
77}

References m_fileFormat.

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

◆ getFileName()

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

Definition at line 67 of file msfileaccessor.cpp.

68{
69 return m_fileName;
70}

References m_fileName.

◆ getFileReaderType()

FileReaderType pappso::MsFileAccessor::getFileReaderType ( ) const

get the file reader type

Definition at line 352 of file msfileaccessor.cpp.

353{
354 return m_fileReaderType;
355}

References m_fileReaderType.

◆ getMsRunIds()

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

Definition at line 195 of file msfileaccessor.cpp.

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

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 563 of file msfileaccessor.cpp.

565{
566 std::vector<MsRunIdCstSPtr> run_list = getMsRunIds();
567 MsRunReaderSPtr reader_sp;
568 for(MsRunIdCstSPtr &original_run_id : run_list)
569 {
570 if(original_run_id.get()->getRunId() == run_id)
571 {
572 MsRunId new_run_id(*original_run_id.get());
573 new_run_id.setXmlId(xml_id);
574
575 return msRunReaderSPtr(std::make_shared<MsRunId>(new_run_id));
576 }
577 }
578
579 if((run_id.isEmpty()) && (run_list.size() == 1))
580 {
581 MsRunId new_run_id(*run_list[0].get());
582 new_run_id.setXmlId(xml_id);
583
584 return msRunReaderSPtr(std::make_shared<MsRunId>(new_run_id));
585 }
586
587
588 if(reader_sp == nullptr)
589 {
590 throw(
591 ExceptionNotFound(QObject::tr("run id %1 not found in file %2")
592 .arg(run_id)
593 .arg(QFileInfo(m_fileName).absoluteFilePath())));
594 }
595 return reader_sp;
596}
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 80 of file msfileaccessor.cpp.

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

187{
188
189
191}

References m_oboPsiModTermNativeIDFormat.

◆ getpreferredFileReaderType()

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

Definition at line 336 of file msfileaccessor.cpp.

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

References m_fileReaderType, and m_preferredFileReaderTypeMap.

Referenced by msRunReaderSPtr().

◆ getSelectedMsRunId()

MsRunIdCstSPtr pappso::MsFileAccessor::getSelectedMsRunId ( ) const

Definition at line 366 of file msfileaccessor.cpp.

367{
369}
MsRunIdCstSPtr mcsp_selectedMsRunId

References mcsp_selectedMsRunId.

◆ msRunReaderSPtr() [1/2]

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

Definition at line 404 of file msfileaccessor.cpp.

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

References pappso::bafascii, getpreferredFileReaderType(), m_fileFormat, m_fileName, m_oboPsiModTermNativeIDFormat, pappso::pwiz, pappso::tims, 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 479 of file msfileaccessor.cpp.

480{
481 std::vector<MsRunIdCstSPtr> ms_run_ids = getMsRunIds();
482 if(ms_run_id_index >= ms_run_ids.size())
483 throw PappsoException(QObject::tr("MsRunId request out-of-bound error."));
484
485 return msRunReaderSPtr(ms_run_ids.at(ms_run_id_index));
486}

References getMsRunIds(), and msRunReaderSPtr().

◆ msRunReaderSPtrForSelectedMsRunId()

MsRunReaderSPtr pappso::MsFileAccessor::msRunReaderSPtrForSelectedMsRunId ( )

Definition at line 490 of file msfileaccessor.cpp.

491{
492 // qDebug();
493
495}

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 319 of file msfileaccessor.cpp.

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

References m_preferredFileReaderTypeMap.

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

◆ setSelectedMsRunId()

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

Definition at line 359 of file msfileaccessor.cpp.

360{
361 mcsp_selectedMsRunId = ms_run_id_csp;
362}

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: