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.

Installation

Add the following to your Cargo.toml:

toml [dependencies] slow5 = "0.3.1"

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)?; let mut reciter = slow5file.seqreads(); while let Some(Ok(slow5rec)) = reciter.next() { // Iterate over every read for signal in slow5rec.signal_iter() { // Iterate over signal measurements in pA } } Ok(()) } ```

TODO

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.