![]() |
OpenMS
|
Representation of a mass spectrometry experiment on disk. More...
#include <OpenMS/KERNEL/OnDiscMSExperiment.h>
Public Member Functions | |
| OnDiscMSExperiment ()=default | |
| Constructor. | |
| bool | openFile (const String &filename, bool skipMetaData=false) |
| Open a specific file on disk. | |
| OnDiscMSExperiment (const OnDiscMSExperiment &source) | |
| Copy constructor. | |
| bool | operator== (const OnDiscMSExperiment &rhs) const |
| Equality operator. | |
| bool | operator!= (const OnDiscMSExperiment &rhs) const |
| Inequality operator. | |
| bool | isSortedByRT () const |
| Checks if all spectra are sorted with respect to ascending RT. | |
| Size | size () const |
| alias for getNrSpectra | |
| bool | empty () const |
| returns whether spectra are empty | |
| Size | getNrSpectra () const |
| get the total number of spectra available | |
| Size | getNrChromatograms () const |
| get the total number of chromatograms available | |
| std::shared_ptr< const ExperimentalSettings > | getExperimentalSettings () const |
| returns the meta information of this experiment (const access) | |
| std::shared_ptr< PeakMap > | getMetaData () const |
| MSSpectrum | operator[] (Size n) |
| alias for getSpectrum | |
| MSSpectrum | getSpectrum (Size id) |
| returns a single spectrum | |
| OpenMS::Interfaces::SpectrumPtr | getSpectrumById (Size id) |
| returns a single spectrum (without applying PeakFileOptions filters) | |
| MSChromatogram | getChromatogram (Size id) |
| returns a single chromatogram | |
| MSChromatogram | getChromatogramByNativeId (const std::string &id) |
| returns a single chromatogram | |
| MSSpectrum | getSpectrumByNativeId (const std::string &id) |
| returns a single spectrum | |
| OpenMS::Interfaces::ChromatogramPtr | getChromatogramById (Size id) |
| returns a single chromatogram | |
| void | setSkipXMLChecks (bool skip) |
| sets whether to skip some XML checks and be fast instead | |
| PeakFileOptions & | getOptions () |
| Mutable access to the options for loading/storing. | |
| const PeakFileOptions & | getOptions () const |
| Non-mutable access to the options for loading/storing. | |
| void | setOptions (const PeakFileOptions &options) |
| set options for loading/storing | |
Protected Attributes | |
| String | filename_ |
| The filename of the underlying data file. | |
| Internal::IndexedMzMLHandler | indexed_mzml_file_ |
| The index of the underlying data file. | |
| std::shared_ptr< PeakMap > | meta_ms_experiment_ |
| The meta-data. | |
| std::unordered_map< std::string, Size > | chromatograms_native_ids_ |
| Mapping of chromatogram native ids to offsets. | |
| std::unordered_map< std::string, Size > | spectra_native_ids_ |
| Mapping of spectra native ids to offsets. | |
| PeakFileOptions | options_ |
| Options for loading / storing. | |
Private Types | |
| typedef ChromatogramPeak | ChromatogramPeakT |
| typedef Peak1D | PeakT |
Private Member Functions | |
| OnDiscMSExperiment & | operator= (const OnDiscMSExperiment &) |
| Private Assignment operator -> we cannot copy file streams in IndexedMzMLHandler. | |
| void | loadMetaData_ (const String &filename) |
| MSChromatogram | getMetaChromatogramById_ (const std::string &id) |
| MSSpectrum | getMetaSpectrumById_ (const std::string &id) |
Representation of a mass spectrometry experiment on disk.
This class allows random access to spectra and chromatograms in indexed mzML files without loading the entire file into memory.
PeakFileOptions can be used to filter data when retrieving spectra/chromatograms:
Example:
|
private |
|
default |
Constructor.
This initializes the object, use openFile to open a file.
|
inline |
Copy constructor.
|
inline |
returns whether spectra are empty
| MSChromatogram getChromatogram | ( | Size | id | ) |
returns a single chromatogram
If PeakFileOptions has RT or intensity range set, the chromatogram will be filtered accordingly.
| [in] | id | The index of the chromatogram |
| OpenMS::Interfaces::ChromatogramPtr getChromatogramById | ( | Size | id | ) |
returns a single chromatogram
| MSChromatogram getChromatogramByNativeId | ( | const std::string & | id | ) |
returns a single chromatogram
| [in] | id | The native identifier of the chromatogram |
|
inline |
returns the meta information of this experiment (const access)
|
private |
|
inline |
|
private |
|
inline |
get the total number of chromatograms available
|
inline |
get the total number of spectra available
| PeakFileOptions & getOptions | ( | ) |
Mutable access to the options for loading/storing.
| const PeakFileOptions & getOptions | ( | ) | const |
Non-mutable access to the options for loading/storing.
| MSSpectrum getSpectrum | ( | Size | id | ) |
returns a single spectrum
If PeakFileOptions has m/z or intensity range set, the spectrum will be filtered accordingly.
| [in] | id | The index of the spectrum |
|
inline |
returns a single spectrum (without applying PeakFileOptions filters)
| MSSpectrum getSpectrumByNativeId | ( | const std::string & | id | ) |
returns a single spectrum
| [in] | id | The native identifier of the spectrum |
|
inline |
Checks if all spectra are sorted with respect to ascending RT.
Note that we cannot check whether all spectra are sorted (except if we were to load them all and check).
|
private |
| bool openFile | ( | const String & | filename, |
| bool | skipMetaData = false |
||
| ) |
Open a specific file on disk.
This tries to read the indexed mzML by parsing the index and then reading the meta information into memory.
|
inline |
Inequality operator.
References OpenMS::Internal::operator==().
|
private |
Private Assignment operator -> we cannot copy file streams in IndexedMzMLHandler.
|
inline |
Equality operator.
This only checks whether the underlying file is the same and the parsed meta-information is the same. Note that the file reader (e.g. the std::ifstream of the file) might be in a different state.
References OnDiscMSExperiment::filename_, and OnDiscMSExperiment::meta_ms_experiment_.
|
inline |
alias for getSpectrum
| void setOptions | ( | const PeakFileOptions & | options | ) |
set options for loading/storing
| void setSkipXMLChecks | ( | bool | skip | ) |
sets whether to skip some XML checks and be fast instead
|
inline |
alias for getNrSpectra
|
protected |
Mapping of chromatogram native ids to offsets.
|
protected |
The filename of the underlying data file.
Referenced by OnDiscMSExperiment::operator==().
|
protected |
The index of the underlying data file.
|
protected |
The meta-data.
Referenced by OnDiscMSExperiment::operator==().
|
protected |
Options for loading / storing.
|
protected |
Mapping of spectra native ids to offsets.