or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

core-chemistry.mddescriptors.mdfeatures.mdindex.mdstructure-3d.mdvisualization.md
tile.json

tessl/pypi-rdkit

Platform wheels for RDKit - a comprehensive cheminformatics and machine-learning library with Python bindings

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/rdkit@2024.9.x

To install, run

npx @tessl/cli install tessl/pypi-rdkit@2024.9.0

index.mddocs/

RDKit

RDKit is a comprehensive cheminformatics and machine-learning library written in C++ with Python bindings. This package provides platform-specific wheels for easy installation across Linux, macOS, and Windows, containing compiled dynamic libraries and Python interfaces for molecular manipulation, chemical analysis, and machine learning applications in computational chemistry and drug discovery.

Package Information

  • Package Name: rdkit
  • Language: Python (C++ implementation)
  • Installation: pip install rdkit
  • Dependencies: numpy, Pillow (automatically installed)
  • Platforms: Linux (x86_64, aarch64), macOS (x86_64, arm64), Windows (x86_64)
  • Python Versions: 3.9-3.13

Core Imports

import rdkit

Core chemistry functionality:

from rdkit import Chem

Common specific imports:

from rdkit.Chem import AllChem, Descriptors, Descriptors3D
from rdkit.Chem import ChemicalFeatures, Draw
from rdkit import RDConfig

Basic Usage

from rdkit import Chem
from rdkit.Chem import Descriptors, AllChem, Draw

# Create a molecule from SMILES
smiles = "CCO"  # Ethanol
mol = Chem.MolFromSmiles(smiles)

# Calculate molecular descriptors
mw = Descriptors.MolWt(mol)
logp = Descriptors.MolLogP(mol)
print(f"Molecular Weight: {mw:.2f}")
print(f"LogP: {logp:.2f}")

# Generate 2D coordinates and create an image
AllChem.Compute2DCoords(mol)
img = Draw.MolToImage(mol, size=(300, 300))
img.save("molecule.png")

# Convert to MOL block format
mol_block = Chem.MolToMolBlock(mol)
print(mol_block)

Architecture

RDKit's architecture centers around the Mol object, which represents molecular structures and serves as the foundation for all cheminformatics operations:

  • Mol Objects: Core molecular representations with atoms, bonds, and properties
  • I/O Systems: Format converters for SMILES, SDF, MOL, PDB, and other chemical formats
  • Descriptor Calculators: 217+ molecular descriptors for characterizing chemical properties
  • 3D Generation: Conformer generation and 3D coordinate assignment algorithms
  • Drawing System: 2D molecular structure visualization with customizable rendering
  • Feature Systems: Pharmacophore and chemical feature detection frameworks
  • Data Resources: Built-in chemical databases, atom typing, and feature definitions

This design enables RDKit to serve as the foundational cheminformatics library for Python, providing essential molecular manipulation capabilities for computational chemistry, drug discovery, and chemical data analysis applications.

Capabilities

Core Chemistry

Fundamental molecular representation, manipulation, and I/O operations. Includes molecule creation from various formats, basic property access, and format conversions.

def MolFromSmiles(smiles: str, sanitize: bool = True) -> Mol: ...
def MolToSmiles(mol: Mol, **kwargs) -> str: ...
def MolFromMolBlock(molblock: str, **kwargs) -> Mol: ...
def MolToMolBlock(mol: Mol, **kwargs) -> str: ...

Core Chemistry

Molecular Descriptors

Calculation of 2D molecular descriptors for characterizing chemical properties. Includes 217+ descriptors covering molecular weight, logP, topological indices, and structural features.

def MolWt(mol: Mol) -> float: ...
def MolLogP(mol: Mol) -> float: ...
def NumHDonors(mol: Mol) -> int: ...
def NumHAcceptors(mol: Mol) -> int: ...
def CalcMolDescriptors(mol: Mol) -> dict: ...

Molecular Descriptors

3D Structure Generation

3D conformer generation, molecular embedding, and 3D descriptor calculations for spatial molecular analysis.

def EmbedMolecule(mol: Mol, **kwargs) -> int: ...
def Compute2DCoords(mol: Mol) -> None: ...
def CalcMolDescriptors3D(mol: Mol) -> dict: ...

3D Structure Generation

Molecular Visualization

2D molecular structure rendering and image generation with customizable display options for creating publication-quality molecular graphics.

def MolToImage(mol: Mol, size: tuple = (300, 300), **kwargs): ...
def ReactionToImage(reaction, **kwargs): ...

Molecular Visualization

Chemical Features

Pharmacophore and chemical feature detection for identifying functional groups, binding sites, and molecular patterns.

def BuildFeatureFactory(fdefName: str): ...

Chemical Features

Configuration

Data Directory Access

RDDataDir: str  # Path to RDKit data directory containing databases and definitions

RDKit includes extensive chemical data resources accessed through the RDDataDir configuration:

  • BaseFeatures.fdef: Chemical feature definitions for pharmacophore detection
  • Crippen.txt: Atom contribution data for logP calculations
  • Descriptors: Reference data for molecular descriptor calculations
  • FragmentDescriptors: Substructure-based descriptor definitions
  • AtomTypes: Atom typing schemes for various applications

Types

class Mol:
    """Core molecular representation object"""
    def GetNumAtoms() -> int: ...
    def GetNumBonds() -> int: ...
    def GetAtoms() -> list: ...
    def GetBonds() -> list: ...
    def GetPropsAsDict() -> dict: ...

class Atom:
    """Individual atom representation"""
    def GetAtomicNum() -> int: ...
    def GetSymbol() -> str: ...
    def GetIdx() -> int: ...

class Bond:
    """Chemical bond representation"""
    def GetBondType() -> BondType: ...
    def GetBeginAtomIdx() -> int: ...
    def GetEndAtomIdx() -> int: ...

class BondType:
    """Enumeration of chemical bond types"""
    SINGLE: int = 1
    DOUBLE: int = 2
    TRIPLE: int = 3
    AROMATIC: int = 4