LT FM-Index

lt-fm-index is library for locate and count nucleotide and amino acid sequence string.
lt-fm-index use lookup table (LT) in count table

CAVEAT! This crate is not stable. Functions can be changed without notification.

Description

1. Use LtFmIndex to count and locate pattern.

```rust use ltfmindex::{FmIndex, LtFmIndexConfig};

// (1) Define configuration for lt-fm-index let config = LtFmIndexConfig::fornucleotide() .withnoise() .changekmersize(4).unwrap() .changesamplingratio(4).unwrap() .changebwtintervalto128();

// (2) Generate fm-index with text let text = b"CTCCGTACACCTGTTTCGTATCGGANNNN".tovec(); let ltfm_index = config.generate(text).unwrap(); // text is consumed

// (3) Match with pattern let pattern = b"TA".tovec(); // - count let count = ltfmindex.count(&pattern); asserteq!(count, 2); // - locate let locations = ltfmindex.locate(&pattern); assert_eq!(locations, vec![5,18]); ```

2. Write and read LtFmIndex

```rust use ltfmindex::{LtFmIndexConfig, LtFmIndexAll, IO};

// (1) Generate FmIndex let config = LtFmIndexConfig::fornucleotide(); let text = b"CTCCGTACACCTGTTTCGTATCGGA".tovec(); let ltfmindex = config.generate(text).unwrap(); // text is consumed

// (2) Write fm-index to buffer (or file path) let mut buffer = Vec::new(); ltfmindex.write_to(&mut buffer).unwrap();

// (3) Read fm-index from buffer (or file path) let ltfmindexbuf = LtFmIndexAll::readfrom(&buffer[..]).unwrap();

asserteq!(ltfmindex, ltfmindexbuf); ```

Repository

https://github.com/baku4/lt-fm-index

Doc

https://docs.rs/lt-fm-index/

Reference