| Crates.io | rust-sasa |
| lib.rs | rust-sasa |
| version | 0.3.2 |
| created_at | 2024-02-11 22:54:02.11942+00 |
| updated_at | 2025-07-13 06:18:26.233222+00 |
| description | RustSASA is a Rust library for computing the absolute solvent accessible surface area (ASA/SASA) of each atom in a given protein structure using the Shrake-Rupley algorithm. |
| homepage | |
| repository | https://github.com/maxall41/RustSASA |
| max_upload_size | |
| id | 1136159 |
| size | 6,352,136 |
RustSASA is a Rust library for computing the absolute solvent accessible surface area (ASA/SASA) of each atom in a given protein structure using the Shrake-Rupley algorithm[1]. It can be used in place of Freesasa, Biopython, or any other SASA calculation library. You can us it directly in Rust or use our Python bindings! We also have a CLI if you prefer that.
use pdbtbx::StrictnessLevel;
use rust_sasa::options::{SASAOptions, ResidueLevel};
let (mut pdb, _errors) = pdbtbx::open("./example.cif").unwrap();
let result = SASAOptions::<ResidueLevel>::new().process(&pdb);
Full documentation can be found here
You can now utilize RustSasa within Python to speed up your scripts! Take a look at rust-sasa-python!
Installation:
pip install rust-sasa-python
Example:
from rust_sasa_python import calculate_sasa_at_residue_level
# Also supports mmCIF files!
residue_sasa_values = calculate_sasa_at_residue_level("path_to_pdb_file.pdb")
See full docs here
rust-sasa path_to_pdb_file.pdb output.json # Also supports .xml, .pdb, and .cif!
rust-sasa input_directory/ output_directory/ --format json # Also supports .xml, .pdb, and .cif!
cargo add rust-sasa
pip install rust-sasa-python
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall rust-sasa
RustSasa: 8.071 s ± 0.361 s
Freesasa: 54.914 s ± 0.455 s
Biopython: 368.025 s ± 51.156 s
We computed residue level SASA values for the entire AlphaFold E. coli proteome structure database using RustSASA, Freesasa, and Biopython. Benchmarks were run with Hyperfine with options: --warmup 3 --runs 3. All three methods ran across 8 cores on an Apple M3 Macbook with 24GB of unified memory. The RustSASA CLI was used to take advantage of profile guided optimization. GNU Parallel was used to run Freesasa and Biopython in parallel.
MIT
Also see changelog.
Contributions are welcome! Please feel free to submit pull requests and open issues. As this is an actively developed library, I encourage sharing your thoughts, ideas, suggestions, and feedback.
1: Shrake A, Rupley JA. Environment and exposure to solvent of protein atoms. Lysozyme and insulin. J Mol Biol. 1973 Sep 15;79(2):351-71. doi: 10.1016/0022-2836(73)90011-9. PMID: 4760134.