From 80b7378001354b3035778760970a3e535e951c46 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Fri, 8 Sep 2023 11:18:28 +0200 Subject: [PATCH 1/2] feat(cli): prettify help text --- packages_rs/nextclade-cli/src/cli/nextclade_cli.rs | 10 +++++----- packages_rs/nextclade/src/run/params.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages_rs/nextclade-cli/src/cli/nextclade_cli.rs b/packages_rs/nextclade-cli/src/cli/nextclade_cli.rs index d732b2e11..2107ce2a1 100644 --- a/packages_rs/nextclade-cli/src/cli/nextclade_cli.rs +++ b/packages_rs/nextclade-cli/src/cli/nextclade_cli.rs @@ -55,7 +55,7 @@ pub struct NextcladeArgs { pub command: NextcladeCommands, /// Make output more quiet or more verbose - #[clap(flatten, next_help_heading = " Verbosity")] + #[clap(flatten, next_help_heading = "Verbosity")] pub verbosity: Verbosity, } @@ -273,7 +273,7 @@ pub struct NextcladeRunInputArgs { /// /// See: https://en.wikipedia.org/wiki/FASTA_format #[clap(value_hint = ValueHint::FilePath)] - #[clap(display_order = 1)] + #[clap(display_order = 0)] pub input_fastas: Vec, /// REMOVED. Use positional arguments instead. @@ -608,16 +608,16 @@ pub struct NextcladeRunOtherParams { #[derive(Parser, Debug, Clone)] pub struct NextcladeRunArgs { - #[clap(flatten, next_help_heading = " Inputs")] + #[clap(flatten, next_help_heading = "Inputs")] pub inputs: NextcladeRunInputArgs, - #[clap(flatten, next_help_heading = " Outputs")] + #[clap(flatten, next_help_heading = "Outputs")] pub outputs: NextcladeRunOutputArgs, #[clap(flatten)] pub params: NextcladeInputParamsOptional, - #[clap(flatten, next_help_heading = " Other")] + #[clap(flatten, next_help_heading = "Other")] pub other_params: NextcladeRunOtherParams, } diff --git a/packages_rs/nextclade/src/run/params.rs b/packages_rs/nextclade/src/run/params.rs index 0d8d72857..2a9738e20 100644 --- a/packages_rs/nextclade/src/run/params.rs +++ b/packages_rs/nextclade/src/run/params.rs @@ -8,13 +8,13 @@ use serde::{Deserialize, Serialize}; #[derive(Parser, Debug, Default, Clone, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "camelCase")] pub struct NextcladeInputParamsOptional { - #[clap(flatten, next_help_heading = " General parameters")] + #[clap(flatten, next_help_heading = "General parameters")] pub general: Option, - #[clap(flatten, next_help_heading = " Phylogenetic tree parameters")] + #[clap(flatten, next_help_heading = "Phylogenetic tree parameters")] pub tree_builder: Option, - #[clap(flatten, next_help_heading = " Alignment parameters")] + #[clap(flatten, next_help_heading = "Alignment parameters")] pub alignment: Option, } From 119cd4a33d7d08a57021a3ecd438f8f401be53b2 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Fri, 8 Sep 2023 11:21:03 +0200 Subject: [PATCH 2/2] fix: adjust benchmarks to the changes in alignment functions --- packages_rs/nextclade/benches/bench_create_stripes.rs | 7 ++----- packages_rs/nextclade/benches/bench_seed_alignment.rs | 9 ++++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages_rs/nextclade/benches/bench_create_stripes.rs b/packages_rs/nextclade/benches/bench_create_stripes.rs index e10348d55..728485685 100644 --- a/packages_rs/nextclade/benches/bench_create_stripes.rs +++ b/packages_rs/nextclade/benches/bench_create_stripes.rs @@ -22,9 +22,7 @@ pub fn bench_create_stripes(c: &mut Criterion) { let excess_bandwidth = black_box(2); let qry_len = black_box(30); let ref_len = black_box(40); - let max_indel = black_box(400); - let allowed_mismatches = black_box(2); - let max_band_area = black_box(500_000_000); + let minimal_bandwidth = black_box(0); let mut group = c.benchmark_group("create_stripes"); group.throughput(Throughput::Bytes(qry_len as u64)); @@ -36,8 +34,7 @@ pub fn bench_create_stripes(c: &mut Criterion) { ref_len, terminal_bandwidth, excess_bandwidth, - allowed_mismatches, - max_band_area, + minimal_bandwidth, ) }); }); diff --git a/packages_rs/nextclade/benches/bench_seed_alignment.rs b/packages_rs/nextclade/benches/bench_seed_alignment.rs index 8ce268981..66c7c85ad 100644 --- a/packages_rs/nextclade/benches/bench_seed_alignment.rs +++ b/packages_rs/nextclade/benches/bench_seed_alignment.rs @@ -6,7 +6,6 @@ use nextclade::align::params::AlignPairwiseParams; use nextclade::align::seed_alignment::create_alignment_band; use nextclade::align::seed_match2::{get_seed_matches_maybe_reverse_complement, CodonSpacedIndex, SeedMatchesResult}; use nextclade::alphabet::nuc::to_nuc_seq; -use nextclade::gene::gene_map::GeneMap; pub fn bench_seed_alignment(c: &mut Criterion) { let params = AlignPairwiseParams::default(); @@ -20,6 +19,8 @@ pub fn bench_seed_alignment(c: &mut Criterion) { let seed_index = CodonSpacedIndex::from_sequence(&ref_seq); + let minimal_bandwidth = black_box(0); + let mut group = c.benchmark_group("seed_alignment"); group.bench_function("seed_match", |b| { b.iter(|| { @@ -32,10 +33,8 @@ pub fn bench_seed_alignment(c: &mut Criterion) { ref_seq.len() as isize, params.terminal_bandwidth as isize, params.excess_bandwidth as isize, - params.allowed_mismatches as isize, - params.max_band_area, - ) - .unwrap(); + minimal_bandwidth, + ); }); }); group.finish();