File size: 3,454 Bytes
23d30d8
 
 
 
 
 
 
 
dcf733e
c906179
23d30d8
 
 
 
c906179
23d30d8
dcf733e
23d30d8
536a0fe
 
 
 
 
 
c906179
 
 
 
 
 
23d30d8
 
dcf733e
23d30d8
dcf733e
23d30d8
dcf733e
23d30d8
dcf733e
23d30d8
dcf733e
23d30d8
dcf733e
23d30d8
dcf733e
23d30d8
536a0fe
23d30d8
 
 
c906179
 
 
 
 
 
 
 
 
 
536a0fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c906179
 
 
 
 
 
 
 
 
 
 
 
 
536a0fe
c906179
536a0fe
 
 
 
 
c906179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536a0fe
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
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:
```python
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
```python
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
```bibtex
@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},
```