Thomas 1 年之前
父節點
當前提交
bf63451255
共有 4 個文件被更改,包括 8 次插入11 次删除
  1. 1 1
      Cargo.toml
  2. 1 1
      src/bam.rs
  3. 2 2
      src/bin.rs
  4. 4 7
      src/lib.rs

+ 1 - 1
Cargo.toml

@@ -18,7 +18,7 @@ pandora_lib_pileup = { git = "https://git.t0m4.fr/Thomas/pandora_lib_pileup.git"
 indicatif-log-bridge = "0.2.2"
 serde = { version = "1.0.*", default-features = false }
 postcard = { version = "1.0.8", features = ["alloc"] }
-flate2 = "1.0.31"
+flate2 = "1.0.30"
 csv = "1.3.0"
 dashmap = { version = "6.0.1", features = ["rayon"] }
 

+ 1 - 1
src/bam.rs

@@ -1,6 +1,6 @@
 use log::warn;
 use rust_htslib::bam::{
-    ext::BamRecordExtensions, record::Aux, HeaderView, IndexedReader, Read, Record,
+    ext::BamRecordExtensions, record::Aux, IndexedReader, Read, Record,
 };
 use std::collections::HashMap;
 

+ 2 - 2
src/bin.rs

@@ -1,5 +1,5 @@
 use anyhow::Context;
-use log::{info, warn};
+use log::warn;
 use rayon::prelude::*;
 use rust_htslib::bam::{ext::BamRecordExtensions, record::Aux, IndexedReader, Read, Record};
 use std::collections::HashMap;
@@ -297,7 +297,7 @@ pub fn scan_outliers(
         starts.push(current);
         current += length;
     }
-    
+
     let ratios: Vec<(u32, usize, u32, f64, f64)> = starts
         .into_par_iter()
         .filter_map(|start| {

+ 4 - 7
src/lib.rs

@@ -9,9 +9,9 @@ use log::info;
 use rayon::prelude::*;
 use rust_htslib::bam::{Format, Header, Read, Record, Writer};
 use std::{
-    collections::{HashMap, HashSet},
+    collections::HashSet,
     fs::{self, File},
-    io::{self, BufReader, BufWriter, Write}, sync::Arc,
+    io::{self, BufReader, BufWriter, Write},
 };
 
 pub mod bam;
@@ -93,7 +93,6 @@ pub fn scan_save(
             })
             .collect();
 
-    info!("🆗");
     let bam = rust_htslib::bam::IndexedReader::from_path(bam_path).unwrap();
     let header = bam.header().to_owned();
     let mut grouped_records = Vec::new();
@@ -134,12 +133,11 @@ pub fn scan_save(
 
     for outlier_record in outliers_records {
         let hm_positions: DashMap<String, Vec<String>> = DashMap::new();
-        // let bam_clone = Arc::clone(&mut bam);
 
         outlier_record.par_iter().for_each(|r| {
             let r = r.clone();
             if let Ok(positions) = get_all_positions(&r, bam_path) {
-            // if let Ok(positions) = get_all_positions(&r, &header, &mut bam) {
+                // if let Ok(positions) = get_all_positions(&r, &header, &mut bam) {
                 let qname = String::from_utf8_lossy(r.qname()).to_string();
                 for pos in positions {
                     hm_positions
@@ -173,7 +171,6 @@ pub fn scan_save(
         }
     }
 
-    info!("n groups {}", grouped_records.len());
     let mut dedup = HashSet::new();
     let mut n_records = 0;
     let grouped_records: Vec<Vec<Record>> = grouped_records
@@ -201,7 +198,7 @@ pub fn scan_save(
 
     if !grouped_records.is_empty() {
         info!(
-            "{} reads to assemble in {} groups",
+            "{contig}:{start}-{end}, {} reads to assemble in {} groups",
             n_records,
             grouped_records.len()
         );