Function bio::data_structures::bwt::bwt
source · pub fn bwt(text: &[u8], pos: RawSuffixArraySlice<'_>) -> BWT
Expand description
Calculate Burrows-Wheeler-Transform of the given text of length n. Complexity: O(n).
§Arguments
text
- the text ended by sentinel symbol (being lexicographically smallest)pos
- the suffix array for the text
§Example
use bio::data_structures::bwt::bwt;
use bio::data_structures::suffix_array::suffix_array;
let text = b"GCCTTAACATTATTACGCCTA$";
let pos = suffix_array(text);
let bwt = bwt(text, &pos);
assert_eq!(bwt, b"ATTATTCAGGACCC$CTTTCAA");