fedeotto commited on
Commit
07387de
·
verified ·
1 Parent(s): 486abb7

create dataset card

Browse files
Files changed (1) hide show
  1. README.md +278 -0
README.md ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - text-generation
5
+ - feature-extraction
6
+ language:
7
+ - en
8
+ tags:
9
+ - chemistry
10
+ - spectroscopy
11
+ - molecular-generation
12
+ - nmr
13
+ - infrared
14
+ - smiles
15
+ - deep-learning
16
+ - multimodal
17
+ size_categories:
18
+ - 1M<n<10M
19
+ ---
20
+
21
+ # NMIRacle Dataset
22
+
23
+ ## Dataset Description
24
+
25
+ This dataset supports the **NMIRacle** (NMr-IR orACLE) framework for *de novo* molecular structure elucidation from multi-modal spectroscopic data. It contains paired molecular structures (SMILES) with simulated spectroscopic measurements (IR, ¹H-NMR, ¹³C-NMR) and fragment annotations.
26
+
27
+ ### Dataset Summary
28
+
29
+ The dataset is organized into two subsets supporting the two-stage training paradigm of NMIRacle:
30
+
31
+ 1. **Pretrain Dataset** (~3.7M molecules): For fragment-to-molecule pre-training (Stage 1)
32
+ 2. **Multispectra Dataset** (~790K molecules): For spectra-to-molecule fine-tuning (Stage 2)
33
+
34
+ ### Supported Tasks
35
+
36
+ - **Molecular Structure Generation**: Generate SMILES from spectroscopic inputs
37
+ - **Fragment Prediction**: Predict substructure counts from spectra
38
+ - **Multi-modal Learning**: Learn joint representations across IR and NMR modalities
39
+
40
+ ### Languages
41
+
42
+ Chemical notation (SMILES, SMARTS)
43
+
44
+ ---
45
+
46
+ ## Dataset Structure
47
+
48
+ ```
49
+ nmiracle-dataset/
50
+ ├── pretrain/ # Stage 1: Fragment pre-training (~3.7M molecules)
51
+ │ ├── smiles.npy # Molecular SMILES strings
52
+ │ ├── substructures.h5 # Binary fragment presence vectors
53
+ │ ├── substructure_counts.h5 # Fragment occurrence counts
54
+ │ ├── split_indices.p # Train/val/test split indices
55
+ │ ├── pretrain_train_indices.npy # Train split indices (legacy)
56
+ │ ├── pretrain_val_indices.npy # Validation split indices (legacy)
57
+ │ └── pretrain_test_indices.npy # Test split indices (legacy)
58
+
59
+ └── multispectra/ # Stage 2: Spectra fine-tuning (~790K molecules)
60
+ ├── smiles.npy # Molecular SMILES strings
61
+ ├── spectra.h5 # Multi-modal spectra (IR + ¹H-NMR + ¹³C-NMR)
62
+ ├── substructures.h5 # Binary fragment presence vectors
63
+ ├── substructure_counts.h5 # Fragment occurrence counts
64
+ └── split_indices.p # Train/val/test split indices
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Data Fields
70
+
71
+ ### Molecular Data
72
+
73
+ | Field | Type | Description |
74
+ |-------|------|-------------|
75
+ | `smiles.npy` | numpy array (str) | Canonical SMILES strings representing molecular structures |
76
+
77
+ ### Spectroscopic Data (`spectra.h5`)
78
+
79
+ | Field | Shape | Description |
80
+ |-------|-------|-------------|
81
+ | `spectra` | (N, 21800) | Concatenated spectral intensities: IR (1800) + ¹H-NMR (10000) + ¹³C-NMR (10000) |
82
+
83
+ **Spectral Modalities:**
84
+
85
+ | Modality | Features | Range | Description |
86
+ |----------|----------|-------|-------------|
87
+ | **IR** | 1,800 | 400-4000 cm⁻¹ | Infrared absorption spectra (vibrational modes) |
88
+ | **¹H-NMR** | 10,000 | 0-14 ppm | Proton NMR spectra (hydrogen environments) |
89
+ | **¹³C-NMR** | 10,000 | 0-220 ppm | Carbon-13 NMR spectra (carbon backbone) |
90
+
91
+ ### Fragment Data
92
+
93
+ | Field | Type | Description |
94
+ |-------|------|-------------|
95
+ | `substructures.h5` | (N, 991) binary | Presence/absence of 991 SMARTS-defined fragments |
96
+ | `substructure_counts.h5` | (N, 991) int | Occurrence counts of each fragment in the molecule |
97
+
98
+ ### Split Indices
99
+
100
+ | Field | Type | Description |
101
+ |-------|------|-------------|
102
+ | `split_indices.p` | pickle dict | Dictionary with 'train', 'val', 'test' keys containing index arrays |
103
+
104
+ ---
105
+
106
+ ## Dataset Statistics
107
+
108
+ ### Pretrain Dataset (Stage 1)
109
+
110
+ | Statistic | Value |
111
+ |-----------|-------|
112
+ | **Total molecules** | ~3,700,000 |
113
+ | **Train split** | ~2,960,000 (80%) |
114
+ | **Validation split** | ~370,000 (10%) |
115
+ | **Test split** | ~370,000 (10%) |
116
+ | **Max heavy atoms** | 35 |
117
+ | **Element types** | C, N, O, S, F, Cl, Br, P, I (9 elements) |
118
+ | **Fragment vocabulary** | 991 SMARTS patterns |
119
+ | **Max fragment count** | 232 |
120
+
121
+ ### Multispectra Dataset (Stage 2)
122
+
123
+ | Statistic | Value |
124
+ |-----------|-------|
125
+ | **Total molecules** | ~790,000 |
126
+ | **Train split** | ~632,000 (80%) |
127
+ | **Validation split** | ~79,000 (10%) |
128
+ | **Test split** | ~79,000 (10%) |
129
+ | **Spectral features** | 21,800 total |
130
+ | **IR features** | 1,800 |
131
+ | **¹H-NMR features** | 10,000 |
132
+ | **¹³C-NMR features** | 10,000 |
133
+
134
+ ---
135
+
136
+ ## Data Preprocessing
137
+
138
+ ### Spectra Normalization
139
+
140
+ - **IR and ¹H-NMR**: Normalized to [0, 1] range; peak shapes and relative intensities preserved
141
+ - **¹³C-NMR**: Peak detection with 10% threshold, discretized into 80 bins (~2.75 ppm each)
142
+
143
+ ### Fragment Vocabulary
144
+
145
+ The dataset uses a curated vocabulary of **991 SMARTS patterns** covering common organic motifs including:
146
+ - Functional groups (hydroxyl, carbonyl, amine, etc.)
147
+ - Ring systems (aromatic, aliphatic, hetero)
148
+ - Chain patterns and substituents
149
+
150
+ ---
151
+
152
+ ## Usage
153
+
154
+ ### Loading with Python
155
+
156
+ ```python
157
+ import numpy as np
158
+ import h5py
159
+ import pickle
160
+
161
+ # Load SMILES
162
+ smiles = np.load('multispectra/smiles.npy', allow_pickle=True)
163
+
164
+ # Load spectra
165
+ with h5py.File('multispectra/spectra.h5', 'r') as f:
166
+ spectra = f['spectra'][:] # Shape: (N, 21800)
167
+
168
+ # Split spectra into modalities
169
+ ir_spectra = spectra[:, :1800] # IR: 1800 features
170
+ hnmr_spectra = spectra[:, 1800:11800] # ¹H-NMR: 10000 features
171
+ cnmr_spectra = spectra[:, 11800:] # ¹³C-NMR: 10000 features
172
+
173
+ # Load fragment counts
174
+ with h5py.File('multispectra/substructure_counts.h5', 'r') as f:
175
+ fragment_counts = f['substructure_counts'][:] # Shape: (N, 991)
176
+
177
+ # Load splits
178
+ with open('multispectra/split_indices.p', 'rb') as f:
179
+ splits = pickle.load(f)
180
+
181
+ train_idx = splits['train']
182
+ val_idx = splits['val']
183
+ test_idx = splits['test']
184
+ ```
185
+
186
+ ### Using with NMIRacle Framework
187
+
188
+ ```python
189
+ from nmiracle.data.datamodule import SpectralDataModule
190
+ from nmiracle.data.tokenizer import BasicSmilesTokenizer
191
+
192
+ tokenizer = BasicSmilesTokenizer()
193
+ tokenizer.setup_alphabet(alphabet)
194
+
195
+ datamodule = SpectralDataModule(
196
+ config=config.data,
197
+ tokenizer=tokenizer
198
+ )
199
+ datamodule.setup()
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Dataset Creation
205
+
206
+ ### Source Data
207
+
208
+ - **Pretrain molecules**: Combined from GDB-17 database (~3M) and SpectraBase (~140K), augmented with molecules from Alberts et al. dataset (~670K)
209
+ - **Multispectra**: Derived from Alberts et al. (2024) multimodal spectroscopic dataset
210
+
211
+ ### Spectra Simulation
212
+
213
+ All spectra are computationally simulated:
214
+ - **IR**: Simulated infrared absorption using quantum chemical methods
215
+ - **NMR**: Simulated using established chemical shift prediction algorithms
216
+
217
+ ### Fragment Extraction
218
+
219
+ Fragment presence and counts are computed using RDKit's `GetSubstructMatches` function with the 991 SMARTS patterns in the vocabulary.
220
+
221
+ ---
222
+
223
+ ## Considerations for Using the Data
224
+
225
+ ### Social Impact
226
+
227
+ This dataset supports automated molecular structure elucidation, which can:
228
+ - **Accelerate drug discovery** by reducing manual spectral interpretation
229
+ - **Democratize chemistry** by making structure elucidation accessible to non-experts
230
+ - **Enable metabolomics research** through faster identification of unknown compounds
231
+
232
+ ### Biases
233
+
234
+ - **Simulated spectra**: All spectra are computationally simulated and may not capture all experimental artifacts (noise, baseline drift, solvent effects)
235
+ - **Chemical space coverage**: Dataset is biased toward drug-like organic molecules; may not generalize to organometallic compounds, polymers, or inorganic species
236
+ - **Element diversity**: Limited to 9 element types (C, N, O, S, F, Cl, Br, P, I)
237
+
238
+ ### Limitations
239
+
240
+ - **Stereochemistry**: IR and NMR spectra cannot distinguish absolute stereochemistry (enantiomers)
241
+ - **Experimental gap**: Models trained on simulated spectra may require domain adaptation for experimental data
242
+ - **Molecule size**: Limited to molecules with ≤35 heavy atoms
243
+
244
+ ---
245
+
246
+ ## Citation
247
+
248
+ If you use this dataset in your research, please cite:
249
+
250
+ ```bibtex
251
+ @article{nmiracle2025,
252
+ title={NMIRacle: Scalable Structure Elucidation from IR and NMR Spectra},
253
+ author={[Author Names]},
254
+ journal={arXiv preprint arXiv:XXXX.XXXXX},
255
+ year={2025}
256
+ }
257
+ ```
258
+
259
+ ### Related Datasets
260
+
261
+ - Alberts et al. (2024): Original multimodal spectroscopic dataset
262
+ - GDB-17: Chemical universe database
263
+
264
+ ---
265
+
266
+ ## License
267
+
268
+ This dataset is released under the **MIT License**.
269
+
270
+ ---
271
+
272
+ ## Dataset Curators
273
+
274
+ - [Your Name] - Imperial College London
275
+
276
+ ## Contact
277
+
278
+ For questions or issues regarding the dataset, please open an issue on the [NMIRacle GitHub repository](https://github.com/yourusername/nmiracle) or contact [your.email@example.com].