File adapter for DTA files. More...
#include <OpenMS/FORMAT/DTAFile.h>
Public Member Functions | |
| DTAFile () | |
| Default constructor. | |
| virtual | ~DTAFile () |
| Destructor. | |
| template<typename SpectrumType > | |
| void | load (const String &filename, SpectrumType &spectrum) |
| Loads a DTA file to a spectrum. | |
| template<typename SpectrumType > | |
| void | store (const String &filename, const SpectrumType &spectrum) const |
| Stores a spectrum in a DTA file. | |
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 precusor mass and charge state the mass-charge-ratio is calculated and stored in the spectrum as precursor mass.
| DTAFile | ( | ) |
Default constructor.
| virtual ~DTAFile | ( | ) | [virtual] |
Destructor.
| void load | ( | const String & | filename, | |
| SpectrumType & | spectrum | |||
| ) | [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(), String::has(), OpenMS::Constants::PROTON_MASS_U, Precursor::setCharge(), Peak1D::setMZ(), String::split(), and String::trim().
| void store | ( | const String & | filename, | |
| const SpectrumType & | spectrum | |||
| ) | const [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(), and Peak1D::getMZ().
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:53 using doxygen 1.7.1 |