Skip to content

Commit fe93a58

Browse files
committed
Merge branch 'ar/make-options-consistent' into 'master'
refactor(cli): make options more consistent See merge request machine-learning/modkit!301
2 parents 71e04f4 + cd91ffd commit fe93a58

File tree

7 files changed

+51
-29
lines changed

7 files changed

+51
-29
lines changed

book/src/advanced_usage.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Filtering Options:
219219
--filter-threshold 0.9 will specify a threshold value of 0.70 for
220220
adenine and 0.9 for all other base modification calls
221221
222-
--mod-thresholds <MOD_THRESHOLDS>
222+
--mod-threshold <MOD_THRESHOLDS>
223223
Specify a passing threshold to use for a base modification,
224224
independent of the threshold for the primary sequence base or the
225225
default. For example, to set the pass threshold for 5hmC to 0.8 use
@@ -414,7 +414,7 @@ Selection Options:
414414
--filter-probs
415415
Filter out the lowest confidence base modification probabilities
416416
417-
--only-mapped
417+
--mapped-only
418418
Only use base modification probabilities from bases that are aligned
419419
when estimating the filter threshold (i.e. ignore soft-clipped, and
420420
inserted bases)
@@ -620,7 +620,7 @@ Selection Options:
620620
Only sample base modification probabilities that are aligned to the
621621
positions in this BED file. (alias: include-positions)
622622
623-
--only-mapped
623+
--mapped-only
624624
Only use base modification probabilities that are aligned (i.e. ignore
625625
soft-clipped, and inserted bases)
626626
@@ -738,7 +738,7 @@ Filtering Options:
738738
--filter-threshold 0.9 will specify a threshold value of 0.70 for
739739
adenine and 0.9 for all other base modification calls
740740
741-
--mod-thresholds <MOD_THRESHOLDS>
741+
--mod-threshold <MOD_THRESHOLDS>
742742
Specify a passing threshold to use for a base modification,
743743
independent of the threshold for the primary sequence base or the
744744
default. For example, to set the pass threshold for 5hmC to 0.8 use
@@ -775,7 +775,7 @@ Selection Options:
775775
Only summarize base modification probabilities that are aligned to the
776776
positions in this BED file. (alias: include-positions)
777777
778-
--only-mapped
778+
--mapped-only
779779
Only use base modification probabilities that are aligned (i.e. ignore
780780
soft-clipped, and inserted bases)
781781
@@ -1218,7 +1218,7 @@ Filtering Options:
12181218
--filter-threshold 0.9 will specify a threshold value of 0.70 for
12191219
adenine and 0.9 for all other base modification calls
12201220
1221-
--mod-thresholds <MOD_THRESHOLDS>
1221+
--mod-threshold <MOD_THRESHOLDS>
12221222
Specify a passing threshold to use for a base modification,
12231223
independent of the threshold for the primary sequence base or the
12241224
default. For example, to set the pass threshold for 5hmC to 0.8 use
@@ -1358,10 +1358,10 @@ Filtering Options:
13581358
--filter-threshold <FILTER_THRESHOLD>
13591359
Specify the filter threshold globally or for the canonical calls. When
13601360
specified, base modification call probabilities will be required to be
1361-
greater than or equal to this number. If `--mod-thresholds` is also
1361+
greater than or equal to this number. If `--mod-threshold` is also
13621362
specified, _this_ value will be used for canonical calls
13631363
1364-
--mod-thresholds <MOD_THRESHOLDS>
1364+
--mod-threshold <MOD_THRESHOLDS>
13651365
Specify a passing threshold to use for a base modification,
13661366
independent of the threshold for the primary sequence base or the
13671367
default. For example, to set the pass threshold for 5hmC to 0.8 use
@@ -1930,7 +1930,7 @@ Filtering Options:
19301930
--filter-threshold 0.9 will specify a threshold value of 0.70 for
19311931
adenine and 0.9 for all other base modification calls
19321932
1933-
--mod-thresholds <MOD_THRESHOLDS>
1933+
--mod-threshold <MOD_THRESHOLDS>
19341934
Specify a passing threshold to use for a base modification,
19351935
independent of the threshold for the primary sequence base or the
19361936
default. For example, to set the pass threshold for 5hmC to 0.8 use
@@ -2812,7 +2812,7 @@ Selection Options:
28122812
Check tags on non-primary alignments as well. Keep in mind this may
28132813
incur a double-counting of the read with its primary mapping
28142814
2815-
--only-mapped
2815+
--mapped-only
28162816
Only check alignments that are mapped
28172817
28182818
--region <REGION>

