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

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

Size default_ms_level_
 Default MS level used when reading the file. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

DTAFile ( )

Default constructor.

virtual ~DTAFile ( )
virtual

Destructor.

Member Function Documentation

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.

Exceptions
Exception::FileNotFoundis thrown if the file could not be opened
Exception::ParseErroris 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().

Referenced by FileHandler::loadExperiment().

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.

Exceptions
Exception::UnableToCreateFileis thrown if the file could not be created

References Precursor::getCharge(), Peak1D::getMZ(), and OpenMS::writtenDigits< double >().

Member Data Documentation

Size default_ms_level_
protected

Default MS level used when reading the file.


OpenMS / TOPP release 2.0.0 Documentation generated on Sat May 16 2015 16:13:49 using doxygen 1.8.9.1