From 2f51597633c5287c863605c44ce5b1eaeee2b79b Mon Sep 17 00:00:00 2001 From: Jean Pierre ELBERS Date: Tue, 15 Feb 2022 12:16:32 +0100 Subject: [PATCH] changed GzDecoder to MultiGzDecoder --- .gitignore | 10 ++++++++++ Cargo.toml | 2 +- src/bin/utils/build_sdb.rs | 4 ++-- src/bin/utils/seqmap.rs | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0aba1a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ +/target +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk diff --git a/Cargo.toml b/Cargo.toml index 4faf5e6..7fb6ef3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "peregrine-r" -version = "0.4.12" +version = "0.4.13" authors = ["Jason Chin "] edition = "2018" build = "build.rs" diff --git a/src/bin/utils/build_sdb.rs b/src/bin/utils/build_sdb.rs index 4b9e646..a663ea6 100644 --- a/src/bin/utils/build_sdb.rs +++ b/src/bin/utils/build_sdb.rs @@ -9,7 +9,7 @@ #![allow(dead_code)] -use flate2::bufread::GzDecoder; +use flate2::bufread::MultiGzDecoder; use rayon::prelude::*; use std::fs::File; use std::io::prelude::*; @@ -273,7 +273,7 @@ pub fn build(seq_list_file: &String, out_prefix: &String) -> Result, Vec)>::new(); if is_gzfile { - let fastx_buf = BufReader::new(GzDecoder::new(&mut reader)); + let fastx_buf = BufReader::new(MultiGzDecoder::new(&mut reader)); let mut fastx_reader = FastxReader::new(fastx_buf, &input_fn)?; while let Some(r) = fastx_reader.next_rec() { let r = r.unwrap(); diff --git a/src/bin/utils/seqmap.rs b/src/bin/utils/seqmap.rs index 186416c..aa284e1 100644 --- a/src/bin/utils/seqmap.rs +++ b/src/bin/utils/seqmap.rs @@ -26,7 +26,7 @@ use std::io::{BufRead, BufReader, BufWriter, Read, Seek, SeekFrom, Write}; pub type MapIntervalRecord = [u32; 8]; pub type MapIntervals = FxHashMap>; pub type Shmmrs = Vec>; -use flate2::bufread::GzDecoder; +use flate2::bufread::MultiGzDecoder; use petgraph::graphmap::DiGraphMap; use petgraph::unionfind::UnionFind; use rayon::prelude::*; @@ -89,7 +89,7 @@ impl SeqDB { reader.seek(SeekFrom::Start(0))?; if is_gzfile { - let fastx_buf = BufReader::new(GzDecoder::new(&mut reader)); + let fastx_buf = BufReader::new(MultiGzDecoder::new(&mut reader)); let mut fastx_reader = FastxReader::new(fastx_buf, &self.filepath)?; let mut sid = 0; while let Some(rec) = fastx_reader.next_rec() {