--- pretty_name: UltraMS MSnLib benchmark (formula-level split A + strict-adduct molecule-level split B) license: cc-by-4.0 language: - en size_categories: - 100K **Disjointness.** Split A is formula-disjoint (no formula in two folds); split B is > molecule-disjoint within each polarity (the train / validation / test compound sets are > pairwise empty). The two splits must **not** be merged into a global-disjointness claim: > about 41 % of split-B compounds lie in a different split-A fold, and a spectrum can be > split-A test while its compound is split-B train. See the package > `figures_mapping.md` §2 for the full cross-tabulation. ## Usage ```python import pandas as pd base = "https://huggingface.co/datasets/dsadd4/UltraMS-MSnLib-Benchmark/resolve/main/" # split A — formula-level split of the full library formulas = pd.read_csv(base + "split_A_full_msnlib/formula_split.csv") rows = pd.read_csv(base + "split_A_full_msnlib/row_formula_fold.csv") # 560,084 rows test = pd.read_csv(base + "split_A_full_msnlib/test_spectra.csv") # 57,437 rows assert formulas.groupby("formula")["fold"].nunique().max() == 1 # split B — strict-adduct molecule-level library search compound_split = pd.read_csv(base + "splits/pos_compound_split.csv") queries = pd.read_csv(base + "queries/pos_test_queries.csv") library = pd.read_csv(base + "libraries/pos_test_library.csv") positives = library.groupby("canonical_isomeric_smiles").size() n_pos = queries["canonical_isomeric_smiles"].map(positives).fillna(0).astype(int) denominator = int((n_pos > 0).sum()) # 6,201 ``` With `datasets` (one config per table, see the YAML header): ```python from datasets import load_dataset queries = load_dataset("dsadd4/UltraMS-MSnLib-Benchmark", "split_B_pos_test_queries", split="train") ``` Peak data are **not** part of the split tables. Every row is joined back to the spectra by `row_index` / `msnlib_csv_data_row` / `first_msnlib_csv_data_row`, which point into `MSnLib.csv`. `MSnLib.csv` and `MSnLib_candidates.json` are hosted in the same dataset; see **Hosted files** below. ## Columns * `split_A_full_msnlib/formula_split.csv`: `formula, fold, n_spectra` * `split_A_full_msnlib/row_formula_fold.csv`: `row_index, formula, fold` * `split_A_full_msnlib/{test,val}_spectra.csv`: `row_index, smiles, precursor_mz, adduct, collision_energy, fold, canonical_isomeric_smiles` * `split_A_full_msnlib/test_molecules_voting.csv`: `group_id, smiles, n_spectra` — **official** voting units: 5,002 MSnLib-source-SMILES groups covering 57,436 spectra, the grouping of the published multiple-spectrum voting task (`n_molecules = 5002`) * `split_A_full_msnlib/test_molecules_voting_canonical_view.csv`: `group_id, canonical_isomeric_smiles, n_spectra` — alternative canonical view: 4,888 groups covering the same 57,436 spectra * `split_A_full_msnlib/msnlib_rt.csv.gz`: `row_index, rt` — per-spectrum retention time in seconds, aligned 1:1 to the `MSnLib.csv` data rows (560,084 rows) * `splits/*_compound_split.csv`: `polarity, compound_id, canonical_isomeric_smiles, split, n_spectra, n_frozen_queries, n_raw_smiles_variants, first_msnlib_csv_data_row` * `queries/*.csv`: `polarity, split, query_index, compound_id, canonical_isomeric_smiles, adduct, msnlib_csv_data_row, msnlib_csv_line, precursor_mz, n_peaks, collision_energy, source_smiles_raw, n_library_positives` * `libraries/*.csv`: same as queries with `library_index` and `compound_split` instead of `query_index`; row order is the frozen library order ## Split-B evaluation protocol 1. Score every query against the complete library of its task (no candidate short list). 2. Correct = the top-1 library spectrum has the same canonical compound identity. 3. Empirical FDR = `(accepted − correct) / accepted`; identification recall = `correct / n_queries_with_library_positive` (6,201 / 3,160 for the two test tasks). Queries without a library positive enter the FDR denominator but not the recall denominator; `n_library_positives` is provided per query. 4. The test library contains all preprocessed spectra of the polarity except the selected test queries; the validation library contains train and validation compounds only. 5. Validation is for model selection only; evaluate the test fold once. ## Hosted files The dataset hosts the complete manifest plus two large source files. Every file of the manifest is checksummed in `SHA256SUMS`; the two large files are kept in a separate upload step (see `hf_upload_commands.sh`, dry-run by default). | hosted file | bytes | SHA-256 | purpose | | --- | ---: | --- | --- | | manifest: `split_A_full_msnlib/`, `splits/`, `queries/`, `libraries/`, `protocol/`, `rebuild/`, docs (59 files) | ≈ 185.2 MiB | see `SHA256SUMS` | the two benchmark splits, verifier, docs | | `split_A_full_msnlib/msnlib_rt.csv.gz` | 1,483,069 | `994053612db874f7ac7985f278e04cc3463f3b93cd649a195bd167c4c6c7d3d8` | compact per-spectrum retention time (`row_index, rt` in seconds), aligned 1:1 to `MSnLib.csv`; used by the label-blind grouping analysis | | `MSnLib.csv` | 752,707,651 | `be54b33039cf18675751ea3c6354b592177c899a0cd5df303ae616330133ec07` | full source CSV: one row per MSnLib spectrum (560,084 rows); every row pointer in the split tables resolves here | | `MSnLib_candidates.json` | 1,368,264,026 | `125a1cdcc57a3fcef8cc76d5322ac0c434cd09b0bfb9e0c9d28bddf052f45fcc` | candidate SMILES lists behind the single-spectrum candidate-ranking task: a JSON object mapping a query SMILES string to its candidate SMILES list (9,886 query entries) | `MSnLib.csv` is the UltraMS CSV conversion of the MSnLib original release (Zenodo 10.5281/zenodo.11163380, CC BY 4.0), whose 18 per-file MS2 JSONL record lists contain the same 560,084 spectra. `MSnLib_candidates.json` contains candidate SMILES lists derived from the MSnLib compound set; both files carry the MSnLib attribution. ## Provenance, verification, license * Source rows: `MSnLib.csv` (560,084 rows) converted from the MSnLib original release (Brungs et al., CC BY 4.0; Zenodo 10.5281/zenodo.11163380). * Hosted source files: `MSnLib.csv` (752,707,651 bytes, SHA-256 `be54b330…`) and `MSnLib_candidates.json` (1,368,264,026 bytes, SHA-256 `125a1cdc…`). * Frozen split-B manifest, seeds 42 / 43, query seed 119; frozen split-A fold assignment from the `fold` column of `MSnLib.csv`. * `SHA256SUMS` covers every file; `rebuild/verify_release.py` is a self-contained verifier that re-checks every count, ordering hash, disjointness statement, cross-split statistic and checksum offline. * License **CC BY 4.0**, with attribution to MSnLib (CC BY 4.0); Apache-2.0 for the two UltraMS producer scripts. See the package `NOTICE.md`. ## Citation ```bibtex @misc{ultrams_msnlib_benchmark_2026, title = {UltraMS MSnLib benchmark: full-library formula-level split and strict-adduct molecule-level library-search split}, author = {Li, Yifan and Zhong, Yunhua and Liu, Pan and Xia, Jun}, year = {2026}, note = {Derived from MSnLib (Brungs, Schmid, Pluskal; CC BY 4.0, Zenodo 10.5281/zenodo.11163380)}, howpublished = {Hugging Face / Zenodo dataset, version 1.0.0} } ``` Please also cite MSnLib (doi:10.1038/s41592-025-02813-0) and the UltraMS manuscript.