-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JMencius
Author
Contributor
|
||
filter(&mut decoder, args); | ||
|
||
} | ||
else { | ||
|
GzDecoder::new(buf_reader)
will lose data in multiple member GZ file,you can use
MultiGzDecoder::new(buf_reader)
instead.ref: https://docs.rs/flate2/latest/flate2/read/struct.GzDecoder.html