Skip to content

Commit

Permalink
script.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaspe committed Aug 6, 2024
1 parent 6451570 commit 3f8a45f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/bedtools/bedtools_groupby/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ argument_groups:
description: |
Specify the columns (1-based) for the grouping.
The columns must be comma separated.
- Default: 1,2,3
- Default: 1,2,3
required: true

- name: --column
alternatives: [-c, -opCols]
type: string
description: |
Specify the column (1-based) that should be summarized.
- Required.
required: true

- name: --operation
alternatives: [-0, -ops]
alternatives: [-o, -ops]
type: string
description: |
Specify the operation that should be applied to opCol.
Expand All @@ -82,6 +83,7 @@ argument_groups:
E.g., "-c 5,4,6 -o sum,mean,count" will give the sum of column 5,
the mean of column 4, and the count of column 6.
The order of output columns will match the ordering given in the command.
required: true

- name: --full
type: boolean_true
Expand Down Expand Up @@ -111,12 +113,7 @@ argument_groups:
type: boolean_true
description: |
Group values regardless of upper/lower case.
- name: --ignorecase
type: boolean_true
description: |
Group values regardless of upper/lower case.
- name: --precision
alternatives: -prec
type: integer
Expand Down
16 changes: 16 additions & 0 deletions src/bedtools/bedtools_groupby/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@
## VIASH START
## VIASH END

# Unset parameters
[[ "$par_full" == "false" ]] && unset par_full
[[ "$par_inheader" == "false" ]] && unset par_inheader
[[ "$par_outheader" == "false" ]] && unset par_outheader
[[ "$par_header" == "false" ]] && unset par_header
[[ "$par_ignorecase" == "false" ]] && unset par_ignorecase

bedtools groupby \
${par_full:+-full} \
${par_inheader:+-inheader} \
${par_outheader:+-outheader} \
${par_header:+-header} \
${par_ignorecase:+-ignorecase} \
${par_precision:+-prec "$par_precision"} \
${par_delimiter:+-delim "$par_delimiter"} \
-i "$par_input" \
-g "$par_groupby" \
-c "$par_column" \
-o "$par_operation" \
> "$par_output"

0 comments on commit 3f8a45f

Please sign in to comment.