book/src/filtering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Threshold values for modifications on a primary sequence base can be specified o
66
For example to set a threshold for cytosine modifications at 0.8 and adenine modifications at 0.9 provide `--filter-threshold C:0.8 --filter-threshold A:0.9`.
77
Pass threshold values per base modification can also be specified.
88
For example, to specify a threshold for canonical adenine at 0.8 and 6mA at 0.9 use `--filter-threshold A:0.8 --mod-thresholds a:0.9`.
9-
Or to specify a threshold of 0.8 for 5mC, 0.9 for 5hmC, and 0.85 for canonical cytosine: `--filter-threshold C:0.85 --mod-thresholds m:0.8 --mod-thresholds h:0.9`
9+
Or to specify a threshold of 0.8 for 5mC, 0.9 for 5hmC, and 0.85 for canonical cytosine: `--filter-threshold C:0.85 --mod-threshold m:0.8 --mod-threshold h:0.9`
1010

1111
Keep in mind that the `--mod-threshold` option will treat `A`, `C`, `G`, and `T` and "any-mod" as per the [specification](https://samtools.github.io/hts-specs/SAMtags.pdf).
1212

modkit-core/src/entropy/subcommand.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub struct MethylationEntropy {
8686
filter_percentile: f32,
8787
/// Specify the filter threshold globally or for the canonical calls.
8888
/// When specified, base modification call probabilities will be required
89-
/// to be greater than or equal to this number. If `--mod-thresholds`
89+
/// to be greater than or equal to this number. If `--mod-threshold`
9090
/// is also specified, _this_ value will be used for canonical calls.
9191
#[clap(help_heading = "Filtering Options")]
9292
#[arg(
@@ -105,8 +105,8 @@ pub struct MethylationEntropy {
105105
/// See the online documentation for more details.
106106
#[clap(help_heading = "Filtering Options")]
107107
#[arg(
108-
long,
109-
alias = "mod-threshold",
108+
long = "mod-threshold",
109+
alias = "mod-thresholds",
110110
action = clap::ArgAction::Append
111111
)]
112112
mod_thresholds: Option<Vec<String>>,

modkit-core/src/extract/subcommand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ pub struct EntryExtractCalls {
389389
/// See the online documentation for more details.
390390
#[clap(help_heading = "Filtering Options")]
391391
#[arg(
392-
long,
393-
alias = "mod-threshold",
392+
long = "mod-threshold",
393+
alias = "mod-thresholds",
394394
action = clap::ArgAction::Append,
395395
hide_short_help = true
396396
)]

modkit-core/src/modbam_util/subcommands.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ pub struct EntryCheckTags {
102102
allow_non_primary: bool,
103103
/// Only check alignments that are mapped.
104104
#[clap(help_heading = "Selection Options")]
105-
#[arg(long, default_value_t = false)]
105+
#[arg(
106+
long = "mapped-only",
107+
alias = "only-mapped",
108+
default_value_t = false
109+
)]
106110
only_mapped: bool,
107111

108112
/// Process only the specified region of the BAM when collecting

modkit-core/src/pileup/subcommand.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ pub struct ModBamPileup {
180180
/// See the online documentation for more details.
181181
#[clap(help_heading = "Filtering Options")]
182182
#[arg(
183-
long,
184-
alias = "mod-threshold",
183+
long = "mod-threshold",
184+
alias = "mod-thresholds",
185185
action = clap::ArgAction::Append
186186
)]
187187
mod_thresholds: Option<Vec<String>>,
@@ -990,8 +990,8 @@ pub struct DuplexModBamPileup {
990990
/// See the online documentation for more details.
991991
#[clap(help_heading = "Filtering Options")]
992992
#[arg(
993-
long,
994-
alias = "mod-threshold",
993+
long = "mod-threshold",
994+
alias = "mod-thresholds",
995995
action = clap::ArgAction::Append
996996
)]
997997
mod_thresholds: Option<Vec<String>>,

