OpenMS
2.5.0
|
File adapter for DTA files. More...
#include <OpenMS/FORMAT/DTAFile.h>
Public Member Functions | |
DTAFile () | |
Default constructor. More... | |
virtual | ~DTAFile () |
Destructor. More... | |
template<typename SpectrumType > | |
void | load (const String &filename, SpectrumType &spectrum) |
Loads a DTA file to a spectrum. More... | |
template<typename SpectrumType > | |
void | store (const String &filename, const SpectrumType &spectrum) const |
Stores a spectrum in a DTA file. More... | |
Protected Attributes | |
UInt | default_ms_level_ |
Default MS level used when reading the file. More... | |
File adapter for DTA files.
The first line contains the singly protonated peptide mass (MH+) and the peptide charge state separated by a space. Subsequent lines contain space separated pairs of fragment ion m/z and intensity values.
From precursor mass and charge state the mass-charge-ratio is calculated and stored in the spectrum as precursor mass.
DTAFile | ( | ) |
Default constructor.
|
virtual |
Destructor.
|
inline |
Loads a DTA file to a spectrum.
The content of the file is stored in spectrum
. spectrum
has to be a MSSpectrum or have the same interface.
Exception::FileNotFound | is thrown if the file could not be opened |
Exception::ParseError | is thrown if an error occurs during parsing |
References File::basename(), MSSpectrum::clear(), SpectrumSettings::getPrecursors(), String::has(), OpenMS::Constants::PROTON_MASS_U, Precursor::setCharge(), Peak1D::setIntensity(), MSSpectrum::setMSLevel(), Peak1D::setMZ(), MSSpectrum::setName(), Peak1D::setPosition(), String::split(), and String::trim().
|
inline |
Stores a spectrum in a DTA file.
The content of spectrum
is stored in a file. spectrum
has to be a MSSpectrum or have the same interface.
Exception::UnableToCreateFile | is thrown if the file could not be created |
References Precursor::getCharge(), Peak1D::getMZ(), SpectrumSettings::getPrecursors(), and OpenMS::writtenDigits< double >().
|
protected |
Default MS level used when reading the file.