Skip to main content

Fast algorithms for MD trajectories

Project description

Rust Simulation Tools

CI/CD PyPI version

Fast MD trajectory processing and analysis in Rust with a Python API.

Installation

pip install rust-simulation-tools

Features

  • Kabsch alignment with SIMD optimizations
  • Fragment-based periodic boundary unwrapping
  • SASA calculation (Shrake-Rupley with KD-tree acceleration)
  • Interaction energy fingerprinting (LJ + electrostatic)
  • AMBER file readers (prmtop, inpcrd)
  • DCD trajectory reader with streaming support

Quick Examples

Trajectory Alignment

from rust_simulation_tools import kabsch_align

aligned = kabsch_align(trajectory, reference, align_indices)

SASA Calculation

from rust_simulation_tools import calculate_sasa, get_radii_array

radii = get_radii_array(elements)  # ['C', 'N', 'O', ...]
result = calculate_sasa(coords, radii, residue_indices)
# result['total'], result['per_atom'], result['per_residue']

AMBER Topology + DCD Trajectory

from rust_simulation_tools import read_prmtop, DcdReader

topo = read_prmtop("system.prmtop")
charges, sigmas, epsilons = topo.charges(), topo.sigmas(), topo.epsilons()

dcd = DcdReader("trajectory.dcd")
for i in range(dcd.n_frames):
    coords, box = dcd.read_frame()

Interaction Fingerprints

from rust_simulation_tools import compute_fingerprints, read_prmtop

topo = read_prmtop("system.prmtop")
resmap_indices, resmap_offsets = topo.build_resmap()

lj_fp, es_fp = compute_fingerprints(
    positions, topo.charges(), topo.sigmas(), topo.epsilons(),
    resmap_indices, resmap_offsets, binder_indices
)

API Reference

# Alignment & unwrapping
kabsch_align(trajectory, reference, align_idx) -> aligned_trajectory
unwrap_system(trajectory, box_dimensions, fragment_idx) -> unwrapped_trajectory

# SASA
calculate_sasa(coords, radii, residue_indices, probe_radius=1.4) -> dict
calculate_sasa_trajectory(trajectory, radii, residue_indices) -> dict
calculate_total_sasa(coords, radii, probe_radius=1.4) -> float
get_vdw_radius(element) -> float
get_radii_array(elements) -> np.ndarray

# Fingerprinting
compute_fingerprints(positions, charges, sigmas, epsilons,
                     resmap_indices, resmap_offsets, binder_indices) -> (lj, es)

# File I/O
read_prmtop(path) -> AmberTopology
read_inpcrd(path) -> (positions, box_dimensions)
DcdReader(path)   # .n_frames, .n_atoms, .read_frame(), .seek(n), .read_all()

Development

git clone https://github.com/msinclair-py/rust-simulation-tools.git
cd rust-simulation-tools
pip install maturin pytest pytest-cov numpy
maturin develop --release
pytest tests/ -v --cov

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rust_simulation_tools-0.2.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rust_simulation_tools-0.2.0-cp313-cp313-win_amd64.whl (324.3 kB view details)

Uploaded CPython 3.13Windows x86-64

