diff --git a/Cargo.toml b/Cargo.toml index c2ff05f..c37403f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,4 @@ clap = { version = "4.2.1", features = ["derive"] } rayon = "1.7.0" approx = "0.5.1" minimap2 = "0.1.17+minimap2.2.27" -flate2 = "1.0" +flate2 = { version = "1.0.17", features = ["zlib-ng"], default-features = false } diff --git a/src/main.rs b/src/main.rs index 59b54e9..24a29e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ use bio::io::fastq; use clap::Parser; use minimap2::*; use rayon::prelude::*; -use std::io::{self, Read}; +use std::io::{self, Read, BufReader}; use std::path::{PathBuf, Path}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; @@ -94,8 +94,9 @@ fn main() { if path.extension().and_then(|s| s.to_str()) == Some("gz") { // deal with gz compressed file let gzfile = File::open(&path).expect("Error: Unable to open gzipped file"); - let mut decoder = GzDecoder::new(gzfile); - filter(&mut decoder, args); + let buf_reader = BufReader::with_capacity(512*1024, gzfile); + let mut decoder = GzDecoder::new(buf_reader); + filter(&mut decoder, args); } else {