From bb0d35d4b1b0a19ba790aae2044f8cd342575330 Mon Sep 17 00:00:00 2001 From: sharkLoc Date: Thu, 19 Dec 2024 22:20:41 +0800 Subject: [PATCH] remove duplicate thread option --- src/cli/filter.rs | 5 ----- src/cli/search.rs | 5 ----- src/cli/size.rs | 2 -- src/command.rs | 9 --------- src/main.rs | 9 +++------ 5 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/cli/filter.rs b/src/cli/filter.rs index 8ca8e2d..4e1ee3d 100644 --- a/src/cli/filter.rs +++ b/src/cli/filter.rs @@ -27,11 +27,6 @@ pub fn filter_fastq( error!("{}", FqkitError::InvalidPhredValue); std::process::exit(1); } - if ncpu <= 1 { - info!("thread num is: {}", ncpu); - } else { - info!("additional thread num is: {}", ncpu); - } info!("output clean read1 file: {}", out1); info!("output clean read2 file: {}", out2); diff --git a/src/cli/search.rs b/src/cli/search.rs index 57b8301..8519142 100644 --- a/src/cli/search.rs +++ b/src/cli/search.rs @@ -26,11 +26,6 @@ pub fn search_fq( } info!("regex pattern is: {}", pat); - if ncpu == 1 || ncpu == 0 { - info!("thread num is: {}", ncpu); - } else { - info!("additional thread num is: {}", ncpu); - } let mut chunk = chunk; if chunk == 0 { diff --git a/src/cli/size.rs b/src/cli/size.rs index c0a66bd..32e4a95 100644 --- a/src/cli/size.rs +++ b/src/cli/size.rs @@ -1,7 +1,6 @@ use crate::utils::*; use anyhow::Result; use bio::io::fastq; -//use crossbeam::channel::unbounded; use crossbeam::channel::bounded; use log::*; @@ -43,7 +42,6 @@ pub fn size_fastq( } else { info!("reading from stdin"); } - info!("additional worker threads is: {}", ncpu); let mut chunk = chunk; if chunk == 0 { diff --git a/src/command.rs b/src/command.rs index 41cb62c..08ebead 100644 --- a/src/command.rs +++ b/src/command.rs @@ -217,9 +217,6 @@ pub enum Subcli { /// the number of reads in the chunk on each thread #[arg(short, long, default_value_t = 5000, value_name = "INT")] chunk: usize, - /// number of additional worker threads to use - #[arg(short = '@', long = "thread", default_value_t = 4, value_name = "INT")] - thread: usize, /// specify the file to store reads(interleaved) that cannot pass the filters, file ending in .gz/.bz2/.xz will be compressed automatically #[arg(short = 'u', long = "failed", value_name = "FILE")] failed: String, @@ -260,9 +257,6 @@ pub enum Subcli { /// the number of reads in the chunk on each thread #[arg(short, long, default_value_t = 5000, value_name = "INT")] chunk: usize, - /// number of additional worker threads to use - #[arg(short = '@', long = "thread", default_value_t = 1, value_name = "INT")] - thread: usize, /// output contain pattern/motif reads result fastq file or write to stdout, file ending in .gz/.bz2/.xz will be compressed automatically #[arg(short = 'o', long = "out", value_name = "FILE")] out: Option, @@ -334,9 +328,6 @@ pub enum Subcli { /// the number of reads in the chunk on each thread #[arg(short, long, default_value_t = 5000, value_name = "INT")] chunk: usize, - /// number of additional worker threads to use - #[arg(short = '@', long = "thread", default_value_t = 3, value_name = "INT")] - thread: usize, /// output file name or write to stdout, file ending in .gz/.bz2/.xz will be compressed automatically #[arg(short = 'o', long = "out", value_name = "FILE")] out: Option, diff --git a/src/main.rs b/src/main.rs index de294db..3c0fcbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,7 +140,6 @@ fn main() -> Result<(), Error> { case, invert, chunk, - thread, out, } => { search_fq( @@ -150,7 +149,7 @@ fn main() -> Result<(), Error> { invert, chunk, out.as_ref(), - thread, + arg.threads, arg.compression_level, arg.stdout_type, )?; @@ -283,13 +282,12 @@ fn main() -> Result<(), Error> { } Subcli::size { input, - thread, chunk, out, } => { size_fastq( input.as_ref(), - thread, + arg.threads, chunk, out.as_ref(), arg.compression_level, @@ -369,7 +367,6 @@ fn main() -> Result<(), Error> { average_qual, phred, chunk, - thread, failed, out1, out2, @@ -383,7 +380,7 @@ fn main() -> Result<(), Error> { average_qual, phred, chunk, - thread, + arg.threads, &failed, &out1, &out2,