35 #ifndef OPENMS_FORMAT_CACHEDMZML_H 36 #define OPENMS_FORMAT_CACHEDMZML_H 50 #define CACHED_MZML_FILE_IDENTIFIER 8093 99 void writeMemdump(MapType& exp,
String out);
102 void writeMetadata(MapType exp,
String out_meta,
bool addCacheMetaValue=
false);
105 void readMemdump(MapType& exp_reading,
String filename)
const;
111 void createMemdumpIndex(
String filename);
115 const std::vector<std::streampos>& getSpectraIndex()
const;
118 const std::vector<std::streampos>& getChromatogramIndex()
const;
135 ifs.read((
char*) &spec_size,
sizeof(spec_size));
136 ifs.read((
char*) &ms_level,
sizeof(ms_level));
137 ifs.read((
char*) &rt,
sizeof(rt));
139 if ( static_cast<int>(spec_size) < 0)
142 "Read an invalid spectrum length, something is wrong here. Aborting.",
"filestream");
145 data1->data.resize(spec_size);
146 data2->data.resize(spec_size);
150 ifs.read((
char*) &(data1->data)[0], spec_size *
sizeof(
double));
151 ifs.read((
char*) &(data2->data)[0], spec_size *
sizeof(
double));
164 ifs.read((
char*) &spec_size,
sizeof(spec_size));
166 if ( static_cast<int>(spec_size) < 0)
169 "Read an invalid chromatogram length, something is wrong here. Aborting.",
"filestream");
172 data1->data.resize(spec_size);
173 data2->data.resize(spec_size);
174 ifs.read((
char*) &(data1->data)[0], spec_size *
sizeof(
double));
175 ifs.read((
char*) &(data2->data)[0], spec_size *
sizeof(
double));
182 void readSpectrum_(Datavector& data1, Datavector& data2, std::ifstream& ifs,
int& ms_level,
double& rt)
const;
185 void readChromatogram_(Datavector& data1, Datavector& data2, std::ifstream& ifs)
const;
188 void readSpectrum_(SpectrumType& spectrum, std::ifstream& ifs)
const;
191 void readChromatogram_(ChromatogramType& chromatogram, std::ifstream& ifs)
const;
194 void writeSpectrum_(
const SpectrumType& spectrum, std::ofstream& ofs);
197 void writeChromatogram_(
const ChromatogramType& chromatogram, std::ofstream& ofs);
205 #endif // OPENMS_FORMAT_CACHEDMZML_H
A more convenient string class.
Definition: String.h:57
The representation of a chromatogram.
Definition: MSChromatogram.h:55
double DatumSingleton
Definition: CachedMzML.h:77
std::vector< std::streampos > chrom_index_
Definition: CachedMzML.h:201
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: openswathalgo/include/OpenMS/ANALYSIS/OPENSWATH/OPENSWATHALGO/DATAACCESS/DataStructures.h:77
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
MSChromatogram ChromatogramType
Definition: CachedMzML.h:74
std::vector< DatumSingleton > Datavector
Definition: CachedMzML.h:79
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:82
MSSpectrum SpectrumType
Definition: CachedMzML.h:73
PeakMap MapType
Definition: CachedMzML.h:72
An class that uses on-disk caching to read and write spectra and chromatograms.
Definition: CachedMzML.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
static void readChromatogramFast(OpenSwath::BinaryDataArrayPtr data1, OpenSwath::BinaryDataArrayPtr data2, std::ifstream &ifs)
fast access to a chromatogram (a direct copy of the data into the provided arrays) ...
Definition: CachedMzML.h:160
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
double dbl_field_
Definition: CachedMzML.h:68
int int_field_
Definition: CachedMzML.h:67
std::vector< std::streampos > spectra_index_
Members.
Definition: CachedMzML.h:200
static void readSpectrumFast(OpenSwath::BinaryDataArrayPtr data1, OpenSwath::BinaryDataArrayPtr data2, std::ifstream &ifs, int &ms_level, double &rt)
fast access to a spectrum (a direct copy of the data into the provided arrays)
Definition: CachedMzML.h:130
Parse Error exception.
Definition: Exception.h:623