slow5-rs

License Crates.io docs.rs Rust

A library for interacting with SLOW5 files in rust.

Usage

Add the following to your Cargo.toml:

toml [dependencies] slow5 = "0.1.0"

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

Example

Getting record by id

rust 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

```rust use std::error::Error;

fn iteratingexample() -> Result<(), Box> { let filepath = "examples/example.slow5"; let mut slow5file = slow5::Builder::default() .picoamps(true) .open(filepath)?; for slow5read in slow5file.seqreads() { // Iterate over every read if let Ok(result) = slow5read { for signal in result.signal_iter() { // Iterate over signal measurements in pA } } } Ok(()) } ```

TODO