chen1028's picture
Update README.md
536a0fe verified
metadata
language:
  - zxx
license: cc-by-4.0
tags:
  - chemistry
  - mass-spectrometry
  - isotopic-patterns
  - tabular
  - chlorine
pretty_name: Cl-Containing Compound (MS1 Features)
size_categories:
  - 100K<n<1M
source_datasets:
  - pubchem
task_categories:
  - tabular-classification
configs:
  - config_name: default
    data_files:
      - split: train
        path: 80%_618272_train_binary.rds
      - split: test
        path: 20%_154568_test_binary.rds
  - config_name: csv
    data_files:
      - split: train
        path: train.csv
      - split: test
        path: test.csv
dataset_info:
  features:
    - name: mz0
      dtype: float32
    - name: int2_o_int0
      dtype: float32
    - name: int1_o_int0
      dtype: float32
    - name: RI2_RI1
      dtype: float32
    - name: mz_2_0
      dtype: float32
    - name: mz_1_0
      dtype: float32
    - name: has_cl
      dtype: int8
  config_name: default

Dataset Summary

Binary classification of chlorine presence using simulated MS1 isotopic patterns. Inputs are six engineered features; label has_cl indicates Cl-containing (1) vs non-Cl (0).

Data Sources and Generation

  • Simulated MS1 peaks (M, M+1, M+2, M+3, M+4) for PubChem molecular formulas.
  • Counts: 968,442 non-Cl; 386,420 Cl (1Cl: 185,303; 2Cl: 117,566; 3–5Cl: 83,551).
  • Features: mz0, int2_o_int0, int1_o_int0, RI2_RI1, mz_2_0, mz_1_0.
  • Class balancing: downsampled non-Cl to 386,420 (total 772,840).
  • Splits: 80% train (618,272), 20% test (154,568).
  • Files: 968442_non_cl_filter_S10.rds, 386420_cl_data.rds, 80%_618272_train_binary.rds, 20%_154568_test_binary.rds.

How train.csv and test.csv were created

  • Source splits come from the RDS files above: 80%_618272_train_binary.rds (train) and 20%_154568_test_binary.rds (test).
  • Conversion was done locally using Python with pyreadr and pandas (see data/converter.ipynb).
  • Steps:
    1. Read each .rds table using pyreadr.read_r(...)
    2. Optionally cast numeric columns to float32/int32 for compact CSVs
    3. Save to CSV with index=False as train.csv and test.csv

Example code used:

import pyreadr, pandas as pd

train_df = next(iter(pyreadr.read_r("80%_618272_train_binary.rds").values()))
test_df  = next(iter(pyreadr.read_r("20%_154568_test_binary.rds").values()))

train_df.to_csv("train.csv", index=False)
test_df.to_csv("test.csv", index=False)

Features

  • mz0: m/z of M
  • int2_o_int0: intensity ratio M+2/M
  • int1_o_int0: intensity ratio M+1/M
  • RI2_RI1: (M+2/M) − (M+1/M)
  • mz_2_0: m/z(M+2) − m/z(M)
  • mz_1_0: m/z(M+1) − m/z(M)
  • has_cl: target label (0/1)

Usage

from datasets import load_dataset

# Load CSVs from the Hub using the CSV builder
ds = load_dataset(
  "csv",
  data_files={
    "train": "hf://datasets/chen1028/Cl-Containing-Compound/train.csv",
    "test":  "hf://datasets/chen1028/Cl-Containing-Compound/test.csv",
  }
)

Citation

@article{doi:10.1021/acs.analchem.3c05124,
  author = {Zhao, Tingting and Wawryk, Nicholas J. P. and Xing, Shipei and Low, Brian and Li, Gigi and Yu, Huaxu and Wang, Yukai and Shen, Qiming and Li, Xing-Fang and Huan, Tao},
  title = {ChloroDBPFinder: Machine Learning-Guided Recognition of Chlorinated Disinfection Byproducts from Nontargeted LC-HRMS Analysis},
  journal = {Analytical Chemistry},
  volume = {96},
  number = {6},
  pages = {2590-2598},
  year = {2024},
  doi = {10.1021/acs.analchem.3c05124},
  note = {PMID: 38294426},
  url = {https://doi.org/10.1021/acs.analchem.3c05124},