|
Download split_A_full_msnlib/VERIFY.md from dsadd4/UltraMS-MSnLib-Benchmark: direct link, hf CLI and curl.
- Browser
- Download file 14.1 kB
-
https://huggingface.co/datasets/dsadd4/UltraMS-MSnLib-Benchmark/resolve/main/split_A_full_msnlib/VERIFY.md
- Command line
-
hf download hf://datasets/dsadd4/UltraMS-MSnLib-Benchmark/split_A_full_msnlib/VERIFY.md
-
curl -L -o VERIFY.md https://huggingface.co/datasets/dsadd4/UltraMS-MSnLib-Benchmark/resolve/main/split_A_full_msnlib/VERIFY.md
14.1 kB
| # VERIFY — UltraMS MSnLib formula-level split (split A) | |
| This document records **what was checked, how, and with which exact values** for the | |
| `msnlib_split_a_v1` tables. The split is a frozen benchmark definition: every spectrum of a | |
| molecular formula lies in exactly one fold. All numbers below were re-derived from the | |
| source `MSnLib.csv` and the shipped tables; nothing was written on the remote side. | |
| ## 1. Environments | |
| | side | runtime | | |
| | --- | --- | | |
| | isolated data-preparation environment (read-only access) | Linux, Python 3.10.12, RDKit 2026.03.5, NumPy 2.2.6 | | |
| | local post-processing (gzip twins, auxiliary voting table, cross-checks) | macOS, Python 3.13.11, NumPy 2.4.4, pandas 3.0.3, RDKit 2026.03.3 | | |
| The molecular formula and the frozen fold assignment do not depend on the RDKit patch | |
| release. The canonical isomeric SMILES strings were frozen with RDKit **2026.03.5**; other | |
| patch releases can serialise the same molecule differently (see §7). | |
| ## 2. Inputs | |
| | input | identity | | |
| | --- | --- | | |
| | `MSnLib.csv` | 560,084 data rows, 560,085 physical lines (no embedded newlines), 752,707,651 bytes, SHA-256 `be54b33039cf18675751ea3c6354b592177c899a0cd5df303ae616330133ec07`, columns `mzs,intensities,smiles,precursor_mz,adduct,collision_energy,fold` | | |
| | MSnLib original release | 18 per-file MS2 JSONL releases; 560,084 records in total (equal to the CSV data-row count); CC BY 4.0, Zenodo record 10.5281/zenodo.11163380 | | |
| | historical per-fold CSV files (cross-check only) | `MSnLib_test.csv` (57,437 rows) and `MSnLib_val.csv` (55,980 rows) in the same data workspace | | |
| | `MSnLib_with_rt.csv` (retention-time source) | 755,984,910 bytes, SHA-256 `a5b7c38228287c5c1de401050445319b331ee9a5f17993d6e104e9a734fe2964`; columns `mzs,intensities,smiles,precursor_mz,adduct,collision_energy,fold,rt` | | |
| Access to the data workspace was read-only: `MSnLib.csv` and the original JSON records | |
| were streamed out, the tables were computed in memory, and nothing was written or modified | |
| on the remote side. | |
| ## 3. Definition replayed | |
| 1. For every data row, parse `smiles` with `Chem.MolFromSmiles` and compute the neutral | |
| molecular formula with `rdMolDescriptors.CalcMolFormula`. | |
| 2. Read the frozen `fold` label of the row. | |
| 3. Require that the fold is a function of the formula only: every formula occurs in exactly | |
| one fold. | |
| 4. Export the tables. `row_formula_fold.csv` is the authoritative row → formula → fold | |
| mapping for all 560,084 spectra. | |
| ## 4. Counts — expected versus observed (all match) | |
| | quantity | expected | observed | status | | |
| | --- | ---: | ---: | --- | | |
| | data rows | 560,084 | 560,084 | PASS | | |
| | unique molecular formulas | 21,107 | 21,107 | PASS | | |
| | formulas train / validation / test | 16,885 / 2,110 / 2,112 | 16,885 / 2,110 / 2,112 | PASS | | |
| | spectra train / validation / test | 446,667 / 55,980 / 57,437 | 446,667 / 55,980 / 57,437 | PASS | | |
| | formulas occurring in more than one fold | 0 | 0 | PASS | | |
| | RDKit SMILES parse failures | 0 | 0 | PASS | | |
| | test spectra | 57,437 | 57,437 | PASS | | |
| | validation spectra | 55,980 | 55,980 | PASS | | |
| | voting groups, official (MSnLib source SMILES) | 5,002 | 5,002 | PASS | | |
| | voting spectra, official (MSnLib source SMILES) | 57,436 | 57,436 | PASS | | |
| | voting groups, canonical view | 4,888 | 4,888 | PASS | | |
| | voting spectra, canonical view | 57,436 | 57,436 | PASS | | |
| The formula-level proportions are 16,885 / 2,110 / 2,112 formulas (80.00 % / 10.00 % / | |
| 10.01 %) and 446,667 / 55,980 / 57,437 spectra (79.75 % / 9.99 % / 10.25 %). | |
| Additional structure: | |
| | quantity | value | | |
| | --- | --- | | |
| | unique source SMILES strings (all adducts) | 48,597 | | |
| | unique canonical isomeric SMILES (all adducts) | 47,662 | | |
| | canonical molecules with more than one source SMILES variant | 935 | | |
| | spectra per formula: min / median / mean / max | 1 / 15 / 26.535 / 627 | | |
| | formulas with exactly one spectrum | 25 | | |
| | test formulas | 2,112 | | |
| | test unique source SMILES / canonical molecules | 5,003 / 4,889 | | |
| | validation unique source SMILES / canonical molecules | 4,883 / 4,786 | | |
| | adducts present in the test / validation folds | 11 / 11 | | |
| Test-fold adduct distribution: `[M+H]+` 31,763, `[M-H]-` 13,824, `[M+FA]-` 5,884, | |
| `[M+Cl]-` 2,403, `[M+H-H2O]+` 1,252, `[M+NH4]+` 1,189, `[M+Na]+` 583, `[M]+` 287, | |
| `[M+H-2H2O]+` 169, `[M-H2O]+` 59, `[M]-` 24. Collision energies: 15 (4,264), 20 (30,383), | |
| 30 (6,041), 45 (3,289), 60 (13,429) and 75 eV (31). | |
| ## 5. Cross-checks against independent sources | |
| ### 5.1 Historical per-fold CSV files | |
| The exported test and validation spectra tables were compared row by row (same order) with | |
| `MSnLib_test.csv` and `MSnLib_val.csv` on `smiles`, `precursor_mz`, `adduct` and | |
| `collision_energy`: | |
| | file | rows | mismatches | status | | |
| | --- | ---: | ---: | --- | | |
| | `MSnLib_test.csv` | 57,437 | 0 | PASS | | |
| | `MSnLib_val.csv` | 55,980 | 0 | PASS | | |
| ### 5.2 `formula` field of the MSnLib original JSON records | |
| The MSnLib original release records carry an independent `formula` field. For every one of | |
| the 18 original files, the RDKit formula of the **first** record equals the recorded | |
| `formula` (18/18). Two complete files were streamed and compared record by record: | |
| | file | records | RDKit formula ≠ recorded formula | | |
| | --- | ---: | ---: | | |
| | `20241003_enammol_neg_ms2.json` | 12,825 | 0 | | |
| | `20241003_enammol_pos_ms2.json` | 24,352 | 0 | | |
| For the sample formula **C10H10BrN5O2**, three original records were located and checked; | |
| the recorded `formula` equals the RDKit formula of the recorded SMILES in all three. Two of | |
| them are different molecules that share the formula, which is exactly what the formula-level | |
| split groups together: | |
| | file | line | smiles | adduct | | |
| | --- | ---: | --- | --- | | |
| | `20241003_mcescaf_pos_ms2.json` | 9,998 | `O=C1CNC(=O)N1C1CN(c2ncc(Br)cn2)C1` | `[M+H]+` | | |
| | `20250828_mcediv_50k_sub_neg_ms2.json` | 23,736 | `O=C1CNC(=O)N1C1CN(c2ncc(Br)cn2)C1` | `[M-H]-` | | |
| | `20250828_mcediv_50k_sub_pos_ms2.json` | 2,551 | `COc1ccc(Br)cc1C(=O)Nc1nnn(C)n1` | `[M+H]+` | | |
| `MSnLib.csv` contains **23** spectra with formula C10H10BrN5O2, all in the **train** fold | |
| (so the sample formula does not leak into test). | |
| ### 5.3 Multiple-spectrum voting table of the UltraMS repository | |
| The repository summary | |
| `benchmarks/molecular_identification/data/multiple_spectrum_voting_summary.csv` reports | |
| `n_molecules = 5002` for the multiple-spectrum voting task. The per-group table | |
| `multiple_spectrum_voting_per_group.csv.gz` (5,002 groups, 57,436 spectra) was compared | |
| with our groupings: | |
| | comparison | result | | |
| | --- | --- | | |
| | repository groups vs. the **official** grouping by MSnLib source SMILES string (`test_molecules_voting.csv`) | **identical** member sets and group sizes (5,002 groups, 57,436 spectra) | | |
| | repository group strings vs. test-fold source SMILES set | all 5,002 repository strings are source SMILES strings of the test fold | | |
| | repository groups vs. grouping by RDKit canonical isomeric SMILES | **not identical**: the canonical grouping merges 114 of the repository groups into 4,888 chemically identical molecules | | |
| This is the only definition difference found; it is documented in §7 and in | |
| `REPORT.json` → `anomalies`. | |
| ### 5.4 Retention-time export | |
| `msnlib_rt.csv.gz` was exported from `MSnLib_with_rt.csv` in the data-preparation | |
| environment. Two files were read in parallel and compared row by row: | |
| | check | result | | |
| | --- | --- | | |
| | headers | 7-column `MSnLib.csv` header vs 8-column with-RT header, prefix identical | PASS | | |
| | rows compared | 560,084 / 560,084 | PASS | | |
| | first seven columns identical at every row | 0 mismatches | PASS | | |
| | extra rows at the end of either file | 0 / 0 | PASS | | |
| | unparsable RT values | 0 / 560,084 | PASS | | |
| | distinct RT strings | 8,369 (RT is not constant) | PASS | | |
| Because the row order and the first seven columns are identical, `row_index` alone is a | |
| complete join key to `MSnLib.csv`. The exported table is | |
| `msnlib_rt.csv.gz` — 1,483,069 bytes, SHA-256 | |
| `994053612db874f7ac7985f278e04cc3463f3b93cd649a195bd167c4c6c7d3d8`, 560,084 data rows, | |
| columns `row_index,rt`, gzipped only (no plain twin) to keep the package compact. | |
| ## 6. Frozen table hashes | |
| SHA-256 of the plain CSV files (the `.csv.gz` twins decompress to exactly these bytes): | |
| | file | rows | bytes | SHA-256 | | |
| | --- | ---: | ---: | --- | | |
| | `formula_split.csv` | 21,107 | 424,350 | `fcc44d1996d25306c884a6f8da30c1447fbe74f93c6fa12a3f271c0475a704b8` | | |
| | `row_formula_fold.csv` | 560,084 | 13,351,630 | `ac6113867fdda683304533f097fc7287c13271a2deac8e792d1316dcf00264ff` | | |
| | `test_spectra.csv` | 57,437 | 7,751,575 | `f2a870ba8ac9a54a36feaf1ecc12929ad9250ade2d082dc31454028c4b66b548` | | |
| | `val_spectra.csv` | 55,980 | 7,421,554 | `f4fa5e0f8875991bf9df2bcb67a05437271ee18c317f33d9108f3ec28a887a82` | | |
| | `test_molecules_voting.csv` | 5,002 | 276,185 | `edad6ec7d6b6f9fc4763deac5245207aee767c78661532621c87acc5a9b1ee07` | | |
| | `test_molecules_voting_canonical_view.csv` | 4,888 | 269,502 | `9fcd16ff4159e665833ea145848f94bee7c44115f4a858dd75fe486f15e92bd0` | | |
| Gzipped-only companion: `msnlib_rt.csv.gz` — 560,084 rows, 1,483,069 bytes, SHA-256 | |
| `994053612db874f7ac7985f278e04cc3463f3b93cd649a195bd167c4c6c7d3d8`. | |
| ## 7. Voting-unit definitions: official 5,002 source-SMILES groups vs 4,888 canonical groups | |
| The **official** multiple-spectrum voting unit is the MSnLib source SMILES string. The test | |
| fold contains 5,003 distinct source SMILES strings and 4,889 distinct RDKit canonical | |
| isomeric molecules: | |
| * grouping by the **source SMILES string** gives **5,002 groups** with ≥2 spectra covering | |
| **57,436 spectra** (one source string occurs in only one spectrum), and this grouping is | |
| **member-for-member identical** to the published repository table that defines | |
| `n_molecules = 5002`; it is shipped as `test_molecules_voting.csv`; | |
| * grouping by **RDKit canonical isomeric SMILES** gives **4,888 groups** covering the same | |
| 57,436 spectra, leaving exactly one single-spectrum molecule | |
| (`CC(C)(C)OC(=O)NCC1(CC(=O)O)CCCCC1`); it is shipped as | |
| `test_molecules_voting_canonical_view.csv` and is an **alternative chemical-deduplication | |
| view, not the official voting unit**. | |
| The difference is a property of the source library: 114 canonical molecules are written with | |
| more than one SMILES string among their test spectra. No data was altered to force either | |
| count. | |
| ## 8. Replay from `MSnLib.csv` | |
| `build_split_a.py` replays the complete split (formula computation, frozen fold assignment, | |
| all six tables) from `MSnLib.csv`. It was run **read-only in the isolated data-preparation environment** | |
| (RDKit 2026.03.5) without an output directory: | |
| ```bash | |
| python3 build_split_a.py --csv datasets/MSnLib/MSnLib.csv | |
| ``` | |
| Result: all 12 count checks passed, all 6 table SHA-256 values matched the frozen files, and | |
| the script exited 0. Transcript: | |
| ```text | |
| [PASS] n_data_rows: 560,084 (expected 560,084) | |
| [PASS] n_unique_formula: 21,107 (expected 21,107) | |
| [PASS] n_formula_train: 16,885 (expected 16,885) | |
| [PASS] n_formula_val: 2,110 (expected 2,110) | |
| [PASS] n_formula_test: 2,112 (expected 2,112) | |
| [PASS] n_spectra_train: 446,667 (expected 446,667) | |
| [PASS] n_spectra_val: 55,980 (expected 55,980) | |
| [PASS] n_spectra_test: 57,437 (expected 57,437) | |
| [PASS] n_voting_groups_official: 5,002 (expected 5,002) | |
| [PASS] n_voting_spectra_official: 57,436 (expected 57,436) | |
| [PASS] n_voting_groups_canonical: 4,888 (expected 4,888) | |
| [PASS] n_voting_spectra_canonical: 57,436 (expected 57,436) | |
| [PASS] formula_split.csv: 424,350 bytes sha256 fcc44d1996d25306c884a6f8da30c1447fbe74f93c6fa12a3f271c0475a704b8 | |
| [PASS] row_formula_fold.csv: 13,351,630 bytes sha256 ac6113867fdda683304533f097fc7287c13271a2deac8e792d1316dcf00264ff | |
| [PASS] test_spectra.csv: 7,751,575 bytes sha256 f2a870ba8ac9a54a36feaf1ecc12929ad9250ade2d082dc31454028c4b66b548 | |
| [PASS] val_spectra.csv: 7,421,554 bytes sha256 f4fa5e0f8875991bf9df2bcb67a05437271ee18c317f33d9108f3ec28a887a82 | |
| [PASS] test_molecules_voting.csv: 276,185 bytes sha256 edad6ec7d6b6f9fc4763deac5245207aee767c78661532621c87acc5a9b1ee07 | |
| [PASS] test_molecules_voting_canonical_view.csv: 269,502 bytes sha256 9fcd16ff4159e665833ea145848f94bee7c44115f4a858dd75fe486f15e92bd0 | |
| ``` | |
| A local replay needs `MSnLib.csv` (752,707,651 bytes, SHA-256 as in §2) and RDKit | |
| 2026.03.5. With a different RDKit patch release, the tables that carry canonical | |
| strings can differ textually while every count above still matches; the script reports that | |
| as a `DIFF` with an explanatory message (or a warning under `--lenient-rdkit`) and the | |
| formula tables are unaffected. | |
| ## 9. Simple structural checks | |
| ```bash | |
| # rows | |
| wc -l formula_split.csv row_formula_fold.csv test_spectra.csv val_spectra.csv \ | |
| test_molecules_voting.csv test_molecules_voting_canonical_view.csv | |
| # 21108 / 560085 / 57438 / 55981 / 5003 / 4889 (incl. header) | |
| # gzip -dc msnlib_rt.csv.gz | wc -l -> 560085 (incl. header) | |
| # csv.gz twins are byte-identical after decompression | |
| for f in *.csv; do cmp <(gzip -dc "$f.gz") "$f" || echo "MISMATCH $f"; done | |
| # formula-level uniqueness | |
| python3 - <<'PY' | |
| import csv, collections | |
| fold = {} | |
| for r in csv.DictReader(open("formula_split.csv")): | |
| fold[r["formula"]] = r["fold"] | |
| print(len(fold), collections.Counter(fold.values())) | |
| PY | |
| ``` | |
| ## 10. What could not be verified from this directory alone | |
| * The actual peak arrays (`mzs`/`intensities`) are not shipped; they live in `MSnLib.csv`. | |
| The row pointers and the row → formula → fold mapping in `row_formula_fold.csv` are the | |
| authoritative link back to the spectra. | |
| * The exact physical row order of `MSnLib.csv` (which follows the frozen UltraMS conversion | |
| of the MSnLib release records); the package depends on the row pointers, not on | |
| reconstructing that order from the release files. | |
| * The historical Figure-3 analysis artifacts themselves; only the published repository | |
| voting-group table was cross-checked (§5.3). | |
| ## 11. Version | |
| Split A release `1.0.0`, generated 2026-11-04. Any change to the tables, the fold | |
| assignment or the formula computation invalidates the hashes above and requires a new | |
| version directory. | |