Data Pipeline
data_pipeline
Data pipeline utility for downloading and parsing experimental BMRB chemical shifts.
This module provides functions to download NMR-STAR files from BMRB and PDB files from RCSB, and parse them into a format suitable for training the Neural Shift Predictor.
Functions:
ensure_data_dir_exists(data_dir='data')
download_bmrb_file(bmrb_id, data_dir='data')
Downloads an NMR-STAR file from BMRB.
Source code in synth_nmr/data_pipeline.py
download_pdb_file(pdb_id, data_dir='data')
Downloads a PDB file from RCSB.
Source code in synth_nmr/data_pipeline.py
parse_bmrb_shifts(filepath)
Parses an NMR-STAR file and extracts actual experimental chemical shifts.
Returns:
| Type | Description |
|---|---|
Dict[int, Dict[str, float]]
|
A dictionary mapping: {seq_id: {atom_name: shift_value_ppm}} |
Source code in synth_nmr/data_pipeline.py
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
parse_bmrb_j_couplings(filepath)
Parses an NMR-STAR file and extracts actual experimental scalar J-couplings.
Returns:
| Type | Description |
|---|---|
Dict[int, Dict[str, float]]
|
A dictionary mapping: {seq_id: {coupling_code: value_hz}} |
Dict[int, Dict[str, float]]
|
Common codes: '3JHNHA', '3JHAHB', '3JCCG' |
Source code in synth_nmr/data_pipeline.py
parse_bmrb_restraints(filepath)
Parses an NMR-STAR file and extracts distance restraints (NOEs).
EDUCATIONAL BACKGROUND — NOE Restraints in NMR-STAR ─────────────────────────────────────────────────────────────────── In the BMRB (BioMagResBank), NOE data is typically stored in distance_restraint loops. These loops define pairs of atoms and an upper distance bound (e.g., 5.0 Å) derived from the NOE intensity.
This function extracts: 1. Res ID and Atom Name for both atoms in the pair. 2. The Target Value (distance) and Upper Limit.
These are essential for calculating RPF (Recall, Precision, F-measure) scores, which assess how well a structure satisfies experimental NOEs.
Returns:
| Type | Description |
|---|---|
List[Dict]
|
List[Dict]: List of restraints in a format compatible with RPF calculation. |
Source code in synth_nmr/data_pipeline.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
load_matched_dataset(data_dir='data')
Downloads and prepares a list of (Structure, ExperimentalShifts) pairs.