Structure Utils
structure_utils
Utility functions for structure parsing and analysis.
Functions:
get_residue_info(structure)
Unified utility to extract residue-level metadata (Chain ID, Res ID, Res Name).
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
ndarray
|
(chain_ids, res_ids, res_names, res_starts) |
ndarray
|
All as NumPy arrays. |
Source code in synth_nmr/structure_utils.py
get_secondary_structure(structure)
Determine the secondary structure of each residue based on Phi/Psi angles.
EDUCATIONAL BACKGROUND — Secondary Structure and Chemical Shifts ─────────────────────────────────────────────────────────────────── Protein secondary structure (alpha-helices, beta-sheets, and loops/coils) is primarily defined by the hydrogen-bonding patterns between backbone amide and carbonyl groups. These patterns correlate strongly with the backbone dihedral angles: • Phi (φ): torsion around the N-CA bond. • Psi (ψ): torsion around the CA-C bond.
Measuring these angles accurately in 3D structures allows us to predict how local electronic environments around nuclei (like 1H, 13C, 15N) shift from their "random coil" baseline values. This is the physical basis for structure determination by NMR.
Returns:
| Type | Description |
|---|---|
List[str]
|
List of strings: 'alpha', 'beta', or 'coil', one for each residue |
List[str]
|
in the input structure (matching the order of get_residue_starts). |
Source code in synth_nmr/structure_utils.py
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 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 | |
calculate_c_beta_deviations(structure)
Calculate the deviation of C-beta atoms from their ideal tetrahedral positions.
EDUCATIONAL BACKGROUND — The C-beta Deviation Metric ─────────────────────────────────────────────────────────────────── In a high-quality protein structure, the C-beta (CB) atom should sit in a near-perfect tetrahedral geometry relative to the backbone atoms (N, CA, C). Because the CB position is so physically constrained, any significant "strain" or displacement is a sensitive indicator of problems in the backbone conformation or local steric clashes.
This metric was popularized by the Richardson and Montelione labs (Lovell et al., 2003) as part of the MolProbity validation suite.
How it's calculated: 1. An "ideal" CB position is reconstructed using the coordinates of N, CA, and C assuming standard bond lengths and tetrahedral angles. 2. The Euclidean distance between this ideal position and the actual CB position in the structure is measured. 3. Deviations > 0.25 Å are considered "outliers" and usually suggest that the residue's Phi/Psi angles are forced into an improbable state.
Significance for NMR: Structural strain often correlates with poor agreement between predicted and experimental chemical shifts, particularly for CA and CB nuclei.
Returns:
| Type | Description |
|---|---|
Dict[int, float]
|
Dict[int, float]: Mapping of res_id to deviation distance (Å). |
Source code in synth_nmr/structure_utils.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |