Molecular Realm for Spatial Indexed Structures - Fast spatial operations for molecular data
Project description
MolR - Molecular Realm for Spatial Indexed Structures
A high-performance Python package that creates a spatial realm for molecular structures, providing lightning-fast neighbor searches, geometric queries, and spatial operations through integrated KDTree indexing.
Features
High-Performance Structure Representation
- NumPy-based Structure class with Structure of Arrays (SoA)
- Efficient spatial indexing with scipy KDTree integration for O(log n) neighbor queries
- Memory-efficient trajectory handling with StructureEnsemble
- Lazy initialization of optional annotations to minimize memory usage
Comprehensive Bond Detection
- Hierarchical bond detection with multiple providers:
- File-based bonds from PDB CONECT records and mmCIF data
- Template-based detection using standard residue topologies
- Chemical Component Dictionary (CCD) lookup for ligands
- Distance-based detection with Van der Waals radii
- Intelligent fallback system ensures complete bond coverage
- Partial processing support for incremental bond detection
Powerful Selection Language
- MDAnalysis/VMD-inspired syntax for complex atom queries
- Spatial selections with
within,around, and center-of-geometry queries - Boolean operations (and, or, not) for combining selections
- Residue-based selections with
byresmodifier
Multi-Format I/O Support
- PDB format with multi-model support and CONECT record parsing
- mmCIF format with chemical bond information extraction
- Auto-detection of single structures vs. trajectories
- String-based parsing for in-memory structure creation
Installation
pip install molr
For development installation:
git clone https://github.com/abhishektiwari/molr.git
cd molr
pip install -e .[dev]
Requirements
- Python ≥3.8
- NumPy ≥1.20.0
- SciPy ≥1.7.0 (for spatial indexing)
- pyparsing ≥3.0.0 (for selection language)
Usage
Please review Molr documentation for more details on how to use Molr for various use cases.
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)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
See our contributing guide and development guide. At a high-level,
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
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 molr-0.0.3.tar.gz.
File metadata
- Download URL: molr-0.0.3.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9b8045bc53b11024569577d7742d592f538e1450f0251592802f784ec5bba29
|
|
| MD5 |
60f4a1d903b3208c78feeed6ac44fa25
|
|
| BLAKE2b-256 |
eb5581b8775db51e3084b7107d79b55781103a86c456ce5aebf80289ed64f17e
|
Provenance
The following attestation bundles were made for molr-0.0.3.tar.gz:
Publisher:
release.yml on abhishektiwari/molr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molr-0.0.3.tar.gz -
Subject digest:
d9b8045bc53b11024569577d7742d592f538e1450f0251592802f784ec5bba29 - Sigstore transparency entry: 345508051
- Sigstore integration time:
-
Permalink:
abhishektiwari/molr@a23514e5318236df94408ecd5dacfbcd2d09d126 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a23514e5318236df94408ecd5dacfbcd2d09d126 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file molr-0.0.3-py3-none-any.whl.
File metadata
- Download URL: molr-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb81b475fa6390e077af88b96e032247ea56f01d4b2ab6f73d908c23f039c4a
|
|
| MD5 |
fdae966a8a818ce2ea38207749c6932a
|
|
| BLAKE2b-256 |
caf29b3d7f90f69c5608a546a14487772a3079e837841ed0dad5d874adcafc2d
|
Provenance
The following attestation bundles were made for molr-0.0.3-py3-none-any.whl:
Publisher:
release.yml on abhishektiwari/molr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molr-0.0.3-py3-none-any.whl -
Subject digest:
fcb81b475fa6390e077af88b96e032247ea56f01d4b2ab6f73d908c23f039c4a - Sigstore transparency entry: 345508052
- Sigstore integration time:
-
Permalink:
abhishektiwari/molr@a23514e5318236df94408ecd5dacfbcd2d09d126 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/abhishektiwari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a23514e5318236df94408ecd5dacfbcd2d09d126 -
Trigger Event:
workflow_run
-
Statement type: