pub fn remove_censored_exts<K: Kmer, D>(stranded: bool, valid_kmers: &mut Vec<(K, (Exts, D))>) {
    for idx in 0..valid_kmers.len() {
        let mut new_exts = Exts::empty();
        let kmer = valid_kmers[idx].0;
        let exts = (valid_kmers[idx].1).0;

        for dir in [Dir::Left, Dir::Right].iter() {
            for i in 0..4 {
                if exts.has_ext(*dir, i) {
                    let ext_kmer = if stranded {
                        kmer.extend(i, *dir)
                    } else {
                        kmer.extend(i, *dir).min_rc()
                    };

                    let kmer_valid = valid_kmers.binary_search_by_key(&ext_kmer, |d| d.0).is_ok();

                    if kmer_valid {
                        new_exts = new_exts.set(*dir, i);
                    }
                }
            }
        }

        (valid_kmers[idx].1).0 = new_exts;
    }
}
/// Remove extensions in valid_kmers that point to censored kmers. Use this method in a non-partitioned
/// context when valid_kmers includes _all_ kmers that will ultimately be included in the graph.
Remove extensions in valid_kmers that point to censored kmers. Use this method in a non-partitioned
context when valid_kmers includes _all_ kmers that will ultimately be included in the graph.
Remove extensions in valid_kmers that point to censored kmers . Use this method in a non - partitioned context when valid_kmers includes _all_ kmers that will ultimately be included in the graph .
pub fn remove_censored_exts<K: Kmer, D>(stranded: bool, valid_kmers: &mut Vec<(K, (Exts, D))>) {
    for idx in 0..valid_kmers.len() {
        let mut new_exts = Exts::empty();
        let kmer = valid_kmers[idx].0;
        let exts = (valid_kmers[idx].1).0;
        for dir in [Dir::Left, Dir::Right].iter() {
            for i in 0..4 {
                if exts.has_ext(*dir, i) {
                    let ext_kmer = if stranded {
                        kmer.extend(i, *dir)
                    } else {
                        kmer.extend(i, *dir).min_rc()
                    };
                    let kmer_valid = valid_kmers.binary_search_by_key(&ext_kmer, |d| d.0).is_ok();
                    if kmer_valid {
                        new_exts = new_exts.set(*dir, i);
                    }
                }
            }
        }
        (valid_kmers[idx].1).0 = new_exts;
    }
}
pub fn remove_censored_exts < K : Kmer , D > ( stranded : bool , valid_kmers : & mut Vec < ( K , ( Exts , D ) ) > ) { for idx in 0 .. valid_kmers . len ( ) { let mut new_exts = Exts :: empty ( ) ; let kmer = valid_kmers [ idx ] . 0 ; let exts = ( valid_kmers [ idx ] . 1 ) . 0 ; for dir in [ Dir :: Left , Dir :: Right ] . iter ( ) { for i in 0 .. 4 { if exts . has_ext ( * dir , i ) { let ext_kmer = if stranded { kmer . extend ( i , * dir ) } else { kmer . extend ( i , * dir ) . min_rc ( ) } ; let kmer_valid = valid_kmers . binary_search_by_key ( & ext_kmer , | d | d . 0 ) . is_ok ( ) ; if kmer_valid { new_exts = new_exts . set ( * dir , i ) ; } } } } ( valid_kmers [ idx ] . 1 ) . 0 = new_exts ; } }
Remove extensions in valid_kmers that point to censored kmers.
Remove extensions in valid_kmers that point to censored kmers .
stranded
bool
valid_kmers
&mut Vec<(K, (Exts, D))>
stranded
bool
valid_kmers
&mut Vec<(K, (Exts, D))>