Welcome to MolR’s documentation!#
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.
Contents:
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)