Foundational libraries
We maintain core parts of the code base as independent Rust libraries. These let you use them to create your own applications and libraries that use them. Other language ecosystems (like Python) have robust tools available. We hope these are useful to you, if you wish to develop rust biology or chemistry software.
Python bindings are available for most of these as well. These are created using PyO3, and use a similar API to the rust functionality they wrap.
These libraries include instructions in their readmes, and API documentation
at their rust docs page, linked at the top of their readme. They are published
on crates.io, and some have Zenodo entries as well. Python bindings
are available on pypi. Perhaps the best example of what they can be used for is this
application itself!
The descriptions below are based on the readmes of these libraries.
See this page for this collection's home page.
Libraries we maintain
Summary
Bio Files
Reads and write common biology file formats.
This library contains functionality to load and save data in common biology file formats. It operates on data structures that are specific to each file format; you will need to convert to and from the structures used by your application.
Note: Install the pip version with pip install biology-files due to a name conflict.
NA Seq
This library contains types and functions used for performing operations on DNA, RNA, and amino acid sequences. Its most fundamental types are the Nucleotide and AminoAcid enums, representing a single DNA nucleotide, and single amino acid respectively. This library is general, and intended to be used by any program or library that uses DNA sequences. It also includes an Element enum, with parameters associated with each element.
It includes functions to convert between &[Nucleotide] to string and vice-versa, and convert to and from u8 representations of the UTF-8 characters. It includes functions to serialize and deserialize in a compact binary format, with 2 bits per nucleotide.
It includes forcefield-parameter amino acid variants, as used by Amber as the AminoAcidProtenationVariant enum.
Bio APIs
This library contains abstractions to interact with the public biology databases that hav HTTP APIs. It uses rigid data structures for requests and responses, and enums where possible to constrain API options. Example functionality:
- Download molecule data in various formats (e.g. CIF, SDF)
- Open your default web browser to a molecule's overview page, 3D structure etc
- Search APIs for molecule data, or filter and return a list of IDs.
- Load all information on a protein from the RCSB data API
- Load electron density data for a protein.
- Download a molecule based on its identifier.
Dynamics
A library for molecular dynamics. Compatible with Linux, Windows, and Mac. Uses CPU with threadpools and SIMD, or an Nvidia GPU.
It uses traditional forcefield-based molecular dynamics, and is inspired by Amber. It does not use quantum-mechanics, nor ab-initio methods.
It uses the Bio-Files dependency to load molecule and force-field files. Please see the MD documentation section here for more information.
Ewald
Runs the Smooth Particle Ewald Mesh (SPME) algorithm for n-body simulations with periodic boundary conditions.
Compute Coulomb forces for systems with periodic boundary conditions in an efficient, accurate way. Forces are broken into three components:
- A short-range, direct force, A long-range reciprical force
- A correction force, in the case of flexible molecules.
The bulk of the algorithmic complexity is in the reciprical force. This spreads charges along a discrete grid, and uses Fourier analysis to compute force vectors. The direct force is similar to a Coulomb calculation, but uses a fixed distance cutoff, and ewald screening.
This library is for Python and Rust. It supports GPU, and thread-pooled CPU.
Mcubes
A Marching Cubes isosurface library.
Uses the Marching Cubes algorithm to create isosurfaces in Rust or Python, from volume data. Designed to be easy to integrate in applications.