Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Attributes | Private Types | Private Member Functions | List of all members
OnDiscMSExperiment Class Reference

Representation of a mass spectrometry experiment on disk. More...

#include <OpenMS/KERNEL/OnDiscMSExperiment.h>

Public Member Functions

 OnDiscMSExperiment ()
 Constructor. More...
 
bool openFile (const String &filename, bool skipMetaData=false)
 Open a specific file on disk. More...
 
 OnDiscMSExperiment (const OnDiscMSExperiment &source)
 Copy constructor. More...
 
bool operator== (const OnDiscMSExperiment &rhs) const
 Equality operator. More...
 
bool operator!= (const OnDiscMSExperiment &rhs) const
 Inequality operator. More...
 
bool isSortedByRT () const
 Checks if all spectra are sorted with respect to ascending RT. More...
 
Size size () const
 alias for getNrSpectra More...
 
bool empty () const
 returns whether spectra are empty More...
 
Size getNrSpectra () const
 get the total number of spectra available More...
 
Size getNrChromatograms () const
 get the total number of chromatograms available More...
 
boost::shared_ptr< const ExperimentalSettingsgetExperimentalSettings () const
 returns the meta information of this experiment (const access) More...
 
MSSpectrum operator[] (Size n)
 alias for getSpectrum More...
 
MSSpectrum getSpectrum (Size id)
 returns a single spectrum More...
 
OpenMS::Interfaces::SpectrumPtr getSpectrumById (Size id)
 returns a single spectrum More...
 
MSChromatogram getChromatogram (Size id)
 returns a single chromatogram More...
 
OpenMS::Interfaces::ChromatogramPtr getChromatogramById (Size id)
 returns a single chromatogram More...
 
void setSkipXMLChecks (bool skip)
 sets whether to skip some XML checks and be fast instead More...
 

Protected Attributes

String filename_
 The filename of the underlying data file. More...
 
IndexedMzMLFile indexed_mzml_file_
 The index of the underlying data file. More...
 
boost::shared_ptr< PeakMapmeta_ms_experiment_
 The meta-data. More...
 

Private Types

typedef ChromatogramPeak ChromatogramPeakT
 
typedef Peak1D PeakT
 

Private Member Functions

OnDiscMSExperimentoperator= (const OnDiscMSExperiment &)
 Private Assignment operator -> we cannot copy file streams in IndexedMzMLFile. More...
 
void loadMetaData_ (const String &filename)
 

Detailed Description

Representation of a mass spectrometry experiment on disk.

Note
This implementation is not thread-safe since it keeps internally a single file access pointer which it moves when accessing a specific data item. Please provide a separate copy to each thread, e.g.
#pragma omp parallel for firstprivate(ondisc_map)

Member Typedef Documentation

◆ ChromatogramPeakT

◆ PeakT

typedef Peak1D PeakT
private

Constructor & Destructor Documentation

◆ OnDiscMSExperiment() [1/2]

OnDiscMSExperiment ( )
inline

Constructor.

This initializes the object, use openFile to open a file.

◆ OnDiscMSExperiment() [2/2]

OnDiscMSExperiment ( const OnDiscMSExperiment source)
inline

Copy constructor.

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

returns whether spectra are empty

References IndexedMzMLFile::getNrSpectra(), and OnDiscMSExperiment::indexed_mzml_file_.

◆ getChromatogram()

MSChromatogram getChromatogram ( Size  id)
inline

◆ getChromatogramById()

OpenMS::Interfaces::ChromatogramPtr getChromatogramById ( Size  id)
inline

◆ getExperimentalSettings()

boost::shared_ptr<const ExperimentalSettings> getExperimentalSettings ( ) const
inline

returns the meta information of this experiment (const access)

References OnDiscMSExperiment::meta_ms_experiment_.

Referenced by PeakPickerHiRes::pickExperiment(), and IndexedMzMLFileLoader::store().

◆ getNrChromatograms()

Size getNrChromatograms ( ) const
inline

◆ getNrSpectra()

Size getNrSpectra ( ) const
inline

◆ getSpectrum()

MSSpectrum getSpectrum ( Size  id)
inline

◆ getSpectrumById()

OpenMS::Interfaces::SpectrumPtr getSpectrumById ( Size  id)
inline

◆ isSortedByRT()

bool isSortedByRT ( ) const
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).

References OnDiscMSExperiment::meta_ms_experiment_.

◆ loadMetaData_()

void loadMetaData_ ( const String filename)
inlineprivate

◆ openFile()

bool openFile ( const String filename,
bool  skipMetaData = false 
)
inline

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.

Returns
Whether the parsing of the file was successful (if false, the file most likely was not an indexed mzML file)

References OnDiscMSExperiment::filename_, IndexedMzMLFile::getParsingSuccess(), OnDiscMSExperiment::indexed_mzml_file_, OnDiscMSExperiment::loadMetaData_(), and IndexedMzMLFile::openFile().

Referenced by IndexedMzMLFileLoader::load().

◆ operator!=()

bool operator!= ( const OnDiscMSExperiment rhs) const
inline

Inequality operator.

References OnDiscMSExperiment::operator==().

◆ operator=()

OnDiscMSExperiment& operator= ( const OnDiscMSExperiment )
private

Private Assignment operator -> we cannot copy file streams in IndexedMzMLFile.

Referenced by OnDiscMSExperiment::setSkipXMLChecks().

◆ operator==()

bool operator== ( const OnDiscMSExperiment rhs) const
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_.

Referenced by OnDiscMSExperiment::operator!=().

◆ operator[]()

MSSpectrum operator[] ( Size  n)
inline

alias for getSpectrum

References OnDiscMSExperiment::getSpectrum().

◆ setSkipXMLChecks()

void setSkipXMLChecks ( bool  skip)
inline

sets whether to skip some XML checks and be fast instead

References OnDiscMSExperiment::indexed_mzml_file_, OnDiscMSExperiment::operator=(), and IndexedMzMLFile::setSkipXMLChecks().

◆ size()

Size size ( ) const
inline

alias for getNrSpectra

References OnDiscMSExperiment::getNrSpectra().

Referenced by PeakPickerHiRes::pickExperiment().

Member Data Documentation

◆ filename_

String filename_
protected

The filename of the underlying data file.

Referenced by OnDiscMSExperiment::openFile(), and OnDiscMSExperiment::operator==().

◆ indexed_mzml_file_

IndexedMzMLFile indexed_mzml_file_
protected

◆ meta_ms_experiment_

boost::shared_ptr<PeakMap> meta_ms_experiment_
protected

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:11 using doxygen 1.8.13