Skip to content

Commit

Permalink
Merge pull request #3 from jelber2/main
Browse files Browse the repository at this point in the history
(1) changed `GzDecoder` to `MultiGzDecoder`
(2) add `.gitignore`
(3) bump version to 0.4.13
  • Loading branch information
cschin authored Feb 15, 2022
2 parents f1eab87 + 2f51597 commit 593f930
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "peregrine-r"
version = "0.4.12"
version = "0.4.13"
authors = ["Jason Chin <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down
4 changes: 2 additions & 2 deletions src/bin/utils/build_sdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down Expand Up @@ -273,7 +273,7 @@ pub fn build(seq_list_file: &String, out_prefix: &String) -> Result<usize, io::E
let _ = reader.seek(SeekFrom::Start(0));
let mut seqs = Vec::<(u32, Vec<u8>, Vec<u8>)>::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();
Expand Down
4 changes: 2 additions & 2 deletions src/bin/utils/seqmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::io::{BufRead, BufReader, BufWriter, Read, Seek, SeekFrom, Write};
pub type MapIntervalRecord = [u32; 8];
pub type MapIntervals = FxHashMap<u32, IntervalTree<u32, MapIntervalRecord>>;
pub type Shmmrs = Vec<Vec<MM128>>;
use flate2::bufread::GzDecoder;
use flate2::bufread::MultiGzDecoder;
use petgraph::graphmap::DiGraphMap;
use petgraph::unionfind::UnionFind;
use rayon::prelude::*;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 593f930

Please sign in to comment.