slow5 0.3.0

Library for interacting with slow5
Documentation

slow5-rs

License Crates.io docs.rs Rust

A library for interacting with SLOW5 files in rust.

Note: Library design is in flux and care should be taken in upgrading this crate.

Usage

Add the following to your Cargo.toml:

[dependencies]
slow5 = "0.3.0"

Note: version does not directly translate to version of slow5lib.

Example

Getting record by id

fn get_by_read_id() {
    let file_path = "examples/example.slow5";
    let mut slow5_file = slow5::Builder::default().open(file_path).unwrap();
    let record = slow5_file.get_read(b"r3").unwrap();
    assert_eq!(b"r3", record.read_id());
}

Iterating over records sequentially

use std::error::Error;

fn iterating_example() -> Result<(), Box<dyn Error>> {
    let file_path = "examples/example.slow5";
    let mut slow5_file = slow5::Builder::default()
        .picoamps(true)
        .open(file_path)?;
    let mut rec_iter = slow5_file.seq_reads();
    while let Some(Ok(slow5_rec)) = rec_iter.next() {
        // Iterate over every read
        for signal in slow5_rec.signal_iter() {
            // Iterate over signal measurements in pA
        }
    }
    Ok(())
}

TODO

  • Read slow5 file
  • Write slow5 file
  • Iterating over records
  • Iterating over raw or picoamp measurements
  • Parity with pyslow5
  • Read blow5 file (haven't tested)
  • Reading headers
  • Reading aux info