Skip to main content

MDSASA-Bolt ⚡️

GitHub Actions Workflow Status PyPI - Version Python 3.11+ PyPI - Downloads

MDSASA-Bolt is a high-performance Python library for computing solvent accessible surface area (SASA) of molecular dynamics trajectories. It's a drop-in replacement for mdakit-sasa that leverages RustSASA under the hood to deliver dramatically improved performance while maintaining full compatibility with MDAnalysis workflows.

Features

  • ⚡️ Ludicrous Speed: 11x faster than mdakit-sasa.
  • 🔄 Drop-in Replacement: Compatible with existing mdakit-sasa workflows.
  • 🧬 MDAnalysis Integration: Seamlessly works with MDAnalysis Universe and AtomGroup objects.
  • 🦀 Powered by RustSASA: Leverages Rust's performance and safety.
  • 🧪 Validated: Tested against Freesasa/mdakit_sasa.
  • 📊 Trajectory Analysis: Built for analyzing entire MD trajectories efficiently
  • 🐍 Pure Python API: Familiar interface for Python developers

Quick Start

Installation

pip install mdsasa-bolt

Basic Usage

import MDAnalysis as mda
from mdsasa_bolt import SASAAnalysis

# Load your trajectory
u = mda.Universe("topology.pdb", "trajectory.dcd")

# Create SASA analysis
sasa_analysis = SASAAnalysis(u, select="protein")

# Run the analysis
sasa_analysis.run()

# Access results
print(f"Mean total SASA: {sasa_analysis.results.mean_total_area:.2f} Ų")
print(f"SASA per frame: {sasa_analysis.results.total_area}")
print(f"SASA per residue: {sasa_analysis.results.residue_area}")

Advanced Usage

import MDAnalysis as mda
from mdsasa_bolt import SASAAnalysis

# Load trajectory
u = mda.Universe("system.gro", "trajectory.xtc")

# Analyze specific selection with custom frame range
sasa_analysis = SASAAnalysis(
    u,
    select="resname LYS or resname ARG",  # Only basic residues
    start=100,                           # Start from frame 100
    stop=1000,                          # End at frame 1000
    step=10                             # Analyze every 10th frame
)

# Run analysis
sasa_analysis.run()

# Results are available as numpy arrays
total_sasa_per_frame = sasa_analysis.results.total_area
residue_sasa_matrix = sasa_analysis.results.residue_area  # Shape: (n_frames, n_residues)
mean_total_sasa = sasa_analysis.results.mean_total_area

Performance Benchmarks 🚀

Benchmarks were performed using molecular dynamics data for 4IAQ from the GPCRMD database. Hypefine (w/ runs =3) was used to measure the time taken. Results:

Method Time Speedup
mdsasa-bolt 40.396 s ± 2.630 s 11x faster
mdakit-sasa 450.930 s ± 1.215 s baseline

Test system: MDAnalysisTests trajectory data

Validation 📊

MDSASA-Bolt has been thoroughly validated against reference implementations to ensure accuracy:

Comparing SASA results

MDSASA-Bolt acheives a pearson correlation > 0.99 and an RMSE of 209.14 when compared against mdakit_sasa.

API Reference

SASAAnalysis

The main analysis class that integrates with MDAnalysis.

Parameters

  • universe_or_atomgroup (Universe or AtomGroup): MDAnalysis Universe or AtomGroup to analyze
  • select (str, optional): Selection string for atoms (default: "all")
  • start (int, optional): First frame to analyze
  • stop (int, optional): Last frame to analyze
  • step (int, optional): Step size between frames

Results

After calling run(), results are available in the results attribute:

  • total_area (numpy.ndarray): Total SASA for each frame
  • residue_area (numpy.ndarray): SASA per residue for each frame (shape: n_frames × n_residues)
  • mean_total_area (float): Mean total SASA across all frames

Contributing

Contributions are welcome! Please feel free to submit pull requests and open issues. As this is an actively developed library, we encourage sharing your thoughts, ideas, suggestions, and feedback.

⚠️ A Note on Compatibility with mdakit_sasa

Inferring the element of an atom can be quite complicated. mdsasa-bolt does it's best to match the freesasa element inference algorithm, but it may not always be accurate. We recommend test the output values of mdsasa-bolt against mdakit-sasa for your usecase before using it in production. We also recommend that you use input files with explicit element information whenever possible.

License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

Acknowledgments

Roadmap

  • Ovveride run method to pass all frame data into rust at start and then perform iteration and parallelization in rust. Should signifgantly improve performance.

Metadata

Release files for mdsasa_bolt 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdsasa_bolt 1.0.1
File Size Uploaded Provenance Actions
mdsasa_bolt-1.0.1.tar.gz 13.2 kB Without provenance Details for mdsasa_bolt-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mdsasa_bolt 1.0.1
File Interpreter ABI Platform Actions
mdsasa_bolt-1.0.1-py3-none-any.whl Python 3 none any Details for mdsasa_bolt-1.0.1-py3-none-any.whl

Total release size: 27.0 kB

Release files / mdsasa_bolt-1.0.1.tar.gz

Download URL mdsasa_bolt-1.0.1.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e8a56f5900d8a03ca7f8605caf3469d3553319a8f5e01712974605823c58d2ac
BLAKE2b-256 checksum
How to use checksums
1025ff38db4db62b92bb3727c02a29d72de6be58fb016fe0827889730eeb0963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / mdsasa_bolt-1.0.1-py3-none-any.whl

Download URL mdsasa_bolt-1.0.1-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd2c7dfe38b5f7b976c04db657f2bb205283051b32de1729b86bcc562ecb2fc8
BLAKE2b-256 checksum
How to use checksums
fd142090951434fc1149505f926c659a1ab386f5c71121cc0f9c80a366ded461
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Security for mdsasa_bolt 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page