Chapter 7 Bio-Rust

extern crate bio;

use bio::data_structures::suffix_array::suffix_array;

// #[rustr_export]
pub fn sarray(x: Vec<u8>)->Vec<usize>{
    suffix_array(&x)    
}
rust(code = '
extern crate bio;

use bio::data_structures::suffix_array::suffix_array;

// #[rustr_export]
pub fn sarray(x: Vec<u8>)->Vec<usize>{
    suffix_array(&x)    
}
',depend = '
[dependencies]
rustr = "*"
bio = "0.5.0"
')
#> updating cached Cargo.toml.

sarray(charToRaw("GCCTTAACATTATTACGCCTA$"))
#>  [1] 21 20  5  6 14 11  8  7 17  1 15 18  2 16  0 19  4 13 10  3 12  9