Thomas 1 рік тому
батько
коміт
c53968c19f
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      src/variants.rs

+ 6 - 0
src/variants.rs

@@ -1039,6 +1039,12 @@ impl Variant {
             return n_alt;
         }
     }
+    
+    pub fn vaf(&mut self) -> f64 {
+        let n_alt = self.get_n_alt() as f64;
+        let depth = self.get_depth() as f64;
+        n_alt / depth
+    }
 
     fn is_ins(&self) -> bool {
         match (&self.reference, &self.alternative) {