Skip to content

Commit

Permalink
优化代码结构
Browse files Browse the repository at this point in the history
  • Loading branch information
eric committed Apr 5, 2024
1 parent ee66bc5 commit 1630b63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
8 changes: 8 additions & 0 deletions kr2r/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ pub struct ClassifyArgs {
#[clap(long = "output-dir", value_parser)]
pub kraken_output_dir: Option<PathBuf>,

/// In comb. w/ -R, provide minimizer information in report
#[clap(short = 'K', long, value_parser, default_value_t = false)]
pub report_kmer_data: bool,

/// In comb. w/ -R, report taxa w/ 0 count
#[clap(short = 'z', long, value_parser, default_value_t = false)]
pub report_zero_counts: bool,

/// A list of input file paths (FASTA/FASTQ) to be processed by the classify program.
// #[clap(short = 'F', long = "files")]
pub input_files: Vec<String>,
Expand Down
12 changes: 10 additions & 2 deletions kr2r/src/bin/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ pub struct Args {
)]
pub confidence_threshold: f64,

/// In comb. w/ -R, provide minimizer information in report
#[clap(short = 'K', long, value_parser, default_value_t = false)]
pub report_kmer_data: bool,

/// In comb. w/ -R, report taxa w/ 0 count
#[clap(short = 'z', long, value_parser, default_value_t = false)]
pub report_zero_counts: bool,

/// The minimum number of hit groups needed for a call.
#[clap(
short = 'g',
Expand Down Expand Up @@ -243,8 +251,8 @@ pub fn run(args: Args) -> Result<()> {
let filename = output.join("output.krepot2");
report_kraken_style(
filename,
false,
false,
args.report_zero_counts,
args.report_kmer_data,
&taxo,
&total_taxon_counts,
total_seqs as u64,
Expand Down
2 changes: 2 additions & 0 deletions kr2r/src/bin/squid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ impl From<ClassifyArgs> for resolve::Args {
confidence_threshold: item.confidence_threshold,
minimum_hit_groups: item.minimum_hit_groups,
kraken_output_dir: item.kraken_output_dir,
report_kmer_data: item.report_kmer_data,
report_zero_counts: item.report_zero_counts,
}
}
}
Expand Down

0 comments on commit 1630b63

Please sign in to comment.