











[](https://codecov.io/gh/abhishektiwari/molr)
[](https://socket.dev/pypi/package/molr/overview/0.0.2/py3-none-any-whl)
[](https://www.codefactor.io/repository/github/abhishektiwari/molr/overview/main)
# 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 `byres` modifier
### 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
```bash
pip install molr
```
For development installation:
```bash
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](https://hbat.abhishek-tiwari.com/) for more details on how to use Molr for various use cases.
### Quick Example
```python
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](LICENSE) file for details.
## Contributing
See our [contributing guide](CONTRIBUTING.md) and [development guide](https://hbat.abhishek-tiwari.com/development). At a high-level,
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
Raw data
{
"_id": null,
"home_page": null,
"name": "molr",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "molecular, structure, chemistry, bioinformatics, pdb, spatial-indexing",
"author": null,
"author_email": "Abhishek Tiwari <molr@abhishek-tiwari.com>",
"download_url": "https://files.pythonhosted.org/packages/eb/55/81b8775db51e3084b7107d79b55781103a86c456ce5aebf80289ed64f17e/molr-0.0.3.tar.gz",
"platform": null,
"description": "\n\n\n\n\n\n\n\n\n\n\n\n\n[](https://codecov.io/gh/abhishektiwari/molr)\n[](https://socket.dev/pypi/package/molr/overview/0.0.2/py3-none-any-whl)\n[](https://www.codefactor.io/repository/github/abhishektiwari/molr/overview/main)\n\n# MolR - Molecular Realm for Spatial Indexed Structures\n\nA 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.\n\n\n## Features\n\n### High-Performance Structure Representation\n- NumPy-based Structure class with Structure of Arrays (SoA)\n- Efficient spatial indexing with scipy KDTree integration for O(log n) neighbor queries\n- Memory-efficient trajectory handling with StructureEnsemble\n- Lazy initialization of optional annotations to minimize memory usage\n\n### Comprehensive Bond Detection\n\n- Hierarchical bond detection with multiple providers:\n - File-based bonds from PDB CONECT records and mmCIF data\n - Template-based detection using standard residue topologies\n - Chemical Component Dictionary (CCD) lookup for ligands\n - Distance-based detection with Van der Waals radii\n- Intelligent fallback system ensures complete bond coverage\n- Partial processing support for incremental bond detection\n\n### Powerful Selection Language\n- MDAnalysis/VMD-inspired syntax for complex atom queries\n- Spatial selections with `within`, `around`, and center-of-geometry queries\n- Boolean operations (and, or, not) for combining selections\n- Residue-based selections with `byres` modifier\n\n### Multi-Format I/O Support\n- PDB format with multi-model support and CONECT record parsing\n- mmCIF format with chemical bond information extraction\n- Auto-detection of single structures vs. trajectories\n- String-based parsing for in-memory structure creation\n\n## Installation\n\n```bash\npip install molr\n```\n\nFor development installation:\n```bash\ngit clone https://github.com/abhishektiwari/molr.git\ncd molr\npip install -e .[dev]\n```\n\n## Requirements\n\n- Python \u22653.8\n- NumPy \u22651.20.0\n- SciPy \u22651.7.0 (for spatial indexing)\n- pyparsing \u22653.0.0 (for selection language)\n\n## Usage\n\nPlease review [Molr documentation](https://hbat.abhishek-tiwari.com/) for more details on how to use Molr for various use cases.\n\n### Quick Example\n\n```python\nimport molr\n\n# Load a structure\nstructure = molr.Structure.from_pdb(\"protein.pdb\")\n\n# Detect bonds\nbonds = structure.detect_bonds()\n\n# Use selection language\nactive_site = structure.select(\"within 5.0 of (resname HIS)\")\n\n# Fast spatial queries\nneighbors = structure.get_neighbors_within(atom_idx=100, radius=5.0)\n```\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing \n\nSee our [contributing guide](CONTRIBUTING.md) and [development guide](https://hbat.abhishek-tiwari.com/development). At a high-level,\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Molecular Realm for Spatial Indexed Structures - Fast spatial operations for molecular data",
"version": "0.0.3",
"project_urls": {
"Documentation": "https://molr.abhishek-tiwari.com/",
"Homepage": "https://github.com/abhishektiwari/molr",
"Issues": "https://github.com/abhishektiwari/molr/issues",
"Repository": "https://github.com/abhishektiwari/molr.git"
},
"split_keywords": [
"molecular",
" structure",
" chemistry",
" bioinformatics",
" pdb",
" spatial-indexing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "caf29b3d7f90f69c5608a546a14487772a3079e837841ed0dad5d874adcafc2d",
"md5": "fdae966a8a818ce2ea38207749c6932a",
"sha256": "fcb81b475fa6390e077af88b96e032247ea56f01d4b2ab6f73d908c23f039c4a"
},
"downloads": -1,
"filename": "molr-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fdae966a8a818ce2ea38207749c6932a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 3188663,
"upload_time": "2025-08-03T05:12:30",
"upload_time_iso_8601": "2025-08-03T05:12:30.818232Z",
"url": "https://files.pythonhosted.org/packages/ca/f2/9b3d7f90f69c5608a546a14487772a3079e837841ed0dad5d874adcafc2d/molr-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "eb5581b8775db51e3084b7107d79b55781103a86c456ce5aebf80289ed64f17e",
"md5": "60f4a1d903b3208c78feeed6ac44fa25",
"sha256": "d9b8045bc53b11024569577d7742d592f538e1450f0251592802f784ec5bba29"
},
"downloads": -1,
"filename": "molr-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "60f4a1d903b3208c78feeed6ac44fa25",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3160840,
"upload_time": "2025-08-03T05:12:32",
"upload_time_iso_8601": "2025-08-03T05:12:32.934378Z",
"url": "https://files.pythonhosted.org/packages/eb/55/81b8775db51e3084b7107d79b55781103a86c456ce5aebf80289ed64f17e/molr-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-03 05:12:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "abhishektiwari",
"github_project": "molr",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
">=",
"1.20.0"
]
]
},
{
"name": "scipy",
"specs": [
[
">=",
"1.7.0"
]
]
},
{
"name": "pyparsing",
"specs": [
[
">=",
"3.0.0"
]
]
},
{
"name": "pdbreader",
"specs": [
[
">=",
"0.1.0"
]
]
},
{
"name": "mmcif",
"specs": [
[
">=",
"0.92.0"
]
]
}
],
"lcname": "molr"
}