Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: avoid using boolean_false #160

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

## MINOR CHANGES

* `agat_convert_bed2gff`: change type of argument `inflate_off` from `boolean_false` to `boolean_true` (PR #160).

* `cutadapt`: change type of argument `no_indels` and `no_match_adapter_wildcards` from `boolean_false` to `boolean_true` (PR #160).

* Upgrade to Viash 0.9.0.

# biobox 0.2.0
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ Finally, add all other arguments to the config file. There are a few exceptions:

* If the help lists defaults, do not add them as defaults but to the description. Example: `description: <Explanation of parameter>. Default: 10.`

Note:

* Prefer using `boolean_true` over `boolean_false`. This avoids confusion when specifying values for this argument in a Nextflow workflow.
For example, consider the CLI option `--no-indels` for `cutadapt`. If the config for `cutadapt` would specify an argument `no_indels` of type `boolean_false`,
the script of the component must pass a `--no-indels` argument to `cutadapt` when `par_no_indels` is set to `false`. This becomes problematic setting a value for this argument using `fromState` in a nextflow workflow: with `fromState: ["no_indels": true]`, the value that gets passed to the script is `true` and the `--no-indels` flag would *not* be added to the options for `cutadapt`. This is inconsitent to what one might expect when interpreting `["no_indels": true]`.
When using `boolean_true`, the reasoning becomes simpler because its value no longer represents the effect of the argument, but wether or not the flag is set.

### Step 10: Add a Docker engine

Expand Down
2 changes: 1 addition & 1 deletion src/agat/agat_convert_bed2gff/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ argument_groups:
- name: --inflate_off
description: |
By default we inflate the block fields (blockCount, blockSizes, blockStarts) to create subfeatures of the main feature (primary_tag). The type of subfeature created is based on the inflate_type parameter. If you do not want this inflating behaviour you can deactivate it by using the --inflate_off option.
type: boolean_false
type: boolean_true
- name: --inflate_type
description: |
Feature type (3rd column in gff) created when inflate parameter activated [default: exon].
Expand Down
2 changes: 1 addition & 1 deletion src/agat/agat_convert_bed2gff/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## VIASH END

# unset flags
[[ "$par_inflate_off" == "true" ]] && unset par_inflate_off
[[ "$par_inflate_off" == "false" ]] && unset par_inflate_off
[[ "$par_verbose" == "false" ]] && unset par_verbose

# run agat_convert_sp_bed2gff.pl
Expand Down
4 changes: 2 additions & 2 deletions src/cutadapt/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ argument_groups:
length of matching region. Default: 0.1 (10%).
example: 0.1
- name: --no_indels
type: boolean_false
type: boolean_true
description: |
Allow only mismatches in alignments.

Expand All @@ -218,7 +218,7 @@ argument_groups:
description: |
Interpret IUPAC wildcards in reads.
- name: --no_match_adapter_wildcards
type: boolean_false
type: boolean_true
description: |
Do not interpret IUPAC wildcards in adapters.
- name: --action
Expand Down
4 changes: 2 additions & 2 deletions src/cutadapt/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ debug
# Input arguments
###########################################################
echo ">> Parsing input arguments"
[[ "$par_no_indels" == "true" ]] && unset par_no_indels
[[ "$par_no_indels" == "false" ]] && unset par_no_indels
[[ "$par_match_read_wildcards" == "false" ]] && unset par_match_read_wildcards
[[ "$par_no_match_adapter_wildcards" == "true" ]] && unset par_no_match_adapter_wildcards
[[ "$par_no_match_adapter_wildcards" == "false" ]] && unset par_no_match_adapter_wildcards
[[ "$par_revcomp" == "false" ]] && unset par_revcomp

input_args=$(echo \
Expand Down