OpenMS
Loading...
Searching...
No Matches
SwathFile Class Reference

File adapter for Swath files. More...

#include <OpenMS/FORMAT/SwathFile.h>

Inheritance diagram for SwathFile:
[legend]
Collaboration diagram for SwathFile:
[legend]

Public Member Functions

std::vector< OpenSwath::SwathMaploadSplit (StringList file_list, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal")
 Loads a Swath run from a list of split mzML files.
 
std::vector< OpenSwath::SwathMaploadMzML (const std::string &file, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal", Interfaces::IMSDataConsumer *plugin_consumer=nullptr)
 Loads a Swath run from a single mzML file.
 
std::vector< OpenSwath::SwathMaploadFromMSExperiment (const std::shared_ptr< PeakMap > &exp, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal")
 Loads a Swath run from a pre-loaded in-memory MSExperiment.
 
std::vector< OpenSwath::SwathMaploadMzXML (const std::string &file, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal")
 Loads a Swath run from a single mzXML file.
 
std::vector< OpenSwath::SwathMaploadSqMass (const std::string &file, std::shared_ptr< ExperimentalSettings > &)
 Loads a Swath run from a single sqMass file.
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor.
 
virtual ~ProgressLogger ()
 Destructor.
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor.
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator.
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE!
 
LogType getLogType () const
 Returns the type of progress log being used.
 
void setLogger (ProgressLoggerImpl *logger)
 Sets the logger to be used for progress logging.
 
void startProgress (SignedSize begin, SignedSize end, const std::string &label) const
 Initializes the progress display.
 
void setProgress (SignedSize value) const
 Sets the current progress.
 
void endProgress (UInt64 bytes_processed=0) const
 
void nextProgress () const
 increment progress by 1 (according to range begin-end)
 

Protected Member Functions

OpenSwath::SpectrumAccessPtr doCacheFile_ (const std::string &in, const std::string &tmp, const std::string &tmp_fname, const std::shared_ptr< PeakMap > &experiment_metadata)
 Cache a file to disk.
 
std::shared_ptr< PeakMappopulateMetaData_ (const std::string &file)
 Only read the meta data from a file and use it to populate exp_meta.
 
void countScansInSwath_ (const std::vector< MSSpectrum > &exp, std::vector< int > &swath_counter, int &nr_ms1_spectra, std::vector< OpenSwath::SwathMap > &known_window_boundaries, double TOLERANCE=1e-6)
 Counts the number of scans in a full Swath file (e.g. concatenated non-split file)
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

File adapter for Swath files.

This class can load SWATH files in different storage versions. The most convenient file is a single MzML file which contains one experiment. However, also the loading of a list of files is supported (loadSplit) where it is assumed that each individual file only contains scans from one precursor isolation window (one SWATH). Finally, experimental support for mzXML is available but needs to be selected with a specific compile flag (this is not for everyday use).

Member Function Documentation

◆ countScansInSwath_()

void countScansInSwath_ ( const std::vector< MSSpectrum > &  exp,
std::vector< int > &  swath_counter,
int &  nr_ms1_spectra,
std::vector< OpenSwath::SwathMap > &  known_window_boundaries,
double  TOLERANCE = 1e-6 
)
protected

Counts the number of scans in a full Swath file (e.g. concatenated non-split file)

◆ doCacheFile_()

OpenSwath::SpectrumAccessPtr doCacheFile_ ( const std::string &  in,
const std::string &  tmp,
const std::string &  tmp_fname,
const std::shared_ptr< PeakMap > &  experiment_metadata 
)
protected

Cache a file to disk.

◆ loadFromMSExperiment()

std::vector< OpenSwath::SwathMap > loadFromMSExperiment ( const std::shared_ptr< PeakMap > &  exp,
const std::string &  tmp,
std::shared_ptr< ExperimentalSettings > &  exp_meta,
const std::string &  readoptions = "normal" 
)

Loads a Swath run from a pre-loaded in-memory MSExperiment.

Used when the input format does not have a streaming reader (e.g. Thermo .raw via openms-thermo-bridge), so the full experiment has already been materialized. Avoids the round-trip through a temporary mzML file.

Parameters
[in]expThe pre-loaded experiment (must contain all spectra and metadata)
[in]tmpTemporary directory (used only for readoptions=="cache")
[out]exp_metaExperimentalSettings extracted from exp
[in]readoptions"normal" (in-memory) or "cache" (disk-cached)
Returns
Swath maps for MS2 and MS1

◆ loadMzML()

std::vector< OpenSwath::SwathMap > loadMzML ( const std::string &  file,
const std::string &  tmp,
std::shared_ptr< ExperimentalSettings > &  exp_meta,
const std::string &  readoptions = "normal",
Interfaces::IMSDataConsumer plugin_consumer = nullptr 
)

Loads a Swath run from a single mzML file.

Using the plugin_consumer, you can provide a custom consumer which will be chained into the process of loading the data and making it available (depending on readoptions). This is useful if you want to modify the data a priori or extract some other information using MSDataTransformingConsumer (for example). Make sure it leaves the data intact, such that the returned SwathMaps are actually useful.

Parameters
[in]fileInput filename
[in]tmpTemporary directory (for cached data)
[out]exp_metaExperimental metadata from mzML file
[in]readoptionsHow are spectra accessed after reading - tradeoff between memory usage and time (disk caching)
[in]plugin_consumerAn intermediate custom consumer
Returns
Swath maps for MS2 and MS1 (unless readoptions == split, which returns no data)

◆ loadMzXML()

std::vector< OpenSwath::SwathMap > loadMzXML ( const std::string &  file,
const std::string &  tmp,
std::shared_ptr< ExperimentalSettings > &  exp_meta,
const std::string &  readoptions = "normal" 
)

Loads a Swath run from a single mzXML file.

◆ loadSplit()

std::vector< OpenSwath::SwathMap > loadSplit ( StringList  file_list,
const std::string &  tmp,
std::shared_ptr< ExperimentalSettings > &  exp_meta,
const std::string &  readoptions = "normal" 
)

Loads a Swath run from a list of split mzML files.

◆ loadSqMass()

std::vector< OpenSwath::SwathMap > loadSqMass ( const std::string &  file,
std::shared_ptr< ExperimentalSettings > &   
)

Loads a Swath run from a single sqMass file.

◆ populateMetaData_()

std::shared_ptr< PeakMap > populateMetaData_ ( const std::string &  file)
protected

Only read the meta data from a file and use it to populate exp_meta.