Struct bio::data_structures::fmindex::FMDIndex [] [src]

pub struct FMDIndex<DBWT: DerefBWT + Clone, DLess: DerefLess + Clone, DOcc: DerefOcc + Clone> { /* fields omitted */ }

The FMD-Index for linear time search of supermaximal exact matches on forward and reverse strand of DNA texts (Li, 2012).

Methods

impl<DBWT: DerefBWT + Clone, DLess: DerefLess + Clone, DOcc: DerefOcc + Clone> FMDIndex<DBWT, DLess, DOcc>
[src]

[src]

Find supermaximal exact matches of given pattern that overlap position i in the pattern. Complexity O(m) with pattern of length m.

Example

use bio::alphabets::dna;
use bio::data_structures::fmindex::{FMIndex, FMDIndex};
use bio::data_structures::suffix_array::suffix_array;
use bio::data_structures::bwt::{bwt, less, Occ};

let text = b"ATTC$GAAT$";
let alphabet = dna::n_alphabet();
let sa = suffix_array(text);
let bwt = bwt(text, &sa);
let less = less(&bwt, &alphabet);
let occ = Occ::new(&bwt, 3, &alphabet);
let fm = FMIndex::new(&bwt, &less, &occ);
let fmdindex = FMDIndex::from(fm);

let pattern = b"ATT";
let intervals = fmdindex.smems(pattern, 2);

let forward_positions = intervals[0].forward().occ(&sa);

let revcomp_positions = intervals[0].revcomp().occ(&sa);

assert_eq!(forward_positions, [0]);
assert_eq!(revcomp_positions, [6]);

[src]

Initialize interval with given start character.

[src]

Initialize interval for empty pattern. The interval points at the whole suffix array.

[src]

Backward extension of given interval with given character.

[src]

Trait Implementations

impl<DBWT: DerefBWT + Clone, DLess: DerefLess + Clone, DOcc: DerefOcc + Clone> FMIndexable for FMDIndex<DBWT, DLess, DOcc>
[src]

[src]

Get occurrence count of symbol a in BWT[..r+1].

[src]

Also known as

[src]

Provide a reference to the underlying BWT.

Perform backward search, yielding suffix array interval denoting exact occurrences of the given pattern of length m in the text. Complexity: O(m). Read more

impl<DBWT: DerefBWT + Clone, DLess: DerefLess + Clone, DOcc: DerefOcc + Clone> From<FMIndex<DBWT, DLess, DOcc>> for FMDIndex<DBWT, DLess, DOcc>
[src]

[src]

Construct a new instance of the FMD index (see Heng Li (2012) Bioinformatics). This expects a BWT that was created from a text over the DNA alphabet with N (alphabets::dna::n_alphabet()) consisting of the concatenation with its reverse complement, separated by the sentinel symbol $. I.e., let T be the original text and R be its reverse complement. Then, the expected text is T$R$. Further, multiple concatenated texts are allowed, e.g. T1$R1$T2$R2$T3$R3$.