Welcome to MolR’s documentation!#

GitHub Release GitHub Actions Test Workflow Status https://img.shields.io/pypi/v/molr https://img.shields.io/pypi/wheel/molr https://img.shields.io/pypi/pyversions/molr?logo=python&logoColor=white https://img.shields.io/github/last-commit/abhishektiwari/molr/main PyPI - Status Conda Version https://img.shields.io/github/license/abhishektiwari/molr GitHub Downloads (all assets, all releases) PyPI Downloads Codecov Coverage Socket CodeFactor

MolR (Molecular Realm for Spatial Indexed Structures) is a high-performance Python package that creates a spatial realm for molecular structures, enabling lightning-fast neighbor searches, geometric queries, and spatial operations through integrated KDTree indexing.

Key Features#

  • High-Performance Structure Representation: NumPy-based Structure class with Structure of Arrays (SoA) design

  • Efficient Spatial Indexing: Built-in scipy KDTree integration for O(log n) neighbor queries

  • Comprehensive Bond Detection: Hierarchical system with multiple providers

  • Powerful Selection Language: MDAnalysis/VMD-inspired syntax for complex atom queries

  • Multi-Format I/O Support: PDB and mmCIF formats with automatic structure/trajectory detection

Quick Example#

import molr

# Load a structure
structure = molr.Structure.from_pdb("protein.pdb")

# Detect bonds
bonds = structure.detect_bonds()

# Use selection language
active_site = structure.select("within 5.0 of (resname HIS)")

# Fast spatial queries
neighbors = structure.get_neighbors_within(atom_idx=100, radius=5.0)

Indices and tables#