A Python wrapper for PaDEL-Descriptor
Project description
padelpy2
padelpy2 is a Python wrapper for the PaDEL-Descriptor software, enabling fast and flexible calculation of molecular descriptors and fingerprints directly from Python.
📚 Documentation: For full API usage details, see the padelpy2 documentation.
Features
- Compute 1D, 2D, and 3D molecular descriptors and fingerprints using PaDEL-Descriptor
- Simple, object-oriented API for descriptor/fingerprint selection and calculation
- Native support for RDKit molecules
- Highly configurable (multithreading, 3D conversion, custom descriptor sets, etc.)
- Returns results as pandas DataFrames for easy downstream analysis
Installation
From PyPI
pip install padelpy2
With RDKit (PyPI version)
If you do not already have RDKit installed, you can install the PyPI build (version 2022.9.5) with:
pip install padelpy2[rdkit]
Note: The PyPI build of RDKit (
rdkit-pypi==2022.9.5) is limited and may not support all features or platforms. For best compatibility and performance, it is strongly recommended to install RDKit via conda or your preferred package manager.
From Source
git clone https://github.com/cognitive-chemistry-labs/padelpy2
cd padelpy2
pip install .
Requirements:
- Python 3.9–3.13
*If installing RDKit from pip, only Python 3.9–3.11 are supported. For Python 3.12+ use conda or another supported method. - RDKit (install via conda or pip; see note above)
- pandas
- Java Runtime Environment (JRE) 6 or higher must be installed and available on your system PATH. PaDEL-Descriptor is a Java application and will not run without Java. You can download Java from Oracle.
Quick Start
from rdkit import Chem
from padelpy2 import Calculator, descriptors
# Example molecules (SMILES)
smiles = [
"CN=C=O",
"CC(=O)NCCC1=CNc2c1cc(OC)cc2",
"OCCc1c(C)[n+](cs1)Cc2cnc(C)nc2N",
]
mols = [Chem.AddHs(Chem.MolFromSmiles(smi)) for smi in smiles]
# Calculate all available descriptors
calc = Calculator(descriptors)
results = calc(mols)
print(results)
Usage Examples
Calculate 2D Descriptors Only
from padelpy2 import Calculator, descriptors_2d
calc = Calculator(descriptors_2d)
results = calc(mols)
Calculate 3D Descriptors Only
from padelpy2 import Calculator, descriptors_3d
calc = Calculator(descriptors_3d)
results = calc(mols)
Calculate Fingerprints
from padelpy2 import Calculator, fingerprints
calc = Calculator(fingerprints)
results = calc(mols)
Calculate Specific Descriptors
from padelpy2.descriptors import MolecularWeight, XLogP
calc = Calculator([MolecularWeight, XLogP])
results = calc(mols)
Calculate a Specific Fingerprint
from padelpy2.fingerprints import MACCSFingerprinter
calc = Calculator([MACCSFingerprinter])
results = calc(mols)
API Overview
Calculator
The main interface for descriptor/fingerprint calculation.
Calculator(descriptors: Iterable[Descriptor or Fingerprint], config: PaDELConfig = None)
descriptors: List of descriptor/fingerprint objects (see below)config: Optional configuration (threads, 3D conversion, etc.)
Call
results = calc(mols)
mols: List of RDKit Mol objects- Returns: pandas DataFrame
Descriptor and Fingerprint Sets
descriptors: All available descriptors (1D, 2D, 3D)descriptors_2d: Only 2D descriptorsdescriptors_3d: Only 3D descriptorsfingerprints: All available fingerprints
Custom Configuration
from padelpy2 import PaDELConfig
config = PaDELConfig(threads=4, convert3d=True)
calc = Calculator(descriptors, config=config)
Low-Level Wrapper Usage
For advanced use cases, you can call the low-level PaDEL-Descriptor wrapper directly. This allows you to execute the underlying Java tool with custom arguments and file-based workflows.
Example: Using the padeldescriptor Function
from padelpy2.wrapper import padeldescriptor
# Calculate 2D descriptors for a directory of structure files (e.g., SDF or MOL)
output_csv = padeldescriptor(
d_2d=True,
mol_dir="/path/to/structures/", # directory or file with molecules
d_file="/path/to/output.csv", # output CSV file
threads=4, # number of threads
headless=True # run in headless mode (no GUI)
)
print(f"Results written to: {output_csv}")
Key Parameters
mol_dir: Path to a directory or file containing molecular structures (SDF, MOL, etc.)d_file: Output file for descriptors (CSV)d_2d,d_3d,fingerprints: Enable calculation of 2D, 3D descriptors, or fingerprintsthreads: Number of threads to useconfig,descriptortypes: Optional config or descriptor type filesconvert3d,removesalt,retainorder, etc.: Advanced options (see docstring inpadelpy2/wrapper.py)use_tempfile: IfTrueandd_fileis not set, a temporary file is used for output
Returns the path to the output file, or raises an error if the calculation fails.
See the function docstring in padelpy2/wrapper.py for a full list of options and details.
Links
For more examples, see the examples/ directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file padelpy2-0.1.0.tar.gz.
File metadata
- Download URL: padelpy2-0.1.0.tar.gz
- Upload date:
- Size: 20.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fe19f8f297e153d420bda518ea4856924c77690109053565d688b9fc723bf16
|
|
| MD5 |
7b4fc76eff19c1bd7f0dce6135765e80
|
|
| BLAKE2b-256 |
bd2562d25f32543a2499a4f9280f6ef676941211558730841db4d41fbfc02b24
|
File details
Details for the file padelpy2-0.1.0-py3-none-any.whl.
File metadata
- Download URL: padelpy2-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77f59f57b0cfaf020be7fb64c0dccfdfbf326de872394cc204b92cb57bc7983a
|
|
| MD5 |
972a2da3b17849ceb154166d3c7b9bfb
|
|
| BLAKE2b-256 |
d868d31d2adcfe7b57fd0fb0eebc22c034199d855df91af3239b7eeacdbd67c7
|