From 82830175492ecb35bfe7295b37c8340b92845b24 Mon Sep 17 00:00:00 2001 From: angelovangel Date: Thu, 9 Dec 2021 09:52:37 +0100 Subject: [PATCH] commit before major update of fastq reader --- .gitignore | 2 +- Cargo.lock | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 4 +- 4 files changed, 125 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fa9eb71..b474374 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /target hyperfine.sh mg1655.fasta -x86_64-linux +x86_64_linux* diff --git a/Cargo.lock b/Cargo.lock index 505b7f0..3ee7c74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,6 +279,19 @@ dependencies = [ "syn", ] +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "escargot" version = "0.3.1" @@ -298,6 +311,7 @@ dependencies = [ "clap", "flate2", "predicates", + "probminhash", "regex", "serde_json", ] @@ -397,6 +411,12 @@ dependencies = [ "libc", ] +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "indexmap" version = "1.7.0" @@ -449,6 +469,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + [[package]] name = "matrixmultiply" version = "0.3.2" @@ -540,6 +569,31 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" +[[package]] +name = "num" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.0" @@ -559,6 +613,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.0" @@ -566,6 +631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" dependencies = [ "autocfg", + "num-bigint", "num-integer", "num-traits", ] @@ -640,6 +706,25 @@ dependencies = [ "termtree", ] +[[package]] +name = "probminhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b255c89c5b1b7d1edb5012731b424ef63862effe1b763f0bf4541164755cc8d6" +dependencies = [ + "env_logger", + "fnv", + "fxhash", + "indexmap", + "lazy_static", + "log", + "num", + "rand", + "rand_distr", + "rand_xorshift", + "rand_xoshiro", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -732,6 +817,24 @@ dependencies = [ "rand_core", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -892,6 +995,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "termcolor" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] + [[package]] name = "termtree" version = "0.2.3" @@ -994,6 +1106,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index f15ed43..17a2980 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ flate2 = "1.0.18" clap = "~2.33.3" serde_json = "*" regex = "1" +probminhash = "0.1.5" [dev-dependencies] assert_cmd = "0.10" diff --git a/src/main.rs b/src/main.rs index 01bb782..774d33e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use clap::{App, Arg}; fn get_fastq_reader(path: &String) -> Box { if path.ends_with(".gz") { let f = fs::File::open(path).unwrap(); - Box::new(bufread::MultiGzDecoder::new(BufReader::new(f))) + Box::new(bufread::MultiGzDecoder::new( BufReader::new(f)) ) } else { let f = fs::File::open(path).unwrap(); Box::new(BufReader::new(f)) @@ -27,7 +27,7 @@ fn main() { .arg(Arg::with_name("kmer") .required(true) - .help("k-mer size, maximal value is 21 (required)") + .help("k-mer size, maximal value is 31 (required)") .takes_value(true) .long("kmer_size") .short("k"))