fmlrc/
lib.rs

1
2/*!
3# FM-Index Long Read Corrector v2
4This library provides access to the functionality used by FMLRC2 to perform read correction using a Burrows Wheeler Transform (BWT).
5Currently, the BWT is assumed to have been generated externally (typically with a tool like ropebwt2) and stored in the same numpy format as FMLRC v1.
6FMLRC load a binary representation of the BWT into memory for performing very fast queries at the cost of memory usage.
7This particular implementation is accelerated over FMLRC v1 by using a cache to pre-compute common queries to the BWT.
8
9## Example
10```rust
11use fmlrc::bv_bwt::BitVectorBWT;
12use fmlrc::bwt_converter::convert_to_vec;
13use fmlrc::ropebwt2_util::create_bwt_from_strings;
14use fmlrc::string_util::convert_stoi;
15use std::io::Cursor;
16
17//example with in-memory BWT
18let data: Vec<&str> = vec!["ACGT", "CCGG"];
19let seq = create_bwt_from_strings(&data).unwrap();
20let cursor_seq = Cursor::new(seq);
21let vec_form = convert_to_vec(cursor_seq);
22let mut bwt = BitVectorBWT::new();
23bwt.load_vector(vec_form);
24//bwt.load_numpy_file(filename); <- if in a numpy file
25
26//do a count
27let kmer: Vec<u8> = convert_stoi(&"ACGT");
28let kmer_count = bwt.count_kmer(&kmer); //ACGT
29assert_eq!(kmer_count, 1);
30```
31*/
32
33/// Contains the alignment methods for comparing corrections
34pub mod align;
35/// Contains the bit vector implementation of the BWT
36pub mod bv_bwt;
37/// Contains the function for reformating a BWT string into the expected run-length format or numpy file
38pub mod bwt_converter;
39/// Contains bit vector with basic rank support; other crates exist with this, but they tended to be slow for some reason
40pub mod indexed_bit_vec;
41/// Contains a wrapper around the rust-bio FASTA writer, but forces an ordering on the reads
42pub mod ordered_fasta_writer;
43/// Contains the logic for performing the read correction
44pub mod read_correction;
45/// Contains wrapper functions for `ropebwt2`, most will fail if `ropebwt2` is not on the PATH
46pub mod ropebwt2_util;
47/// Contains special statistics functions, mainly an ignored median score
48pub mod stats_util;
49/// Contains inline functions for converting between strings and integer formats
50pub mod string_util;