|
| static bool | isOneTableFile_ (const TextFile &text_file) |
| |
| static ExperimentalDesign | parseOneTableFile_ (const TextFile &text_file, const std::string &tsv_file, bool require_spectra_file) |
| |
| static ExperimentalDesign | parseTwoTableFile_ (const TextFile &text_file, const std::string &tsv_file, bool require_spectra_file) |
| |
| static void | parseHeader_ (const StringList &header, const std::string &filename, std::map< std::string, Size > &column_map, const std::set< std::string > &required, const std::set< std::string > &optional, bool allow_other_header) |
| |
| static void | parseErrorIf_ (const bool test, const std::string &filename, const std::string &message) |
| | Throws Exception::ParseError with filename and message if test is true.
|
| |
Load an experimental design from a TSV file.
The format – both the one-table and the two-table variant – its columns, the rules a design has to satisfy, and worked examples are documented on OpenMS::ExperimentalDesign. In short:
- TAB-separated; while parsing, lines and cells are whitespace trimmed and lines starting with a hash character (a comment) are ignored. A data row must have exactly as many cells as its header; since trimming removes a trailing empty cell, no row may end in an empty cell.
- The variant is auto-detected, by a check cruder than the parsers: it scans every line, not just headers, and reads the file as two-table as soon as one line has exactly one cell equal to
Sample and no cell equal to Fraction_Group. It neither trims cells nor skips comment lines. Otherwise the file is read as one-table. In a two-table file at least one blank line separates the sample section from the MS file section above it.
- Mandatory columns of the MS file section are
Fraction_Group, Fraction and Spectra_Filepath; Label (default 1) and Sample are optional. In the one-table format any further column is read as sample metadata, whereas the file section of a two-table design rejects unknown columns.
- A relative
Spectra_Filepath is resolved against the directory of the design file first, then against the current working directory.