![]() |
OpenMS
|
File adapter for Swath files. More...
#include <OpenMS/FORMAT/SwathFile.h>
Public Member Functions | |
| std::vector< OpenSwath::SwathMap > | loadSplit (StringList file_list, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal") |
| Loads a Swath run from a list of split mzML files. | |
| std::vector< OpenSwath::SwathMap > | loadMzML (const std::string &file, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal", Interfaces::IMSDataConsumer *plugin_consumer=nullptr) |
| Loads a Swath run from a single mzML file. | |
| std::vector< OpenSwath::SwathMap > | loadFromMSExperiment (const std::shared_ptr< PeakMap > &exp, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal") |
| Loads a Swath run from a pre-loaded in-memory MSExperiment. | |
| std::vector< FAIMSSwathMapGroup > | loadFromMSExperimentByFAIMSCV (PeakMap &&exp, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal") |
| Partition a pre-loaded experiment once by FAIMS CV and convert each group to SWATH maps. | |
| std::vector< OpenSwath::SwathMap > | loadMzXML (const std::string &file, const std::string &tmp, std::shared_ptr< ExperimentalSettings > &exp_meta, const std::string &readoptions="normal") |
| Loads a Swath run from a single mzXML file. | |
| std::vector< OpenSwath::SwathMap > | loadSqMass (const std::string &file, std::shared_ptr< ExperimentalSettings > &) |
| Loads a Swath run from a single sqMass file. | |
| std::vector< OpenSwath::SwathMap > | loadOnDisc (const std::shared_ptr< IMSExperimentRandomAccess > &experiment, std::shared_ptr< ExperimentalSettings > &exp_meta, Interfaces::IMSDataConsumer *plugin_consumer=nullptr) |
| SWATH maps that read the spectra on access from a random-access experiment ("onDisc") | |
| std::vector< OpenSwath::SwathMap > | loadOnDisc (const std::string &file, std::shared_ptr< ExperimentalSettings > &exp_meta, Interfaces::IMSDataConsumer *plugin_consumer=nullptr) |
| Loads a Swath run with readoptions "onDisc": the file is indexed once and the spectra are read on access. | |
| std::vector< FAIMSSwathMapGroup > | loadOnDiscByFAIMSCV (const std::shared_ptr< IMSExperimentRandomAccess > &experiment, std::shared_ptr< ExperimentalSettings > &exp_meta, Interfaces::IMSDataConsumer *plugin_consumer=nullptr) |
| Like loadOnDisc(), but partitions MS1 and MS2 spectra by FAIMS compensation voltage first. | |
| std::vector< FAIMSSwathMapGroup > | loadOnDiscByFAIMSCV (const std::string &file, std::shared_ptr< ExperimentalSettings > &exp_meta, Interfaces::IMSDataConsumer *plugin_consumer=nullptr) |
| loadOnDiscByFAIMSCV() on a file; the backend is chosen as in loadOnDisc(const std::string&, ...) | |
Public Member Functions inherited from ProgressLogger | |
| ProgressLogger () | |
| Constructor. | |
| virtual | ~ProgressLogger () |
| Destructor. | |
| ProgressLogger (const ProgressLogger &other) | |
| Copy constructor. | |
| ProgressLogger & | operator= (const ProgressLogger &other) |
| Assignment Operator. | |
| void | setLogType (LogType type) const |
| Sets the progress log that should be used. The default type is NONE! | |
| LogType | getLogType () const |
| Returns the type of progress log being used. | |
| void | setLogger (ProgressLoggerImpl *logger) |
| Sets the logger to be used for progress logging. | |
| void | startProgress (SignedSize begin, SignedSize end, const std::string &label) const |
| Initializes the progress display. | |
| void | setProgress (SignedSize value) const |
| Sets the current progress. | |
| void | endProgress (UInt64 bytes_processed=0) const |
| void | nextProgress () const |
| increment progress by 1 (according to range begin-end) | |
Protected Member Functions | |
| std::vector< OpenSwath::SwathMap > | buildOnDiscMaps_ (const std::shared_ptr< IMSExperimentRandomAccess > &experiment, const PeakMap &metadata, const std::vector< Size > &indices) |
SpectrumAccessOnDisc maps for the spectra indices of experiment (metadata: all spectra without peaks) | |
| void | passOnDiscToPlugin_ (IMSExperimentRandomAccess &experiment, const PeakMap &metadata, ExperimentalSettings &exp_meta, Interfaces::IMSDataConsumer *plugin_consumer) |
Passes every spectrum to plugin_consumer; throws Exception::IllegalArgument if it modifies one. | |
| std::shared_ptr< IMSExperimentRandomAccess > | openOnDisc_ (const std::string &file) |
Opens file with the random-access backend for its type (see loadOnDisc(const std::string&, ...)) | |
| OpenSwath::SpectrumAccessPtr | doCacheFile_ (const std::string &in, const std::string &tmp, const std::string &tmp_fname, const std::shared_ptr< PeakMap > &experiment_metadata) |
| Cache a file to disk. | |
| std::shared_ptr< PeakMap > | populateMetaData_ (const std::string &file) |
| Only read the meta data from a file and use it to populate exp_meta. | |
| void | countScansInSwath_ (const std::vector< MSSpectrum > &exp, std::vector< int > &swath_counter, int &nr_ms1_spectra, std::vector< OpenSwath::SwathMap > &known_window_boundaries, double TOLERANCE=1e-6) |
| Counts the number of scans in a full Swath file (e.g. concatenated non-split file) | |
Additional Inherited Members | |
Public Types inherited from ProgressLogger | |
| enum | LogType { CMD , GUI , NONE } |
| Possible log types. More... | |
Protected Attributes inherited from ProgressLogger | |
| LogType | type_ |
| time_t | last_invoke_ |
| ProgressLoggerImpl * | current_logger_ |
Static Protected Attributes inherited from ProgressLogger | |
| static int | recursion_depth_ |
File adapter for Swath files.
This class can load SWATH files in different storage versions. The most convenient file is a single MzML file which contains one experiment. However, also the loading of a list of files is supported (loadSplit) where it is assumed that each individual file only contains scans from one precursor isolation window (one SWATH). Finally, experimental support for mzXML is available but needs to be selected with a specific compile flag (this is not for everyday use).
|
protected |
SpectrumAccessOnDisc maps for the spectra indices of experiment (metadata: all spectra without peaks)
|
protected |
Counts the number of scans in a full Swath file (e.g. concatenated non-split file)
|
protected |
Cache a file to disk.
| std::vector< OpenSwath::SwathMap > loadFromMSExperiment | ( | const std::shared_ptr< PeakMap > & | exp, |
| const std::string & | tmp, | ||
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| const std::string & | readoptions = "normal" |
||
| ) |
Loads a Swath run from a pre-loaded in-memory MSExperiment.
Used when the input format does not have a streaming reader (e.g. Thermo .raw via openms-thermo-bridge), so the full experiment has already been materialized. Avoids the round-trip through a temporary mzML file.
| [in] | exp | The pre-loaded experiment (must contain all spectra and metadata) |
| [in] | tmp | Temporary directory (used only for readoptions=="cache") |
| [out] | exp_meta | ExperimentalSettings extracted from exp |
| [in] | readoptions | "normal" (in-memory) or "cache" (disk-cached) |
| std::vector< FAIMSSwathMapGroup > loadFromMSExperimentByFAIMSCV | ( | PeakMap && | exp, |
| const std::string & | tmp, | ||
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| const std::string & | readoptions = "normal" |
||
| ) |
Partition a pre-loaded experiment once by FAIMS CV and convert each group to SWATH maps.
This is the FAIMS-aware adapter for in-memory inputs such as Thermo RAW data loaded through ThermoRawFile. It reuses IMDataConverter::splitByFAIMSCV() for CV assignment and loadFromMSExperiment() for the existing SWATH-window conversion. No FAIMS-specific state is added to OpenSwath::SwathMap; the CV is carried by the enclosing FAIMSSwathMapGroup.
The input experiment is consumed. For non-FAIMS data, one group with a NaN CV is returned. For single-CV FAIMS data, one group with that CV is returned. Multi-CV input produces one group per exact compensation voltage.
| [in,out] | exp | Pre-loaded experiment; spectra are moved into per-CV groups |
| [in] | tmp | Temporary directory (used only for readoptions=="cache") |
| [out] | exp_meta | Experimental metadata copied before exp is consumed |
| [in] | readoptions | "normal" (in-memory) or "cache" (disk-cached) |
| std::vector< OpenSwath::SwathMap > loadMzML | ( | const std::string & | file, |
| const std::string & | tmp, | ||
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| const std::string & | readoptions = "normal", |
||
| Interfaces::IMSDataConsumer * | plugin_consumer = nullptr |
||
| ) |
Loads a Swath run from a single mzML file.
Using the plugin_consumer, you can provide a custom consumer which will be chained into the process of loading the data and making it available (depending on readoptions). This is useful if you want to modify the data a priori or extract some other information using MSDataTransformingConsumer (for example). Make sure it leaves the data intact, such that the returned SwathMaps are actually useful.
| [in] | file | Input filename |
| [in] | tmp | Temporary directory (for cached data) |
| [out] | exp_meta | Experimental metadata from mzML file |
| [in] | readoptions | How are spectra accessed after reading - tradeoff between memory usage and time (disk caching) |
| [in] | plugin_consumer | An intermediate custom consumer |
| std::vector< OpenSwath::SwathMap > loadMzXML | ( | const std::string & | file, |
| const std::string & | tmp, | ||
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| const std::string & | readoptions = "normal" |
||
| ) |
Loads a Swath run from a single mzXML file.
| std::vector< OpenSwath::SwathMap > loadOnDisc | ( | const std::shared_ptr< IMSExperimentRandomAccess > & | experiment, |
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| Interfaces::IMSDataConsumer * | plugin_consumer = nullptr |
||
| ) |
SWATH maps that read the spectra on access from a random-access experiment ("onDisc")
The SWATH windows are determined from the spectrum metadata as for the other read options; each map is a SpectrumAccessOnDisc view with its own handle (clone()) on experiment.
| [in] | experiment | Open random-access experiment |
| [out] | exp_meta | Run metadata |
| [in] | plugin_consumer | Optional consumer that observes every spectrum once. The maps read the spectra again, so it must not modify them. |
| Exception::NullPointer | if experiment is null |
| Exception::IllegalArgument | if experiment has no meta data (e.g. opened with skipMetaData), if the input has more than one FAIMS compensation voltage (use loadOnDiscByFAIMSCV()) or if plugin_consumer modifies a spectrum |
| std::vector< OpenSwath::SwathMap > loadOnDisc | ( | const std::string & | file, |
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| Interfaces::IMSDataConsumer * | plugin_consumer = nullptr |
||
| ) |
Loads a Swath run with readoptions "onDisc": the file is indexed once and the spectra are read on access.
The random-access backend is chosen by file type: OnDiscMSExperiment for indexed mzML, OnDiscThermoRawExperiment for Thermo .raw (requires WITH_THERMO_RAW; centroided, as with the other read options). Nothing is loaded or cached up front; the spectra and SWATH windows are the same as with the other read options. See loadOnDisc(const std::shared_ptr<IMSExperimentRandomAccess>&, ...).
| [in] | file | Indexed mzML or Thermo .raw file |
| [out] | exp_meta | Run metadata |
| [in] | plugin_consumer | Optional consumer that observes every spectrum once (it must not modify them) |
| Exception::InvalidValue | if the file type has no random-access backend |
| Exception::ParseError | if an mzML file is not indexed |
| Exception::IllegalArgument | if the input has more than one FAIMS compensation voltage or if plugin_consumer modifies a spectrum |
| std::vector< FAIMSSwathMapGroup > loadOnDiscByFAIMSCV | ( | const std::shared_ptr< IMSExperimentRandomAccess > & | experiment, |
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| Interfaces::IMSDataConsumer * | plugin_consumer = nullptr |
||
| ) |
Like loadOnDisc(), but partitions MS1 and MS2 spectra by FAIMS compensation voltage first.
The assignment follows IMDataConverter::splitByFAIMSCV(): a spectrum with drift time unit FAIMS_COMPENSATION_VOLTAGE goes to the CV in its drift time, an MS2+ spectrum without a CV to the most recent CV before it, other spectra are skipped. SWATH windows are then determined within each CV. Without FAIMS data, one group with CV NaN holds all spectra.
| [in] | experiment | Open random-access experiment |
| [out] | exp_meta | Run metadata |
| [in] | plugin_consumer | Optional consumer that observes every spectrum once (it must not modify them) |
| Exception::NullPointer | if experiment is null |
| Exception::IllegalArgument | if experiment has no meta data (e.g. opened with skipMetaData) or if plugin_consumer modifies a spectrum |
| std::vector< FAIMSSwathMapGroup > loadOnDiscByFAIMSCV | ( | const std::string & | file, |
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| Interfaces::IMSDataConsumer * | plugin_consumer = nullptr |
||
| ) |
loadOnDiscByFAIMSCV() on a file; the backend is chosen as in loadOnDisc(const std::string&, ...)
| std::vector< OpenSwath::SwathMap > loadSplit | ( | StringList | file_list, |
| const std::string & | tmp, | ||
| std::shared_ptr< ExperimentalSettings > & | exp_meta, | ||
| const std::string & | readoptions = "normal" |
||
| ) |
Loads a Swath run from a list of split mzML files.
| std::vector< OpenSwath::SwathMap > loadSqMass | ( | const std::string & | file, |
| std::shared_ptr< ExperimentalSettings > & | |||
| ) |
Loads a Swath run from a single sqMass file.
|
protected |
Opens file with the random-access backend for its type (see loadOnDisc(const std::string&, ...))
|
protected |
Passes every spectrum to plugin_consumer; throws Exception::IllegalArgument if it modifies one.
|
protected |
Only read the meta data from a file and use it to populate exp_meta.