rust_simulation_tools-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (445.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (397.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rust_simulation_tools-0.2.0-cp312-cp312-win_amd64.whl (324.5 kB view details)

Uploaded CPython 3.12Windows x86-64

rust_simulation_tools-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (445.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (397.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rust_simulation_tools-0.2.0-cp311-cp311-win_amd64.whl (322.8 kB view details)

Uploaded CPython 3.11Windows x86-64

rust_simulation_tools-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (444.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (396.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rust_simulation_tools-0.2.0-cp310-cp310-win_amd64.whl (322.9 kB view details)

Uploaded CPython 3.10Windows x86-64

rust_simulation_tools-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (444.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (396.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rust_simulation_tools-0.2.0-cp39-cp39-win_amd64.whl (323.3 kB view details)

Uploaded CPython 3.9Windows x86-64

rust_simulation_tools-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (444.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.2.0-cp39-cp39-macosx_11_0_arm64.whl (397.4 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file rust_simulation_tools-0.2.0.tar.gz.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 75e6e4d62be7ac6fbc47d346fef7262855aaf35038dd9ea4960b6da4382bb803
MD5 7ee15e0b412e0b730969486a1e9eb8f0
BLAKE2b-256 9df2199425c0a31593170327f722b6c9b06c79ef46a33d945dda556ccfc2ef2b

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 282cac63efb1cd01633de07377d76e5d79dbfd0ddc10baa9ae7fa6fab03d446b
MD5 b5780ce13d177420fc74a890b0a792cb
BLAKE2b-256 651be348fe4ca3e2524c2c45522a971b16b36c80754d7e965bebcbf8c2598fb3

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 11f1471623108e53e7416b03ced9edec1f3ac27413f2013cf44f09693b4d8084
MD5 911bf0ef818d5c385ff13d3ff2af88ad
BLAKE2b-256 a6a3f2a68ddbb549a9289fd8649c1a8a6ec4bd9b3c40d8610364eecfccaaae3d

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ff143befc5b104453cca1cb728e1375a88cd98e574f0bae059bbdb2d71222eb8
MD5 b5e80a5a5e71c83be63f8a3b1e5e9d8c
BLAKE2b-256 96a40e13c37c36192a2fbdeba79b87c4091a41e68e59aa159574c2921da18c05

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8a88a56b2cb57483576388db53d168f3737ec24949102e5eb04e15a90641ed7d
MD5 2a1a55aed0e2a8a9a7c7a42997640435
BLAKE2b-256 8fa33bef983cf7884e7d1a59d51f4591f18868889155e82cf5cf793b61920c8b

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cf052e80e0c7ace408542e63b235d037bc7fb2308986c8adcc875e4aee3c2bb
MD5 42526b6bb89362cd5eab2de0d715785a
BLAKE2b-256 d7e88ba160a2a26348402e15489d394b3b3b89e79f8a6f5c0b1ad48dd958898c

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec457454dfd03c7811648b1eb87ed435385f00eb0a4298a1faa3226d43ee8c90
MD5 46d79b5d75472a614b9e3885eb793ba2
BLAKE2b-256 4f51080e284a6574c960ebedbcedaac1e34894b48be619ea2cf6853cc49a7b2a

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c92391741883680d0e864bb5dd23b9d0aad87deb3d884d2e7f56c12ba309a8c7
MD5 2d3f1519dd801aa3e29d79e4c308651e
BLAKE2b-256 ba37042f28363c0a61d4deb5ef41cf081cc5f18edf8c01458b65c9afd5809e36

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b064bcd1aa629a3b25853aaf258b6c1e4ecc087ff341d774bffd328b1a525317
MD5 59ef2741e3a3ef72151ade0b299f5404
BLAKE2b-256 101b27a7d482d3f3ef92b2506916767a9d857962b33d27c9d598394c4aca828e

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f8522decc8efee9fefeb2741255b4e208152aef5f2f106ef0a8b810367bc87f0
MD5 acd5d254b63dbbf309458206bd0d11fe
BLAKE2b-256 94b28f845c9a523dedcb70316e0afdf378ed0f13a9316bb310c5fe7ee16e0377

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 77f326f79183cc575b7d5415b656f3b9866399f2dc0472d17461e36fc7f19c81
MD5 2248825d0e4704996e10d3fcfd144935
BLAKE2b-256 ee2917579409b0c8a309cd64a34dcadd2a245e891c13fbc00c44b37c49a11103

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 92eae43387b337ff1fd4860e228f92bd709acbad4aa82aaa950ab34058042d0c
MD5 04c89a8d1b9d876b4ebc49a1c1b649d2
BLAKE2b-256 33f5e9766874c115ada6c42bb349338a16b73ce1e08ce64fb208b161f7871a58

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 63d66e8fb32197e46b2bb7336cb776dce9cefd33e410f7f735aa642fd9fc4b5f
MD5 ae8d368f61b83d7744025f0984b287f9
BLAKE2b-256 f6de817278ad2afadf0dd8cc6ae5dc13b4f93af81a2dea76450639bf3b11423e

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a22267a983cc3f4080406ce672d193bbd2c20f4fe3edbd9fecbac1e26657317f
MD5 29dc5747ae8c00683fba224c09082a76
BLAKE2b-256 21b5605938dec78fff16285594b7dd8cddf7a59fa07d3f446c0a380ec70dc21e

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d386cc3f2f1414f00438caeb320417f28f01feebc531fe439e682bdfdf4441b8
MD5 e487de2d4fc62f21ee657ebfb210ff74
BLAKE2b-256 7a5960d08dfe2a78fec8cfc51c5ba2d7b4f14115e315952990d6065a21d195b6

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.2.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9fcc1be110aa368cff84214e82e19278fe250589dff3f05ae6e1cf97081c136
MD5 b78b7006a66d03aad210d11ec486708e
BLAKE2b-256 b5cbfeb27d4566dc0982f2fe323fc266d92c21d4cf87223298639b27d68921a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page