/// Reports bool whether the read passes thresholds.
Reports bool whether the read passes thresholds.
Reports bool whether the read passes thresholds .
fn is_high_quality(&mut self) -> bool {
        // fail if seq len is short
        let min_length = self.thresholds.get(&"min_length".to_string()).expect("min_length does not look like a number");
        let seq_len = self.seq.len() as f32;
        if seq_len < *min_length {
            //.parse::<i32>().unwrap();
            return false;
        }
        let mut total_qual = 0;
        for qual in self.qual.chars() {
            total_qual += qual as u32;
        }
        // fail if qual is low
        let avg_qual = (total_qual as f32/seq_len) - 33.0;
        let min_qual = self.thresholds.get(&"min_avg_qual".to_string()).expect("min_avg_qual does not look like a number");
        if avg_qual < *min_qual {
            return false;
        }
        return true;
    }
fn is_high_quality ( & mut self ) -> bool { // fail if seq len is short let min_length = self . thresholds . get ( & " " . to_string ( ) ) . expect ( " " ) ; let seq_len = self . seq . len ( ) as f32 ; if seq_len < * min_length { //.parse::<i32>().unwrap(); return false ; } let mut total_qual = 0 ; for qual in self . qual . chars ( ) { total_qual += qual as u32 ; } // fail if qual is low let avg_qual = ( total_qual as f32 / seq_len ) - 33.0 ; let min_qual = self . thresholds . get ( & " " . to_string ( ) ) . expect ( " " ) ; if avg_qual < * min_qual { return false ; } return true ; }
Reports bool whether the read passes thresholds.
Reports bool whether the read passes thresholds .
&mut self