FFCharge
FFCharge is a lightweight, pure Rust library for fast, residue-based force field partial charge assignment in molecular modeling pipelines. It provides pre-computed atomic partial charges from AMBER and CHARMM force fields for proteins, nucleic acids, water, and ions.
Designed with no_std support and zero runtime dependencies, FFCharge is ideal for high-performance molecular dynamics preprocessing, biomolecular structure analysis, and integration into existing simulation workflows.
Features
- Zero Runtime Dependencies: Uses compile-time code generation with PHF for O(1) lookups.
no_stdCompatible: Suitable for embedded systems and WebAssembly targets.- Comprehensive Coverage: Supports 29 protein residues, 10 nucleic acid residues, 5 water models, and 66 ion types.
- Multiple Force Fields: AMBER (ff99SB/ff14SB/ff19SB, ff03) and CHARMM (C22/C27/C36/C36m) for proteins; AMBER and CHARMM for nucleic acids.
- Terminal-Aware: Handles N-terminal, C-terminal, and their protonation variants for proteins; 5' and 3' termini for nucleic acids.
- Type-Safe API: Strongly-typed enums for schemes and positions prevent runtime errors.
Installation
Add FFCharge to your Cargo.toml:
[]
= "0.2.0"
Quick Start
use ;
API Reference
For detailed API documentation, visit the API Documentation.
Data Coverage
For complete residue and atom listings, see data/README.md.
Summary:
- Proteins: 8,169 charge entries (29 residues × 5 positions × 3 schemes, varying atoms per residue)
- Nucleic Acids: 1,321 charge entries (10 residues × 3 positions × 2 schemes, varying atoms per residue)
- Water: 15 charge entries (5 models × 3 atoms)
- Ions: 66 ion types (formal charges)
License
This project is licensed under the MIT License - see the LICENSE file for details.