RMol
#
RMol(*args, id=None, template=None, **kwargs)
Bases: RInterface
, Mol
RMol is essentially a wrapper around RDKit Mol with tailored functionalities for attaching R groups, etc.
:param rmol: when provided, energies and additional metadata is preserved. :type rmol: RMol :param template: Provide the original molecule template used for this RMol.
Methods:
-
toxicity
–Assessed various ADMET properties, including
-
generate_conformers
–Generate conformers using the RDKIT's ETKDG. The generated conformers
-
optimise_in_receptor
–Enumerate the conformers inside of the receptor by employing
-
sort_conformers
–For the given molecule and the conformer energies order the energies
-
rep2D
–Use RDKit and get a 2D diagram.
-
rep3D
–Use py3Dmol to obtain the 3D view of the molecule.
-
remove_clashing_confs
–Removing conformations that class with the protein.
-
set_gnina
–Set the location of the binary file gnina. This could be your own compiled directory,
-
gnina
–Use GNINA to extract CNNaffinity, which we also recalculate to Kd (nM)
-
to_file
–Write the molecule and all conformers to file.
-
df
–Generate a pandas dataframe row for this molecule with SMILES.
Source code in fegrow/package.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
toxicity
#
toxicity()
Assessed various ADMET properties, including - Lipinksi rule of 5 properties, - the presence of unwanted substructures - problematic functional groups - synthetic accessibility
:return: a row of a dataframe with the descriptors :rtype: dataframe
Source code in fegrow/package.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
generate_conformers
#
generate_conformers(num_conf: int, minimum_conf_rms: Optional[float] = [], **kwargs)
Generate conformers using the RDKIT's ETKDG. The generated conformers are embedded into the template structure. In other words, any atoms that are common with the template structure, should have the same coordinates.
:param num_conf: fixme :param minimum_conf_rms: The minimum acceptable difference in the RMS in any new generated conformer. Conformers that are too similar are discarded. :type minimum_conf_rms: float :param flexible: A list of indices that are common with the template molecule that should have new coordinates. :type flexible: List[int]
Source code in fegrow/package.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
optimise_in_receptor
#
optimise_in_receptor(*args, **kwargs)
Enumerate the conformers inside of the receptor by employing ANI2x, a hybrid machine learning / molecular mechanics (ML/MM) approach. ANI2x is neural nework potential for the ligand energetics but works only for the following atoms: H, C, N, O, F, S, Cl.
Open Force Field Parsley force field is used for intermolecular interactions with the receptor.
:param sigma_scale_factor: is used to scale the Lennard-Jones radii of the atoms. :param relative_permittivity: is used to scale the electrostatic interactions with the protein. :param water_model: can be used to set the force field for any water molecules present in the binding site.
Source code in fegrow/package.py
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 182 183 184 185 186 187 |
|
sort_conformers
#
sort_conformers(energy_range=5)
For the given molecule and the conformer energies order the energies and only keep any conformers with in the energy range of the lowest energy conformer.
:param energy_range: The energy range (kcal/mol), above the minimum, for which conformers should be kept.
Source code in fegrow/package.py
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 |
|
rep2D
#
rep2D(idx=-1, rdkit_mol=False, h=True, **kwargs)
Use RDKit and get a 2D diagram. Uses Compute2DCoords and Draw.MolToImage function
Works with IPython Notebook.
:param **kwargs: are passed further to Draw.MolToImage function.
Source code in fegrow/package.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
rep3D
#
rep3D(view=None, prody=None, template=False, confIds: Optional[List[int]] = None)
Use py3Dmol to obtain the 3D view of the molecule.
Works with IPython Notebook.
:param view: a view to which add the visualisation. Useful if one wants to 3D view multiple conformers in one view. :type view: py3Dmol view instance (None) :param prody: A prody protein around which a view 3D can be created :type prody: Prody instance (Default: None) :param template: Whether to visualise the original 3D template as well from which the molecule was made. :type template: bool (False) :param confIds: Select the conformations for display. :type confIds: List[int]
Source code in fegrow/package.py
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 |
|
remove_clashing_confs
#
remove_clashing_confs(protein: Union[str, PDBFile], min_dst_allowed=1.0)
Removing conformations that class with the protein. Note that the original conformer should be well docked into the protein, ideally with some space between the area of growth and the protein, so that any growth on the template doesn't automatically cause clashes.
:param protein: The protein against which the conformers should be tested. :type protein: filename or the openmm PDBFile instance or prody instance :param min_dst_allowed: If any atom is within this distance in a conformer, the conformer will be deleted. :type min_dst_allowed: float in Angstroms
Source code in fegrow/package.py
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 |
|
set_gnina
staticmethod
#
set_gnina(loc)
Set the location of the binary file gnina. This could be your own compiled directory, or a directory where you'd like it to be downloaded.
By default, gnina path is to the working directory (~500MB).
:param loc: path to gnina binary file. E.g. /dir/path/gnina. Note that right now gnina should be a binary file with that specific filename "gnina". :type loc: str
Source code in fegrow/package.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
_check_download_gnina
staticmethod
#
_check_download_gnina()
Check if gnina works. Otherwise, download it.
Source code in fegrow/package.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
|
gnina
#
gnina(receptor_file, gnina_gpu=False)
Use GNINA to extract CNNaffinity, which we also recalculate to Kd (nM)
LIMITATION: The GNINA binary does not support MAC/Windows.
Please cite GNINA accordingly: McNutt, Andrew T., Paul Francoeur, Rishal Aggarwal, Tomohide Masuda, Rocco Meli, Matthew Ragoza, Jocelyn Sunseri, and David Ryan Koes. "GNINA 1.0: molecular docking with deep learning." Journal of cheminformatics 13, no. 1 (2021): 1-20.
:param receptor_file: Path to the receptor file. :type receptor_file: str
Source code in fegrow/package.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 |
|
to_file
#
to_file(filename: str)
Write the molecule and all conformers to file.
Note
The file type is worked out from the name extension by splitting on .
.
Source code in fegrow/package.py
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
|
df
#
df()
Generate a pandas dataframe row for this molecule with SMILES.
:returns: pandas dataframe row.
Source code in fegrow/package.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
|