#biology #dna #pcr #primer

bio_apis

DNA and RNA sequence types and functions

12 releases

Uses new Rust 2024

new 0.1.12 Nov 1, 2025
0.1.11 Nov 1, 2025
0.1.10 Oct 25, 2025
0.1.9 Sep 27, 2025
0.1.2 May 27, 2025

#434 in Biology

Download history 16/week @ 2025-07-10 28/week @ 2025-07-17 29/week @ 2025-07-24 222/week @ 2025-07-31 16/week @ 2025-08-07 2/week @ 2025-08-14 25/week @ 2025-08-21 131/week @ 2025-08-28 56/week @ 2025-09-04 172/week @ 2025-09-11 255/week @ 2025-09-18 281/week @ 2025-09-25 36/week @ 2025-10-02 10/week @ 2025-10-09 10/week @ 2025-10-16 231/week @ 2025-10-23

306 downloads per month
Used in 3 crates

MIT license

50KB
1K SLoC

Biology APIs

Crate Docs

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.

Example of various API functionality:

let data = bio_apis::rcsb::get_all_data("1ba3")?;

let data = amber_geostd::find_mols(&lig.common.ident).unwrap();

let cif_text = rcsb::load_cif(ident).unwrap();

let sdf_data = drugbank::load_sdf(ident).unwrap();
let sdf_data = pubchem::load_sdf(ident).unwrap();

pubchem::open_overview(ident);

We support flexible queries of the Pubchem URL-based API using the pubchem::url_api_query() function. Parameters are passed as enums to pull various data from this flexble API. Example:

let resp = url_api_query(
    Domain::Compound,
    Namespace::Compound(NamespaceCompound::FastSearch((
        FastSearchCat::FastSimilarity3d,
        StructureSearchNamespace::Cid,
    ))),
    &[cid.to_string()],
    OperationSpecification::Compound(OpSpecCompound::Cids),
)?;

This returns a string, which can be further parsed based on the nature of the data. For example, parsing into a structure or array using Serde, depending on the shape of the output for a given query.

WIP: Many features unsupported. Implementing as used by Daedelus and PlasCAD.

API support

See the API docs for functionality.

Dependencies

~14–29MB
~479K SLoC