Function bio::data_structures::bwt::bwt

source ·
pub fn bwt(text: &[u8], pos: &RawSuffixArray) -> 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::suffix_array::suffix_array;
use bio::data_structures::bwt::bwt;
let text = b"GCCTTAACATTATTACGCCTA$";
let pos = suffix_array(text);
let bwt = bwt(text, &pos);
assert_eq!(bwt, b"ATTATTCAGGACCC$CTTTCAA");