| OpenMS 2.5.0

Public Member Functions | Private Attributes | List of all members
DTA2DFile Class Reference
Format » File IO

DTA2D File adapter. More...

`#include <OpenMS/FORMAT/DTA2DFile.h>`

Inheritance diagram for DTA2DFile:

## Public Member Functions

PeakFileOptions & | getOptions ()
| Mutable access to the options for loading/storing. More...
const PeakFileOptions & | getOptions () const
| Non-mutable access to the options for loading/storing. More...
template<typename MapType >
void | load (const String &filename, MapType &map)
| Loads a map from a DTA2D file. More...
template<typename MapType >
void | store (const String &filename, const MapType &map) const
| Stores a map in a DTA2D file. More...
template<typename MapType >
void | storeTIC (const String &filename, const MapType &map) const
| Stores the TIC of a map in a DTA2D file. More...
Constructors and Destructor
| DTA2DFile ()
| Default constructor. More...
| ~DTA2DFile ()
| Destructor. More...
Public Member Functions inherited from ProgressLogger
| ProgressLogger ()
| Constructor. More...
| ~ProgressLogger ()
| Destructor. More...
| ProgressLogger (const ProgressLogger &other)
| Copy constructor. More...
ProgressLogger & | operator= (const ProgressLogger &other)
| Assignment Operator. More...
void | setLogType (LogType type) const
| Sets the progress log that should be used. The default type is NONE! More...
LogType | getLogType () const
| Returns the type of progress log being used. More...
void | startProgress (SignedSize begin, SignedSize end, const String &label) const
| Initializes the progress display. More...
void | setProgress (SignedSize value) const
| Sets the current progress. More...
void | endProgress () const
| Ends the progress display. More...
void | nextProgress () const
| increment progress by 1 (according to range begin-end) More...

## Private Attributes

PeakFileOptions | options_

## Additional Inherited Members

Public Types inherited from ProgressLogger
enum | LogType { CMD, GUI, NONE }
| Possible log types. More...
Static Protected Member Functions inherited from ProgressLogger
static String | logTypeToFactoryName_ (LogType type)
| Return the name of the factory product used for this log type. More...
Protected Attributes inherited from ProgressLogger
LogType | type_
time_t | last_invoke_
ProgressLoggerImpl * | current_logger_
Static Protected Attributes inherited from ProgressLogger
static int | recursion_depth_

## Detailed Description

DTA2D File adapter.

File adapter for files with three tab/space-separated columns.

The default format is: retention time (seconds) , m/z , intensity.

If the first line starts with '#', a different order is defined by the the order of the keywords 'MIN' (retention time in minutes) or 'SEC' (retention time in seconds), 'MZ', and 'INT'.

Example: '#MZ MIN INT'

The peaks of one retention time have to be in subsequent lines.

## Constructor & Destructor Documentation

## ◆ DTA2DFile()

DTA2DFile | ( |  | ) |

Default constructor.

## ◆ ~DTA2DFile()

~DTA2DFile | ( |  | ) |

Destructor.

## Member Function Documentation

## ◆ getOptions() [1/2]

PeakFileOptions& getOptions | ( |  | ) |

Mutable access to the options for loading/storing.

## ◆ getOptions() [2/2]

const PeakFileOptions& getOptions | ( |  | ) | const

Non-mutable access to the options for loading/storing.

## ◆ load()

void load | ( | const String & | filename,
|  | MapType & | map
| ) |  |

inline

Loads a map from a DTA2D file.

Parameters

  filename | The file from which the map should be loaded.
  map | has to be a MSExperiment or have the same interface.

Exceptions

  Exception::FileNotFound | is thrown if the file could not be opened
  Exception::ParseError | is thrown if an error occurs during parsing

References MSExperiment::addSpectrum(), MSSpectrum::clear(), DRange< D >::encloses(), Peak1D::getIntensity(), PeakFileOptions::getIntensityRange(), Peak1D::getMZ(), PeakFileOptions::getMZRange(), MSSpectrum::getRT(), PeakFileOptions::getRTRange(), String::has(), PeakFileOptions::hasIntensityRange(), PeakFileOptions::hasMZRange(), String::hasPrefix(), PeakFileOptions::hasRTRange(), MSExperiment::reset(), Peak1D::setIntensity(), DocumentIdentifier::setLoadedFilePath(), DocumentIdentifier::setLoadedFileType(), Peak1D::setMZ(), SpectrumSettings::setNativeID(), MSSpectrum::setRT(), String::split(), String::substr(), and String::trim().

## ◆ store()

void store | ( | const String & | filename,
|  | const MapType & | map
| ) |  | const

inline

Stores a map in a DTA2D file.

Parameters

  filename | The name of the file where the map should be stored.
  map | has to be a MSExperiment or have the same interface.

Exceptions

  Exception::UnableToCreateFile | is thrown if the file could not be created

References MSExperiment::begin(), MSExperiment::end(), OpenMS::precisionWrapper(), and MSExperiment::size().

## ◆ storeTIC()

void storeTIC | ( | const String & | filename,
|  | const MapType & | map
| ) |  | const

inline

Stores the TIC of a map in a DTA2D file.

Parameters

  filename | The name of the file where the map should be stored.
  map | has to be a MSExperiment or have the same interface.

Exceptions

  Exception::UnableToCreateFile | is thrown if the file could not be created

References MSExperiment::getTIC(), OpenMS::precisionWrapper(), and MSExperiment::size().

## Member Data Documentation

## ◆ options_

PeakFileOptions options_

private