#bioinformatics #ffi #alignment #parasail #rust

parasail-rs

Rust bindings and wrapper for parasail, a SIMD C library for pairwise sequence alignment

17 releases (6 breaking)

new 0.7.6 Nov 19, 2024
0.7.4 Aug 25, 2024
0.7.3 Apr 22, 2024
0.6.0 Mar 18, 2024

#75 in Biology

Download history 2/week @ 2024-08-01 150/week @ 2024-08-22 8/week @ 2024-08-29 17/week @ 2024-09-12 79/week @ 2024-09-19 18/week @ 2024-09-26 9/week @ 2024-10-03 18/week @ 2024-10-10 35/week @ 2024-10-17 1/week @ 2024-10-24 167/week @ 2024-10-31 10/week @ 2024-11-07 141/week @ 2024-11-14

319 downloads per month

BSD-3-Clause

52KB
1K SLoC

parasail-rs

GitHub Actions Workflow Status docs.rs Crates.io Version

This crate provides safe Rust bindings and a wrapper to parasail, a SIMD pairwise sequence alignment C library. Note that this crate is still under development and is unstable.

Usage

Installation

Run the following Cargo command in your project directory:

cargo add parasail-rs

Note that parasail-rs depends on libparasail-sys which will either use an already installed system parasail library or build from source. For more information, please see libparasail-sys.

Examples

Basic usage:

For one-off alignments:

use parasail_rs::{Aligner};

// ...

let query = b"ACGT";
let reference = b"ACGT";
let aligner = Aligner::new().build();

aligner.align(Some(query), reference)?;

Using query profile:

use parasail_rs::{Matrix, Aligner, Profile};

// ...

let query = b"ACGT";
let ref_1 = b"ACGTAACGTACA";
let ref_2 = b"TGGCAAGGTAGA";

let use_stats = true;
let query_profile = Profile::new(query, use_stats, &Matrix::default())?;
let aligner = Aligner::new()
    .profile(query_profile)
    .build();

let result_1 = aligner.align(None, ref_1)?;
let result_2 = aligner.align(None, ref_2)?;

println!("Score 1: {}", result_1.get_score());
println!("Score 2: {}", result_2.get_score());

Contributing

Contributions are more than welcome. Please open an issue for any feedback or questions.

Citations

If needed, please cite the following paper:

Daily, Jeff. (2016). Parasail: SIMD C library for global, semi-global, and local pairwise sequence alignments. BMC Bioinformatics, 17(1), 1-11. doi:10.1186/s12859-016-0930-z

License

parasail-rs and libparasail-sys are licensed under the BSD-3-Clause license. The original parasail C library is licensed under a similar Battelle style BSD license.

Dependencies

~25MB
~702K SLoC