/// Backward extension of given interval with given character.
Backward extension of given interval with given character.
Backward extension of given interval with given character .
pub fn backward_ext(&self, interval: &BiInterval, a: u8) -> BiInterval {
        let mut s = 0;
        let mut o = 0;
        let mut l = interval.lower_rev;
        // Interval [l(c(aP)), u(c(aP))] is a subinterval of [l(c(P)), u(c(P))] for each a,
        // starting with the lexicographically smallest ($),
        // then c(T) = A, c(G) = C, c(C) = G, N, c(A) = T, ...
        // Hence, we calculate lower revcomp bounds by iterating over
        // symbols and updating from previous one.
        for &b in b"$TGCNAtgcna".iter() {
            l += s;
            o = if interval.lower == 0 {
                0
            } else {
                self.fmindex.occ(interval.lower - 1, b)
            };
            // calculate size
            s = self.fmindex.occ(interval.lower + interval.size - 1, b) - o;
            if b == a {
                break;
            }
        }
        // calculate lower bound
        let k = self.fmindex.less(a) + o;
        BiInterval {
            lower: k,
            lower_rev: l,
            size: s,
            match_size: interval.match_size + 1,
        }
    }
pub fn backward_ext ( & self , interval : & BiInterval , a : u8 ) -> BiInterval { let mut s = 0 ; let mut o = 0 ; let mut l = interval . lower_rev ; // Interval [l(c(aP)), u(c(aP))] is a subinterval of [l(c(P)), u(c(P))] for each a, // starting with the lexicographically smallest ($), // then c(T) = A, c(G) = C, c(C) = G, N, c(A) = T, ... // Hence, we calculate lower revcomp bounds by iterating over // symbols and updating from previous one. for & b in b" " . iter ( ) { l += s ; o = if interval . lower == 0 { 0 } else { self . fmindex . occ ( interval . lower - 1 , b ) } ; // calculate size s = self . fmindex . occ ( interval . lower + interval . size - 1 , b ) - o ; if b == a { break ; } } // calculate lower bound let k = self . fmindex . less ( a ) + o ; BiInterval { lower : k , lower_rev : l , size : s , match_size : interval . match_size + 1 , } }
Backward extension of given interval with given character.
Backward extension of given interval with given character .
&self
interval
&BiInterval
a
u8