| OpenMS 2.5.0

Public Types | Public Member Functions | Private Attributes | List of all members
SpectrumAccessOpenMSInMemory Class Reference

An implementation of the OpenSWATH Spectrum Access interface completely in memory. More...

`#include <OpenMS/ANALYSIS/OPENSWATH/DATAACCESS/SpectrumAccessOpenMSInMemory.h>`

Inheritance diagram for SpectrumAccessOpenMSInMemory:

## Public Types

typedef OpenMS::PeakMap | MSExperimentType
typedef OpenMS::MSSpectrum | MSSpectrumType
typedef OpenMS::MSChromatogram | MSChromatogramType

## Public Member Functions

| SpectrumAccessOpenMSInMemory (OpenSwath::ISpectrumAccess &origin)
| Constructor. More...
| ~SpectrumAccessOpenMSInMemory () override
| Destructor. More...
| SpectrumAccessOpenMSInMemory (const SpectrumAccessOpenMSInMemory &rhs)
| Copy constructor. More...
boost::shared_ptr< OpenSwath::ISpectrumAccess > | lightClone () const override
| Light clone operator (actual data will not get copied) More...
OpenSwath::SpectrumPtr | getSpectrumById (int id) override
| Return a pointer to a spectrum at the given id. More...
OpenSwath::SpectrumMeta | getSpectrumMetaById (int id) const override
| Returns the meta information for a spectrum. More...
std::vector< std::size_t > | getSpectraByRT (double RT, double deltaRT) const override
| Return a vector of ids of spectra that are within RT +/- deltaRT. More...
size_t | getNrSpectra () const override
| Returns the number of spectra available. More...
OpenSwath::ChromatogramPtr | getChromatogramById (int id) override
| Return a pointer to a chromatogram at the given id. More...
size_t | getNrChromatograms () const override
| Returns the number of chromatograms available. More...
std::string | getChromatogramNativeID (int id) const override
| Returns the native id of the chromatogram at the given id. More...
Public Member Functions inherited from ISpectrumAccess
virtual | ~ISpectrumAccess ()
| Destructor. More...

## Private Attributes

std::vector< OpenSwath::SpectrumPtr > | spectra_
std::vector< OpenSwath::SpectrumMeta > | spectra_meta_
std::vector< OpenSwath::ChromatogramPtr > | chromatograms_
std::vector< std::string > | chromatogram_ids_

## Detailed Description

An implementation of the OpenSWATH Spectrum Access interface completely in memory.

This implementation of the spectrum access interface ensures that all data is held completely in memory and is quickly accessible. This class can be generated by passing any object implementing the Spectrum Access interface and guarantees to provide the same access to the raw data as the original object with the added benefits (and downside) of keeping all data in system memory.

A possible example

OpenSwath::ISpectrumAccess * data_access;
fillData(data_access); // assume that data_access points to some data
OpenSwath::ISpectrumAccess * in_memory_data_access = SpectrumAccessOpenMSInMemory(data_access);

After executing this code, two variables exist: data_access which provides access to the original data but does so in one of multiple ways which is not transparent to the user. However, in_memory_data_access will provide access to the same data but with the guarantee that the data is available in memory and not read from the disk.

## Member Typedef Documentation

## ◆ MSChromatogramType

typedef OpenMS::MSChromatogram MSChromatogramType

## ◆ MSExperimentType

typedef OpenMS::PeakMap MSExperimentType

## ◆ MSSpectrumType

typedef OpenMS::MSSpectrum MSSpectrumType

## Constructor & Destructor Documentation

## ◆ SpectrumAccessOpenMSInMemory() [1/2]

SpectrumAccessOpenMSInMemory | ( | OpenSwath::ISpectrumAccess & | origin | ) |

explicit

Constructor.

## ◆ ~SpectrumAccessOpenMSInMemory()

~SpectrumAccessOpenMSInMemory | ( |  | ) |

override

Destructor.

## ◆ SpectrumAccessOpenMSInMemory() [2/2]

SpectrumAccessOpenMSInMemory | ( | const SpectrumAccessOpenMSInMemory & | rhs | ) |

Copy constructor.

## Member Function Documentation

## ◆ getChromatogramById()

OpenSwath::ChromatogramPtr getChromatogramById | ( | int | id | ) |

override virtual

Return a pointer to a chromatogram at the given id.

Implements ISpectrumAccess.

## ◆ getChromatogramNativeID()

std::string getChromatogramNativeID | ( | int | id | ) | const

override virtual

Returns the native id of the chromatogram at the given id.

Implements ISpectrumAccess.

## ◆ getNrChromatograms()

size_t getNrChromatograms | ( |  | ) | const

override virtual

Returns the number of chromatograms available.

Implements ISpectrumAccess.

## ◆ getNrSpectra()

size_t getNrSpectra | ( |  | ) | const

override virtual

Returns the number of spectra available.

Implements ISpectrumAccess.

## ◆ getSpectraByRT()

std::vector<std::size_t> getSpectraByRT | ( | double | RT,
|  | double | deltaRT
| ) |  | const

override virtual

Return a vector of ids of spectra that are within RT +/- deltaRT.

Implements ISpectrumAccess.

## ◆ getSpectrumById()

OpenSwath::SpectrumPtr getSpectrumById | ( | int | id | ) |

override virtual

Return a pointer to a spectrum at the given id.

Implements ISpectrumAccess.

## ◆ getSpectrumMetaById()

OpenSwath::SpectrumMeta getSpectrumMetaById | ( | int | id | ) | const

override virtual

Returns the meta information for a spectrum.

Implements ISpectrumAccess.

## ◆ lightClone()

boost::shared_ptr<OpenSwath::ISpectrumAccess> lightClone | ( |  | ) | const

override virtual

Light clone operator (actual data will not get copied)

Implements ISpectrumAccess.

## Member Data Documentation

## ◆ chromatogram_ids_

std::vector< std::string > chromatogram_ids_

private

## ◆ chromatograms_

std::vector< OpenSwath::ChromatogramPtr > chromatograms_

private

## ◆ spectra_

std::vector< OpenSwath::SpectrumPtr > spectra_

private

## ◆ spectra_meta_

std::vector< OpenSwath::SpectrumMeta > spectra_meta_

private