OpenMS
CachedSwathFileConsumer Class Reference

On-disk cached implementation of FullSwathFileConsumer. More...

#include <OpenMS/FORMAT/DATAACCESS/SwathFileConsumer.h>

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

Public Types

typedef PeakMap MapType
 
typedef MapType::SpectrumType SpectrumType
 
typedef MapType::ChromatogramType ChromatogramType
 
- Public Types inherited from FullSwathFileConsumer
typedef PeakMap MapType
 
typedef MapType::SpectrumType SpectrumType
 
typedef MapType::ChromatogramType ChromatogramType
 
- Public Types inherited from IMSDataConsumer
typedef MSSpectrum SpectrumType
 
typedef MSChromatogram ChromatogramType
 

Public Member Functions

 CachedSwathFileConsumer (String cachedir, String basename, Size nr_ms1_spectra, std::vector< int > nr_ms2_spectra)
 
 CachedSwathFileConsumer (std::vector< OpenSwath::SwathMap > known_window_boundaries, String cachedir, String basename, Size nr_ms1_spectra, std::vector< int > nr_ms2_spectra)
 
 ~CachedSwathFileConsumer () override
 
- Public Member Functions inherited from FullSwathFileConsumer
 FullSwathFileConsumer ()
 
 FullSwathFileConsumer (std::vector< OpenSwath::SwathMap > swath_boundaries)
 Constructor. More...
 
 ~FullSwathFileConsumer () override
 
void setExpectedSize (Size, Size) override
 Set expected size of spectra and chromatograms to be consumed. More...
 
void setExperimentalSettings (const ExperimentalSettings &exp) override
 Set experimental settings (meta-data) of the data to be consumed. More...
 
void retrieveSwathMaps (std::vector< OpenSwath::SwathMap > &maps)
 Populate the vector of swath maps after consuming all spectra. More...
 
void consumeChromatogram (MapType::ChromatogramType &) override
 Consume a chromatogram -> should not happen when dealing with SWATH maps. More...
 
void consumeSpectrum (MapType::SpectrumType &s) override
 
  • Consume a spectrum which may belong either to an MS1 scan or one of n MS2 (SWATH) scans
More...
 
- Public Member Functions inherited from IMSDataConsumer
virtual ~IMSDataConsumer ()
 

Protected Member Functions

void addNewSwathMap_ ()
 
void consumeSwathSpectrum_ (MapType::SpectrumType &s, size_t swath_nr) override
 Consume an MS2 spectrum belonging to SWATH "swath_nr". More...
 
void addMS1Map_ ()
 
void consumeMS1Spectrum_ (MapType::SpectrumType &s) override
 Consume an MS1 spectrum. More...
 
void ensureMapsAreFilled_ () override
 Callback function after the reading is complete. More...
 

Protected Attributes

MSDataCachedConsumerms1_consumer_
 
std::vector< MSDataCachedConsumer * > swath_consumers_
 
String cachedir_
 
String basename_
 
int nr_ms1_spectra_
 
std::vector< int > nr_ms2_spectra_
 
- Protected Attributes inherited from FullSwathFileConsumer
std::vector< OpenSwath::SwathMapswath_map_boundaries_
 A list of Swath map identifiers (lower/upper boundary and center) More...
 
std::vector< boost::shared_ptr< PeakMap > > swath_maps_
 A list of SWATH maps and the MS1 map. More...
 
boost::shared_ptr< PeakMapms1_map_
 
PeakMap settings_
 The Experimental settings. More...
 
bool consuming_possible_
 Whether further spectra can still be consumed. More...
 
bool use_external_boundaries_
 Whether to use external input for SWATH boundaries. More...
 
size_t correct_window_counter_
 How many windows were correctly annotated (non-zero window limits) More...
 

Detailed Description

On-disk cached implementation of FullSwathFileConsumer.

Writes all spectra immediately to disk in a user-specified caching location using the MSDataCachedConsumer. Internally, it handles n+1 (n SWATH + 1 MS1 map) objects of MSDataCachedConsumer which can consume the spectra and write them to disk immediately.

Member Typedef Documentation

◆ ChromatogramType

◆ MapType

typedef PeakMap MapType

◆ SpectrumType

Constructor & Destructor Documentation

◆ CachedSwathFileConsumer() [1/2]

CachedSwathFileConsumer ( String  cachedir,
String  basename,
Size  nr_ms1_spectra,
std::vector< int >  nr_ms2_spectra 
)
inline

◆ CachedSwathFileConsumer() [2/2]

CachedSwathFileConsumer ( std::vector< OpenSwath::SwathMap known_window_boundaries,
String  cachedir,
String  basename,
Size  nr_ms1_spectra,
std::vector< int >  nr_ms2_spectra 
)
inline

◆ ~CachedSwathFileConsumer()

~CachedSwathFileConsumer ( )
inlineoverride

Member Function Documentation

◆ addMS1Map_()

void addMS1Map_ ( )
inlineprotected

◆ addNewSwathMap_()

void addNewSwathMap_ ( )
inlineprotected

◆ consumeMS1Spectrum_()

void consumeMS1Spectrum_ ( MapType::SpectrumType s)
inlineoverrideprotectedvirtual

Consume an MS1 spectrum.

This function should handle an MS1 spectrum.

Implements FullSwathFileConsumer.

◆ consumeSwathSpectrum_()

void consumeSwathSpectrum_ ( MapType::SpectrumType s,
size_t  swath_nr 
)
inlineoverrideprotectedvirtual

Consume an MS2 spectrum belonging to SWATH "swath_nr".

This function should handle a spectrum belonging to a specific SWATH (indicated by swath_nr).

Implements FullSwathFileConsumer.

◆ ensureMapsAreFilled_()

void ensureMapsAreFilled_ ( )
inlineoverrideprotectedvirtual

Callback function after the reading is complete.

Has to ensure that swath_maps_ and ms1_map_ are correctly populated.

Implements FullSwathFileConsumer.

References FileHandler::loadExperiment(), and CachedMzMLHandler::writeMetadata().

Member Data Documentation

◆ basename_

String basename_
protected

◆ cachedir_

String cachedir_
protected

◆ ms1_consumer_

MSDataCachedConsumer* ms1_consumer_
protected

◆ nr_ms1_spectra_

int nr_ms1_spectra_
protected

◆ nr_ms2_spectra_

std::vector<int> nr_ms2_spectra_
protected

◆ swath_consumers_

std::vector<MSDataCachedConsumer*> swath_consumers_
protected