Skip to main content

Python wrapper for the PaDEL descriptors

Project description

License: MIT

PaDEL Python wrapper

Python wrapper to ease the calculation of PaDEL molecular descriptors and fingerprints.

Copyright notice

Olivier J. M. Béquignon is neither the copyright holder of PaDEL nor responsible for it.

Only the Python wrapper is the work of Olivier J. M. Béquignon.

Installation

From source:

git clone https://github.com/OlivierBeq/PaDEL_pywrapper.git
pip install ./PaDEL_pywrapper

with pip:

pip install padel-pywrapper

Get started

1D and 2D descriptors

Descriptors of the module PaDEL_pywrapper.descriptors can be computed as follows:

from PaDEL_pywrapper import PaDEL
from PaDEL_pywrapper.descriptors import CDK_ALOGPDescriptor, CDK_CrippenDescriptor, CDK_FMFDescriptor
from rdkit import Chem

smiles_list = [
    # erlotinib
    "n1cnc(c2cc(c(cc12)OCCOC)OCCOC)Nc1cc(ccc1)C#C",
    # midecamycin
    "CCC(=O)O[C@@H]1CC(=O)O[C@@H](C/C=C/C=C/[C@@H]([C@@H](C[C@@H]([C@@H]([C@H]1OC)O[C@H]2[C@@H]([C@H]([C@@H]([C@H](O2)C)O[C@H]3C[C@@]([C@H]([C@@H](O3)C)OC(=O)CC)(C)O)N(C)C)O)CC=O)C)O)C",
    # selenofolate
    "C1=CC(=CC=C1C(=O)NC(CCC(=O)OCC[Se]C#N)C(=O)O)NCC2=CN=C3C(=N2)C(=O)NC(=N3)N",
]
mols = [Chem.MolFromSmiles(smiles) for smiles in smiles_list]

descriptors = [CDK_ALOGPDescriptor, CDK_CrippenDescriptor, CDK_FMFDescriptor]

padel = PaDEL(descriptors)
print(padel.calculate(mols))

Instances of descriptors can be supplied as well.

descriptors = [CDK_ALOGPDescriptor(), CDK_CrippenDescriptor(), CDK_FMFDescriptor()]

padel = PaDEL(descriptors)
print(padel.calculate(mols))

To calculate all possible descriptors, import the descriptors list from the module PaDEL_pywrapper directly:

from PaDEL_pywrapper import descriptors

padel = PaDEL(descriptors)
print(padel.calculate(mols))

3D descriptors

By default, the ignore_3D parameter is set to True, preventing any provided 3D descriptor to be calculated.

Should molecules with 3D coordinates be provided, one can turn on 3D descriptor calculation.

from rdkit.Chem import AllChem

mols = [Chem.AddHs(mol) for mol in mols]
_ = [AllChem.EmbedMolecule(mol) for mol in mols]

padel = PaDEL(descriptors, ignore_3D=False)
print(padel.calculate(mols))

:warning: An exception is raised if molecules do not have 3D coordinates.

mol = Chem.MolFromSmiles('CCC')

padel = PaDEL(descriptors, ignore_3D=False)
print(padel.calculate([mol]))
# ValueError: Cannot calculate descriptors for a conformer-less molecule

Fingerprints

Fingerprints of the module `PaDEL_pywrapper.descriptors can be computed as follows:

from PaDEL_pywrapper.descriptors import GraphOnlyFingerprint

fp = GraphOnlyFingerprint

padel = PaDEL([fp], ignore_3D=False)
print(padel.calculate(mols))

Custom parameter sets can be provided for some fingerprints:

from PaDEL_pywrapper.descriptors import GraphOnlyFingerprint

fp = GraphOnlyFingerprint()
fp.set_params({'size': 2048, 'searchDepth': 8})

padel = PaDEL([fp], ignore_3D=False)
print(padel.calculate(mols))

Other parameters

class PaDEL:
    ...
    def calculate(self, mols: Iterable[Chem.Mol], show_banner: bool = True, njobs: int = 1, chunksize: int = 100):

Parameters

  • mols : Iterable[Chem.Mol]
    RDKit molecule objects for which to obtain PaDEL descriptors.
  • show_banner : bool
    Displays default notice about PaDEL descriptors.
  • njobs : int
    Maximum number of simultaneous processes. Ignored if self.descriptors are instances and not class names.
  • chunksize : int
    Maximum number of molecules each process is charged of. Ignored if self.descriptors are instances and not class names.

Details about descriptors

The path to the spreadsheet containing all details about the PaDEL descriptors can be found using:

print(padel.details)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

padel_pywrapper-0.1.0.post1.tar.gz (20.9 MB view details)

Uploaded Source

Built Distribution

padel_pywrapper-0.1.0.post1-py3-none-any.whl (20.9 MB view details)

Uploaded Python 3

File details

Details for the file padel_pywrapper-0.1.0.post1.tar.gz.

File metadata

  • Download URL: padel_pywrapper-0.1.0.post1.tar.gz
  • Upload date:
  • Size: 20.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for padel_pywrapper-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 851797c5d7961ec9b90e26339b8798a5d35da396fd7405851757a3efdc6cb4c5
MD5 4b86fb9127f04912aa47680b04888e3c
BLAKE2b-256 e18d57291aef9eb2a02512e7601faec22c5e3c7c7e63c449a97652569c715444

See more details on using hashes here.

File details

Details for the file padel_pywrapper-0.1.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for padel_pywrapper-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b98a9f81c54eca9bf6322258f82905bbbb06f9bff004e59fda45a77d9f08613
MD5 8517c61532700bc42314a6f43a31cc53
BLAKE2b-256 cdaa9e23b64affe4929b709e685508c51b1eb984464b8464ca4754aaac24c937

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page