Rust-Bio生物信息學工具庫
Rust-Bio 是一個使用 Rust 實現(xiàn)的生物信息學工具庫。Rust-Bio 包括大量的算法和數(shù)據(jù)結構,對生物信息學非常有幫助。Rust-Bio 通過持續(xù)集成進行測試,值得信賴。
當前 Rust-Bio 提供:
-
大部分主要模式匹配算法
-
一個方便的字母表實現(xiàn)
-
兩兩配對
-
后綴數(shù)組
-
BWT 和 FM-Index
-
q-gram 索引
-
rank/select 數(shù)據(jù)結構
示例:
// Import some modules
use bio::alphabets;
use bio::data_structures::suffix_array::suffix_array;
use bio::data_structures::bwt::bwt;
use bio::data_structures::fmindex::FMIndex;
use bio::io::fastq;
// Create an FM-Index for a given text.
let alphabet = alphabets::dna::iupac_alphabet();
let pos = suffix_array(text);
let bwt = bwt(text, &pos);
let fmindex = FMIndex::new(&bwt, 3, &alphabet);
// Iterate over a FASTQ file, use the alphabet to validate read
// sequences and search for exact matches in the FM-Index.
let reader = fastq::Reader::from_file("reads.fastq");
for record in reader.records() {
let seq = record.seq();
if alphabet.is_word(seq) {
let interval = fmindex.backward_search(seq.iter());
let positions = interval.occ(&pos);
}
}評論
圖片
表情
