Browse Source

n starts + qual

Thomas 2 năm trước cách đây
mục cha
commit
ecb268cc87
1 tập tin đã thay đổi với 8 bổ sung3 xóa
  1. 8 3
      src/lib.rs

+ 8 - 3
src/lib.rs

@@ -103,16 +103,21 @@ pub fn get_n_start(
 ) -> Result<usize> {
     bam.fetch((chr, start, stop))?;
 
-    let mut start_positions = Vec::new();
+    // let mut start_positions = Vec::new();
+    let mut n_start = 0;
     for read in bam.records() {
         let record = read.context(format!("eRR"))?;
         let rstart = record.pos() as i32;
         if rstart >= start && rstart < stop {
-            start_positions.push(rstart);
+            if record.qual() > 40 {
+                n_start += 1;
+            }
+            // start_positions.push(rstart);
         }
     }
 
-    Ok(start_positions.len())
+    Ok(n_start)
+    // Ok(start_positions.len())
 }
 
 pub fn range_depths(