datamol.isomers
¶
canonical_tautomer(mol)
¶
Get the canonical tautomer of the current molecule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
A molecule. |
required |
Source code in datamol/isomers/_enumerate.py
257 258 259 260 261 262 263 264 |
|
count_stereoisomers(mol, n_variants=20, undefined_only=False, rationalise=True, timeout_seconds=None, clean_it=True, precise=False)
¶
Get the number of possible stereoisomers for a molecule.
Warning: By default, this function compute an estimtion number based on the stereo bonds which
gives an upper bound of possible stereoisomers. By setting precise=True
, the number is computed
by enumrerating the stereoisomers. However, it can be computationnaly intensive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
The molecule whose state we should enumerate. |
required |
n_variants |
int
|
The maximum amount of molecules that should be returned. |
20
|
undefined_only |
bool
|
If we should enumerate all stereocenters and bonds or only those with undefined stereochemistry. |
False
|
rationalise |
bool
|
If we should try to build and rationalise the molecule to ensure it can exist. |
True
|
timeout_seconds |
int
|
The maximum amount of time to spend on enumeration. None will disable the timeout. Note that the timeout might be inaccurate as a running single variant computation is not stopped when the duration is reached. |
None
|
clean_it |
bool
|
A flag for assigning stereochemistry. If True, it will remove previous stereochemistry markings on the bonds. |
True
|
precise |
bool
|
Whether compute counts by enumerate the stereoisomers using |
False
|
Source code in datamol/isomers/_enumerate.py
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 174 175 176 177 178 179 180 181 |
|
enumerate_stereoisomers(mol, n_variants=20, undefined_only=False, rationalise=True, timeout_seconds=None, clean_it=True)
¶
Enumerate the stereocenters and bonds of the current molecule.
Original source: the openff-toolkit
lib.
Warning: this function can be computationnaly intensive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
The molecule whose state we should enumerate. |
required |
n_variants |
int
|
The maximum amount of molecules that should be returned. |
20
|
undefined_only |
bool
|
If we should enumerate all stereocenters and bonds or only those with undefined stereochemistry. |
False
|
rationalise |
bool
|
If we should try to build and rationalise the molecule to ensure it can exist. |
True
|
timeout_seconds |
int
|
The maximum amount of time to spend on enumeration. None will disable the timeout. Note that the timeout might be inaccurate as a running single variant computation is not stopped when the duration is reached. |
None
|
clean_it |
bool
|
A flag for assigning stereochemistry. If True, it will remove previous stereochemistry markings on the bonds. |
True
|
Source code in datamol/isomers/_enumerate.py
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 |
|
enumerate_structisomers(mol, n_variants=20, allow_cycle=False, allow_double_bond=False, allow_triple_bond=False, depth=None, timeout_seconds=None)
¶
Enumerate the structural isomers of the input molecule
Warning: this function can be computationnaly intensive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
The molecule whose state we should enumerate. |
required |
n_variants |
int
|
The maximum amount of molecules that should be returned. |
20
|
allow_cycle |
bool
|
whether to allow transformation involving cycle creation. |
False
|
allow_double_bond |
bool
|
whether to allow transformation involving at least one double bond. |
False
|
allow_triple_bond |
bool
|
whether to allow transformation involving at least one triple bond. |
False
|
depth |
int
|
depth of the search, use a sensible value to decrease search time. Will fall back to number of atoms. |
None
|
timeout_seconds |
int
|
The maximum amount of time to spend on enumeration. None will disable the timeout. Note that the timeout might be inaccurate as a running single variant computation is not stopped when the duration is reached. |
None
|
Source code in datamol/isomers/_enumerate.py
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 |
|
enumerate_tautomers(mol, n_variants=20, max_transforms=1000, reassign_stereo=True, remove_bond_stereo=True, remove_sp3_stereo=True)
¶
Enumerate the possible tautomers of the current molecule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
The molecule whose state we should enumerate. |
required |
n_variants |
int
|
The maximum amount of molecules that should be returned. |
20
|
max_transforms |
int
|
Set the maximum number of transformations to be applied. This limit is usually hit earlier than the n_variants limit and leads to a more linear scaling of CPU time with increasing number of tautomeric centers (see Sitzmann et al.). |
1000
|
reassign_stereo |
bool
|
Whether to reassign stereo centers. |
True
|
remove_bond_stereo |
bool
|
Whether stereochemistry information is removed from double bonds involved in tautomerism. This means that enols will lose their E/Z stereochemistry after going through tautomer enumeration because of the keto-enolic tautomerism. |
True
|
remove_sp3_stereo |
bool
|
Whether stereochemistry information is removed from sp3 atoms involved in tautomerism. This means that S-aminoacids will lose their stereochemistry after going through tautomer enumeration because of the amido-imidol tautomerism. |
True
|
Source code in datamol/isomers/_enumerate.py
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 |
|
remove_stereochemistry(mol, copy=True)
¶
Removes all stereochemistry info from the molecule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
a molecule |
required |
copy |
bool
|
Whether to copy the molecule. |
True
|
Source code in datamol/isomers/_enumerate.py
243 244 245 246 247 248 249 250 251 252 253 254 |
|
IsomerEnumerator
¶
Implementation of the isomer enumeration algorithm described in https://doi.org/10.1186/s13321-017-0252-9
..note:: Due to the chemical reaction used, atom mapping will not be preserved !
Source code in datamol/isomers/_structural.py
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 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 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
|
__init__(allow_cycle=True, allow_double_bond=False, allow_triple_bond=False, rxn_list=None)
¶
Structural isomer enumeration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
allow_cycle |
bool
|
whether to allow transformation involving cycle creation |
True
|
allow_double_bond |
bool
|
whether to allow transformation involving at least one double bond |
False
|
allow_triple_bond |
bool
|
whether to allow transformation involving at least one triple bond |
False
|
rxn_list |
list
|
List of str to specifiy the reactions that should be used |
None
|
Source code in datamol/isomers/_structural.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
enumerate(mol, depth=None, include_input=True, protect_substruct=None, max_mols=None)
¶
Enumerate the list of isomers of the current mol
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mol |
Mol
|
input molecule or smiles |
required |
depth |
Optional[int]
|
optional maximum depth of the breadth search (default=None) |
None
|
include_input |
bool
|
whether to include the input molecule (default=True) |
True
|
protect_substruct |
Optional[Mol]
|
Optional substruct to protect |
None
|
max_mols |
Optional[int]
|
maximum number of molecule to sample |
None
|
Source code in datamol/isomers/_structural.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
|