modkit/src/commands.rs

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ pub struct Adjust {
341341
#[arg(
342342
requires="filter_probs",
343343
long = "mod-threshold",
344+
alias = "mod-thresholds",
344345
action = clap::ArgAction::Append,
345346
hide_short_help = true,
346347
)]
@@ -350,7 +351,8 @@ pub struct Adjust {
350351
/// inserted bases).
351352
#[clap(help_heading = "Selection Options")]
352353
#[arg(
353-
long,
354+
long = "mapped-only",
355+
alias = "only-mapped",
354356
default_value_t = false,
355357
hide_short_help = true,
356358
conflicts_with = "filter_percentile",
@@ -669,7 +671,12 @@ pub struct SampleModBaseProbs {
669671
sampling_frac: Option<f64>,
670672
/// No sampling, use all of the reads to calculate the filter thresholds.
671673
#[clap(help_heading = "Sampling Options")]
672-
#[arg(long, group = "sampling_options", default_value_t = false)]
674+
#[arg(
675+
long,
676+
alias = "no_filtering",
677+
group = "sampling_options",
678+
default_value_t = false
679+
)]
673680
no_sampling: bool,
674681
/// Random seed for deterministic running, the default is
675682
/// non-deterministic, only used when no BAM index is provided.
@@ -697,7 +704,11 @@ pub struct SampleModBaseProbs {
697704
/// Only use base modification probabilities that are aligned (i.e. ignore
698705
/// soft-clipped, and inserted bases).
699706
#[clap(help_heading = "Selection Options")]
700-
#[arg(long, default_value_t = false)]
707+
#[arg(
708+
long = "mapped-only",
709+
alias = "only-mapped",
710+
default_value_t = false
711+
)]
701712
only_mapped: bool,
702713
}
703714

@@ -1002,7 +1013,8 @@ pub struct ModSummarize {
10021013
/// See the online documentation for more details.
10031014
#[clap(help_heading = "Filtering Options")]
10041015
#[arg(
1005-
long,
1016+
long = "mod-threshold",
1017+
alias = "mod-thresholds",
10061018
action = clap::ArgAction::Append
10071019
)]
10081020
mod_thresholds: Option<Vec<String>>,
@@ -1038,9 +1050,13 @@ pub struct ModSummarize {
10381050
include_bed: Option<PathBuf>,
10391051
/// Only use base modification probabilities that are aligned (i.e. ignore
10401052
/// soft-clipped, and inserted bases).
1041-
#[clap(help_heading = "Selection Options")]
1053+
#[clap(
1054+
long = "mapped-only",
1055+
alias = "only-mapped",
1056+
help_heading = "Selection Options"
1057+
)]
10421058
#[arg(long, default_value_t = false)]
1043-
only_mapped: bool,
1059+
mapped_only: bool,
10441060

10451061
/// Process only the specified region of the BAM when collecting
10461062
/// probabilities. Format should be <chrom_name>:<start>-<end> or
@@ -1145,7 +1161,7 @@ impl ModSummarize {
11451161
collapse_method.as_ref(),
11461162
edge_filter.as_ref(),
11471163
position_filter.as_ref(),
1148-
self.only_mapped || position_filter.is_some(),
1164+
self.mapped_only || position_filter.is_some(),
11491165
false,
11501166
None,
11511167
None,
@@ -1165,7 +1181,7 @@ impl ModSummarize {
11651181
collapse_method.as_ref(),
11661182
edge_filter.as_ref(),
11671183
position_filter.as_ref(),
1168-
self.only_mapped || position_filter.is_some(),
1184+
self.mapped_only || position_filter.is_some(),
11691185
self.suppress_progress,
11701186
)?
11711187
};
@@ -1520,7 +1536,9 @@ pub struct CallMods {
15201536
/// unless the `--filter-threshold` option is also passed.
15211537
/// See the online documentation for more details.
15221538
#[arg(
1539+
long,
15231540
long = "mod-threshold",
1541+
alias = "mod-thresholds",
15241542
action = clap::ArgAction::Append
15251543
)]
15261544
mod_thresholds: Option<Vec<String>>,

0 commit comments

Comments
 (0)