Expand description

Bit-packed and well-typed biological sequences

  • Seq heap allocated sequences of variable length
  • Kmer short fixed length sequences
  • [Codec] coder/decoder implementations

This crate is designed to facilitate common bioinformatics tasks, incuding amino acid translation, k-mer minimisation and hashing, and nucleotide sequence manipulation.

use bio_seq::{dna, Seq, FromStr};
use bio_seq::codec::{dna::Dna, ReverseComplement};

let seq = dna!("ATACGATCGATCGATCGATCCGT");

// iterate over the 8-mers of the reverse complement
for kmer in seq.revcomp().kmers::<8>() {
    println!("{}", kmer);
}

Custom encodings are supported with the help of the bio-seq-derive crate.

use bio_seq::{iupac, Seq, FromStr};
use bio_seq::codec::{iupac::Iupac};

let seq = iupac!("AGCTNNCAGTCGACGTATGTA");
let pattern = Seq::<Iupac>::from_str("AYG").unwrap();

for slice in seq.windows(pattern.len()) {
    if pattern.contains(slice) {
        println!("{} matches pattern", slice);
    }
}

Re-exports

pub use crate::kmer::Kmer;
pub use crate::seq::Seq;
pub use crate::seq::SeqSlice;

Modules

Coding/Decoding trait for bit-packable enums representing biological alphabets
Translation tables for coding sequences

Macros

Traits

Parse a value from a string