OpenMS
|
Abstract base class which can consume spectra coming from SWATH experiment stored in a single file. More...
#include <OpenMS/FORMAT/DATAACCESS/SwathFileConsumer.h>
Public Types | |
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 | |
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 | |
virtual void | consumeSwathSpectrum_ (MapType::SpectrumType &s, size_t swath_nr)=0 |
Consume an MS2 spectrum belonging to SWATH "swath_nr". More... | |
virtual void | consumeMS1Spectrum_ (MapType::SpectrumType &s)=0 |
Consume an MS1 spectrum. More... | |
virtual void | ensureMapsAreFilled_ ()=0 |
Callback function after the reading is complete. More... | |
Protected Attributes | |
std::vector< OpenSwath::SwathMap > | swath_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< PeakMap > | ms1_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... | |
Abstract base class which can consume spectra coming from SWATH experiment stored in a single file.
The class consumes spectra which are coming from a complete SWATH experiment. It will group MS2 spectra by their precursor m/z, assuming that they correspond to the same SWATH window. For example, the spectra could be arranged in the following fashion:
Base classes are expected to implement functions consuming a spectrum coming from a specific SWATH or an MS1 spectrum and a final function ensureMapsAreFilled_ after which the swath_maps_ vector needs to contain valid pointers to MSExperiment.
In addition it is possible to provide the swath boundaries and the read in spectra will be matched by their precursor m/z to the "center" attribute of the provided Swath maps.
Usage:
typedef MapType::SpectrumType SpectrumType |
|
inline |
|
inline |
Constructor.
swath_boundaries | A vector of SwathMaps of which only the center, lower and upper attributes will be used to infer the expected Swath maps. |
|
inlineoverride |
|
inlineoverridevirtual |
Consume a chromatogram -> should not happen when dealing with SWATH maps.
Implements IMSDataConsumer.
|
protectedpure virtual |
Consume an MS1 spectrum.
This function should handle an MS1 spectrum.
Implemented in MzMLSwathFileConsumer, CachedSwathFileConsumer, and RegularSwathFileConsumer.
|
inlineoverridevirtual |
* Consume a spectrum which may belong either to an MS1 scan or one of n MS2 (SWATH) scans
Implements IMSDataConsumer.
References SwathMap::center, MetaInfoInterface::getMetaValue(), MSSpectrum::getMSLevel(), SpectrumSettings::getPrecursors(), SwathMap::imLower, SwathMap::imUpper, SwathMap::lower, MetaInfoInterface::metaValueExists(), OPENMS_LOG_DEBUG, and SwathMap::upper.
|
protectedpure virtual |
Consume an MS2 spectrum belonging to SWATH "swath_nr".
This function should handle a spectrum belonging to a specific SWATH (indicated by swath_nr).
Implemented in MzMLSwathFileConsumer, CachedSwathFileConsumer, and RegularSwathFileConsumer.
|
protectedpure virtual |
Callback function after the reading is complete.
Has to ensure that swath_maps_ and ms1_map_ are correctly populated.
Implemented in MzMLSwathFileConsumer, CachedSwathFileConsumer, and RegularSwathFileConsumer.
|
inline |
Populate the vector of swath maps after consuming all spectra.
Will populate the input vector with SwathMap objects which correspond to the MS1 map (if present) and the MS2 maps (SWATH maps). This should be called after all spectra are consumed.
References SwathMap::center, SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr(), SwathMap::imLower, SwathMap::imUpper, SwathMap::lower, SwathMap::ms1, SwathMap::sptr, and SwathMap::upper.
Set expected size of spectra and chromatograms to be consumed.
Some implementations might care about the number of spectra and chromatograms to be consumed and need to be informed about this (usually before consuming starts).
expectedSpectra | Number of spectra expected |
expectedChromatograms | Number of chromatograms expected |
Implements IMSDataConsumer.
|
inlineoverridevirtual |
Set experimental settings (meta-data) of the data to be consumed.
Some implementations might need to know about the meta-data (or the context) of the spectra and chromatograms to be consumed. This method allows them learn this.
exp | Experimental settings meta data for the data to be consumed |
Implements IMSDataConsumer.
|
protected |
Whether further spectra can still be consumed.
|
protected |
How many windows were correctly annotated (non-zero window limits)
|
protected |
|
protected |
The Experimental settings.
|
protected |
A list of Swath map identifiers (lower/upper boundary and center)
|
protected |
A list of SWATH maps and the MS1 map.
|
protected |
Whether to use external input for SWATH boundaries.