From 771b4809a53b524b278fadff31b4abc1a4a8809c Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 24 Apr 2024 10:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kr2r/src/bin/build_k2_db.rs | 14 +++++++------- kr2r/src/bin/squid.rs | 15 ++++++--------- kr2r/src/lib.rs | 2 -- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/kr2r/src/bin/build_k2_db.rs b/kr2r/src/bin/build_k2_db.rs index a837d36..ab0a798 100644 --- a/kr2r/src/bin/build_k2_db.rs +++ b/kr2r/src/bin/build_k2_db.rs @@ -18,23 +18,23 @@ use std::time::Instant; #[derive(Parser, Debug, Clone)] #[clap(author, version, about="build database", long_about = None)] pub struct Args { - /// 包含原始配置 - #[clap(flatten)] - pub build: Build, - /// database hash chunk directory and other files #[clap(long)] pub k2d_dir: Option, - #[clap(flatten)] - pub taxo: Taxo, - #[clap(long, value_parser = parse_size, default_value = "1G", help = "Specifies the hash file capacity.\nAcceptable formats include numeric values followed by 'K', 'M', or 'G' (e.g., '1.5G', '250M', '1024K').\nNote: The specified capacity affects the index size, with a factor of 4 applied.\nFor example, specifying '1G' results in an index size of '4G'.\nDefault: 1G (capacity 1G = file size 4G)")] pub hash_capacity: usize, /// chunk temp directory #[clap(long)] pub chunk_dir: PathBuf, + + /// 包含原始配置 + #[clap(flatten)] + pub build: Build, + + #[clap(flatten)] + pub taxo: Taxo, } pub fn run(args: Args, required_capacity: usize) -> Result<(), Box> { diff --git a/kr2r/src/bin/squid.rs b/kr2r/src/bin/squid.rs index 9c9a455..f2d2b34 100644 --- a/kr2r/src/bin/squid.rs +++ b/kr2r/src/bin/squid.rs @@ -17,19 +17,10 @@ use std::time::Instant; #[derive(Parser, Debug, Clone)] #[clap(author, version, about="build database", long_about = None)] struct BuildArgs { - #[clap(flatten)] - pub build: Build, - /// database hash chunk directory and other files #[clap(long)] pub k2d_dir: Option, - #[clap(flatten)] - taxo: Taxo, - - // /// Name of Kraken 2 database - // #[arg(short, long = "db")] - // database: PathBuf, /// chunk directory #[clap(long)] chunk_dir: PathBuf, @@ -37,6 +28,12 @@ struct BuildArgs { #[clap(long, value_parser = parse_size, default_value = "1G", help = "Specifies the hash file capacity.\nAcceptable formats include numeric values followed by 'K', 'M', or 'G' (e.g., '1.5G', '250M', '1024K').\nNote: The specified capacity affects the index size, with a factor of 4 applied.\nFor example, specifying '1G' results in an index size of '4G'.\nDefault: 1G (capacity 1G = file size 4G)")] pub hash_capacity: usize, + #[clap(flatten)] + pub build: Build, + + #[clap(flatten)] + taxo: Taxo, + /// estimate capacity from cache if exists #[arg(long, default_value_t = true)] cache: bool, diff --git a/kr2r/src/lib.rs b/kr2r/src/lib.rs index 2d7ecf5..b36de32 100644 --- a/kr2r/src/lib.rs +++ b/kr2r/src/lib.rs @@ -1,4 +1,3 @@ -// pub mod iclassify; pub mod kr2r_data; mod kv_store; pub mod mmscanner; @@ -16,7 +15,6 @@ pub use feat::*; pub mod db; pub use kr2r_data::*; pub use kv_store::*; -// pub use mmscanner::{Meros, CURRENT_REVCOM_VERSION, DEFAULT_TOGGLE_MASK}; pub use readcounts::TaxonCounts; pub mod args;