![]() |
OpenMS
2.6.0
|
Transforming and cached writing consumer of MS data. More...
#include <OpenMS/FORMAT/DATAACCESS/MSDataCachedConsumer.h>
Public Member Functions | |
MSDataCachedConsumer (const String &filename, bool clearData=true) | |
Constructor. More... | |
~MSDataCachedConsumer () override | |
Destructor. More... | |
void | consumeSpectrum (SpectrumType &s) override |
Write a spectrum to the output file. More... | |
void | consumeChromatogram (ChromatogramType &c) override |
Write a chromatogram to the output file. More... | |
void | setExpectedSize (Size, Size) override |
Set expected size of spectra and chromatograms to be consumed. More... | |
void | setExperimentalSettings (const ExperimentalSettings &) override |
Set experimental settings (meta-data) of the data to be consumed. More... | |
![]() | |
CachedMzMLHandler () | |
Default constructor. More... | |
~CachedMzMLHandler () | |
Default destructor. More... | |
CachedMzMLHandler & | operator= (const CachedMzMLHandler &rhs) |
Assignment operator. More... | |
void | writeMemdump (const MapType &exp, const String &out) const |
Write complete spectra as a dump to the disk. More... | |
void | writeMetadata (MapType exp, String out_meta, bool addCacheMetaValue=false) |
Write only the meta data of an MSExperiment. More... | |
void | writeMetadata_x (const MapType &exp, const String &out_meta, bool addCacheMetaValue=false) |
Write only the meta data of an MSExperiment. More... | |
void | readMemdump (MapType &exp_reading, String filename) const |
Read all spectra from a dump from the disk. More... | |
void | createMemdumpIndex (String filename) |
Create an index on the location of all the spectra and chromatograms. More... | |
const std::vector< std::streampos > & | getSpectraIndex () const |
Access to a constant copy of the binary spectra index. More... | |
const std::vector< std::streampos > & | getChromatogramIndex () const |
Access to a constant copy of the binary chromatogram index. More... | |
![]() | |
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... | |
![]() | |
virtual | ~IMSDataConsumer () |
Protected Attributes | |
std::ofstream | ofs_ |
bool | clearData_ |
Size | spectra_written_ |
Size | chromatograms_written_ |
![]() | |
std::vector< std::streampos > | spectra_index_ |
Members. More... | |
std::vector< std::streampos > | chrom_index_ |
![]() | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
Private Types | |
typedef MSSpectrum | SpectrumType |
typedef MSChromatogram | ChromatogramType |
Additional Inherited Members | |
![]() | |
typedef PeakMap | MapType |
typedef MSSpectrum | SpectrumType |
typedef MSChromatogram | ChromatogramType |
typedef double | DatumSingleton |
typedef std::vector< DatumSingleton > | Datavector |
![]() | |
enum | LogType { CMD, GUI, NONE } |
Possible log types. More... | |
![]() | |
typedef MSSpectrum | SpectrumType |
typedef MSChromatogram | ChromatogramType |
![]() | |
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) More... | |
static std::vector< OpenSwath::BinaryDataArrayPtr > | readSpectrumFast (std::ifstream &ifs, int &ms_level, double &rt) |
Fast access to a spectrum. More... | |
static void | readChromatogramFast (OpenSwath::BinaryDataArrayPtr &data1, OpenSwath::BinaryDataArrayPtr &data2, std::ifstream &ifs) |
Fast access to a chromatogram. More... | |
static std::vector< OpenSwath::BinaryDataArrayPtr > | readChromatogramFast (std::ifstream &ifs) |
Fast access to a chromatogram. More... | |
static void | readSpectrum (SpectrumType &spectrum, std::ifstream &ifs) |
Read a single spectrum directly into an OpenMS MSSpectrum (assuming file is already at the correct position) More... | |
static void | readChromatogram (ChromatogramType &chromatogram, std::ifstream &ifs) |
Read a single chromatogram directly into an OpenMS MSChromatogram (assuming file is already at the correct position) More... | |
![]() | |
void | writeSpectrum_ (const SpectrumType &spectrum, std::ofstream &ofs) const |
write a single spectrum to filestream More... | |
void | writeChromatogram_ (const ChromatogramType &chromatogram, std::ofstream &ofs) const |
write a single chromatogram to filestream More... | |
![]() | |
static void | readDataFast_ (std::ifstream &ifs, std::vector< OpenSwath::BinaryDataArrayPtr > &data, const Size &data_size, const Size &nr_float_arrays) |
helper method for fast reading of spectra and chromatograms More... | |
![]() | |
static String | logTypeToFactoryName_ (LogType type) |
Return the name of the factory product used for this log type. More... | |
![]() | |
static int | recursion_depth_ |
Transforming and cached writing consumer of MS data.
Is able to transform a spectrum on the fly while it is read using a function pointer that can be set on the object. The spectra is then cached to disk using the functions provided in CachedMzMLHandler.
|
private |
|
private |
MSDataCachedConsumer | ( | const String & | filename, |
bool | clearData = true |
||
) |
Constructor.
Opens the output file and writes the header.
filename | The output file name to which data is written |
clearData | Whether to clear the spectral and chromatogram data after writing (only keep meta-data) |
|
override |
Destructor.
Closes the output file and writes the footer.
|
overridevirtual |
Write a chromatogram to the output file.
Implements IMSDataConsumer.
|
overridevirtual |
Write a spectrum to the output file.
Implements IMSDataConsumer.
Set expected size of spectra and chromatograms to be consumed.
Some implementations might care about the number of spectra and chromatograms to be consumed and need to be informed about this (usually before consuming starts).
expectedSpectra | Number of spectra expected |
expectedChromatograms | Number of chromatograms expected |
Implements IMSDataConsumer.
Referenced by CachedSwathFileConsumer::addNewSwathMap_().
|
inlineoverridevirtual |
Set experimental settings (meta-data) of the data to be consumed.
Some implementations might need to know about the meta-data (or the context) of the spectra and chromatograms to be consumed. This method allows them learn this.
exp | Experimental settings meta data for the data to be consumed |
Implements IMSDataConsumer.
|
protected |
|
protected |
|
protected |
|
protected |