Skip to content

Rust crate with bindings and interface to the SPOA library for generating consensus sequences.

License

Notifications You must be signed in to change notification settings

Kevinzjy/rust-spoa

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-spoa

This crate is a Rust wrapper and interface to the SPOA (simd-accelerated partial order alignment) library.

This library allows the efficient generation of a consensus sequence from a set of DNA or protein sequences.

If you use this crate, please cite the original authors of SPOA:

Vaser, R., Sović, I., Nagarajan, N. and Šikić, M., 2017. Fast and accurate de novo genome assembly from long uncorrected reads. Genome research, 27(5), pp.737-746.

To use this crate, add the following to your Cargo.toml:

[dependencies]
rust-spoa = "*"

And add this to your crate root:

extern crate rust_spoa;

For description of the API, see the documentation: Example usage:

extern crate rust_spoa;

use rust_spoa::poa_consensus;

fn main() {
    let mut seqs = vec![];
    let mut quals = vec![];

    // generated each string by adding small tweaks to the expected consensus "AATGCCCGTT"
    for seq in ["ATTGCCCGTT\0",
        "AATGCCGTT\0",
        "AATGCCCGAT\0",
        "AACGCCCGTC\0",
        "AGTGCTCGTT\0",
        "AATGCTCGTT\0"].iter() {
        seqs.push((*seq).bytes().map(|x|{x as u8}).collect::<Vec<u8>>());
    }
    for qual in ["FFFFFFFFF\0",
                "FFFFFFFFF\0",
                "FFFFFFFFFF\0",
                "FFFFFFFFFF\0",
                "FFFFFFFFFF\0",
                "FFFFFFFFFF\0"].iter() {
                quals.push((*qual).bytes().map(|x|{x as u8}).collect::<Vec<u8>>());
    }
    let consensus = poa_consensus(&seqs, &quals, 20, 1, 5, -4, -3, -1, -3, -1);

    let expected = "AATGCCCGTT".to_string().into_bytes();
    assert_eq!(consensus, expected);
}

About

Rust crate with bindings and interface to the SPOA library for generating consensus sequences.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 74.3%
  • C++ 17.2%
  • C 8.5%