![]() |
OpenMS
|
Batch driver for FIA-MS analyses. Dispatches each sample of a CSV-described batch to FIAMSDataProcessor. More...
#include <OpenMS/ANALYSIS/ID/FIAMSScheduler.h>
Public Member Functions | |
| FIAMSScheduler ()=default | |
| Default-construct an empty scheduler (no samples loaded, paths set to defaults). | |
| FIAMSScheduler (std::string filename, std::string base_dir="/", std::string output_dir="/", bool load_cached_=true) | |
| Construct from a batch CSV and parse it immediately. | |
| ~FIAMSScheduler ()=default | |
| Default destructor. | |
| FIAMSScheduler (const FIAMSScheduler &cp)=default | |
| Copy constructor. | |
| FIAMSScheduler & | operator= (const FIAMSScheduler &fdp)=default |
| Copy assignment. | |
| void | run () |
| Run the batch: process every sample loaded from the CSV. | |
| const std::vector< std::map< std::string, std::string > > & | getSamples () |
Return the parsed batch as a vector of header-keyed std::map rows. | |
| const std::string & | getBaseDir () |
| Return the base directory passed to the constructor. | |
| const std::string & | getOutputDir () |
| Return the output directory passed to the constructor. | |
Private Member Functions | |
| void | loadSamples_ () |
Parse the batch CSV at filename_ and populate samples_. | |
Private Attributes | |
| std::string | filename_ |
| CSV file describing the batch. | |
| std::string | base_dir_ |
| Base directory for per-sample input paths (must end with a path separator). | |
| std::string | output_dir_ |
| Base directory under which per-sample outputs are written (must end with a path separator). | |
| bool | load_cached_ |
Forwarded to FIAMSDataProcessor::run; reuse cached results when true. | |
| std::vector< std::map< std::string, std::string > > | samples_ |
| Parsed CSV rows; populated by loadSamples_. | |
Batch driver for FIA-MS analyses. Dispatches each sample of a CSV-described batch to FIAMSDataProcessor.
A CSV file describing the batch is parsed during construction. Each row defines one sample and is consumed by run, which loads the corresponding mzML file, configures a FIAMSDataProcessor instance, and runs the analysis once per requested time window. Samples are processed in parallel (OpenMP-parallelised loop).
The CSV is comma-delimited; the first row is taken as the header. Each subsequent row is stored as a header-keyed std::map<String, String>. The implementation looks up the following keys per row (column names as read from the CSV):
filename — base filename of the sample's mzML (no path, no .mzML extension); the loader appends .mzML.dir_input — sample subdirectory relative to base_dir.dir_output — sample subdirectory relative to output_dir; created on demand.resolution — instrument resolution; parsed with std::stof.charge — instrument polarity; forwarded as the polarity parameter of FIAMSDataProcessor (typical values "positive" / "negative").db_mapping — accurate-mass database mapping file (relative to base_dir); forwarded as the db:mapping parameter (three tab-separated columns: mass, formula, identifier).db_struct — accurate-mass database structure file (relative to base_dir); forwarded as the db:struct parameter (four tab-separated columns: identifier, name, SMILES, InChI).positive_adducts / negative_adducts — adduct list files (relative to base_dir).time — ";"-separated list of time windows in seconds (e.g. "30;60;90;180"); FIAMSDataProcessor::run is invoked once per window.The mzML path opened for each sample is therefore base_dir + dir_input + "/" + filename + ".mzML".
No column validation is performed; missing or mis-named keys raise the usual std::map::at exception.
|
default |
Default-construct an empty scheduler (no samples loaded, paths set to defaults).
| FIAMSScheduler | ( | std::string | filename, |
| std::string | base_dir = "/", |
||
| std::string | output_dir = "/", |
||
| bool | load_cached_ = true |
||
| ) |
Construct from a batch CSV and parse it immediately.
The CSV at filename is read during construction (see class documentation for the expected columns) and the parsed rows are kept for subsequent run calls.
| filename | Full path to the batch CSV file. |
| base_dir | Base directory used to resolve the per-row dir_input, db_mapping, db_struct, and adduct paths. Must end with a path separator. |
| output_dir | Output directory under which each row's dir_output is created. Must end with a path separator. |
| load_cached_ | Forwarded to FIAMSDataProcessor::run as its load_cached flag; if true, cached intermediate results are reused. |
|
default |
Default destructor.
|
default |
Copy constructor.
| const std::string & getBaseDir | ( | ) |
Return the base directory passed to the constructor.
| const std::string & getOutputDir | ( | ) |
Return the output directory passed to the constructor.
| const std::vector< std::map< std::string, std::string > > & getSamples | ( | ) |
Return the parsed batch as a vector of header-keyed std::map rows.
|
private |
Parse the batch CSV at filename_ and populate samples_.
Treats the first row as headers and every subsequent row as a sample; each row is stored as a header-keyed std::map<String, String>. Invoked by the constructor.
|
default |
Copy assignment.
| void run | ( | ) |
Run the batch: process every sample loaded from the CSV.
For each sample (rows are processed by an #pragma omp parallel for loop), this loads the mzML at base_dir/dir_input/filename.mzML, creates a fresh FIAMSDataProcessor with the per-row parameters, creates the per-sample dir_output directory if missing, and runs the processor once per time window listed in the row's time cell. Progress messages are emitted via OPENMS_LOG_INFO at the start and end of every (sample, time) pair.
|
private |
Base directory for per-sample input paths (must end with a path separator).
|
private |
CSV file describing the batch.
|
private |
Forwarded to FIAMSDataProcessor::run; reuse cached results when true.
|
private |
Base directory under which per-sample outputs are written (must end with a path separator).
|
private |
Parsed CSV rows; populated by loadSamples_.