SLOTH Documentationο
Lazy by design. Fast by default.
SLOTH (Structural Loader with On-demand Traversal Handling) is a high-performance mmCIF parser for structural biology workflows. Built on the C++ gemmi backend, SLOTH performs eager parsing and lazy object construction β efficient for both large-scale pipelines and interactive exploration.
Key features:
High-speed parsing via the gemmi C++ backend
Lazy construction of row and item objects for memory efficiency
Pythonic dot-notation access to mmCIF data
Pluggable validation system with cross-category support
JSON export/import with automatic relationship resolution
from sloth import MMCIFHandler
handler = MMCIFHandler()
mmcif = handler.read("1abc.cif")
print(mmcif.data_1ABC._struct.title[0])
print(mmcif.data_1ABC._atom_site.Cartn_x[0])
Getting Startedο
User Guide
- Installation
- Quick Start
- Usage Guide
- Validation
- Import & Export
- π¦₯ SLOTH Cookbook
- Structural Loader with On-demand Traversal Handling
- Table of Contents
- 1. Setup and Installation
- 2. Import Required Libraries
- 3. Understanding SLOTHβs Core Components
- 4. Parsing mmCIF Files with Embedded Data
- 5. Exploring Data Structures with Dot Notation
- 6. Demonstrating 2D Slicing
- 7. Validating mmCIF Data
- 8. Modifying mmCIF Data
- 9. Creating Sample Data - Manual Approach
- 10. Creating Sample Data - Programmatic Approach
- 11. Creating Sample Data - Auto-Creation with Dot Notation β¨
- 12. Exporting to Nested JSON
- 13. Importing from JSON
- 14. Round-Trip Validation
- 15. Writing Modified mmCIF Files
- 16. Complete Workflow Example
- Summary
API Reference
Project