From 93b5b5ff75f5cb1f5a73e6c2bf8108d0fa3fc986 Mon Sep 17 00:00:00 2001 From: Emma Rousseau Date: Tue, 15 Oct 2024 10:42:48 +0200 Subject: [PATCH] avoid boolean_false and fix bug with output files --- src/snpeff/config.vsh.yaml | 43 +++++++++++++++++++------------------- src/snpeff/script.sh | 27 +++++++++--------------- src/snpeff/test.sh | 2 +- 3 files changed, 32 insertions(+), 40 deletions(-) diff --git a/src/snpeff/config.vsh.yaml b/src/snpeff/config.vsh.yaml index 1ad361e3..5fb8622d 100644 --- a/src/snpeff/config.vsh.yaml +++ b/src/snpeff/config.vsh.yaml @@ -3,7 +3,8 @@ description: | Genetic variant annotation, and functional effect prediction toolbox. It annotates and predicts the effects of genetic variants on genes and proteins (such as amino acid changes). -keywords: ["dna polymorphism", "genetic variation", "snp analysis", "next-generation dna sequencing"] +keywords: [ "annotation", "effect prediction", "snp", "variant", "vcf"] + links: repository: https://github.com/pcingola/SnpEff homepage: https://pcingola.github.io/SnpEff/ @@ -77,7 +78,7 @@ argument_groups: type: boolean_true description: Create HTML summary file. - name: --no_stats - type: boolean_false + type: boolean_true description: Do not create stats (summary) file. - name: Results filter options arguments: @@ -88,19 +89,19 @@ argument_groups: Only analyze changes that intersect with the intervals specified in this file. This option can be used several times. - name: --no_downstream - type: boolean_false + type: boolean_true description: Do not show DOWNSTREAM changes - name: --no_intergenic - type: boolean_false + type: boolean_true description: Do not show INTERGENIC changes. - name: --no_intron - type: boolean_false + type: boolean_true description: Do not show INTRON changes. - name: --no_upstream - type: boolean_false + type: boolean_true description: Do not show UPSTREAM changes. - name: --no_utr - type: boolean_false + type: boolean_true description: Do not show 5_PRIME_UTR or 3_PRIME_UTR changes. - name: --no type: string @@ -142,13 +143,13 @@ argument_groups: description: | Add loss of function (LOF) and Nonsense mediated decay (NMD) tags. - name: -no_hgvs - type: boolean_false + type: boolean_true description: Do not add HGVS annotations. - name: --no_lof - type: boolean_false + type: boolean_true description: Do not add LOF and NMD annotations. - name: --no_shift_hgvs - type: boolean_false + type: boolean_true description: | Do not shift variants according to HGVS notation (most 3prime end). - name: --oicr @@ -173,14 +174,11 @@ argument_groups: - name: --data_dir type: file description: Override data_dir parameter from config file. - # - name: -download - # type: boolean_true - # description: Download a SnpEff database, if not available locally. - name: --no_download - type: boolean_false + type: boolean_true description: Do not download a SnpEff database, if not available locally. - name: --no_log - type: boolean_false + type: boolean_true description: Do not report usage statistics to server. - name: --quiet alternatives: [-q] @@ -205,7 +203,7 @@ argument_groups: description: | Only use transcript having a tag 'tagName'. This option can be used multiple times. - name: --no_tag - type: boolean_false + type: boolean_true description: | Filter out transcript having a tag 'tagName'. This option can be used multiple times. - name: --interaction @@ -225,19 +223,19 @@ argument_groups: type: boolean_true description: Annotate using NextProt (requires NextProt database). - name: --no_genome - type: boolean_false + type: boolean_true description: Do not load any genomic database (e.g. annotate using custom files). - name: --no_expand_iub - type: boolean_false + type: boolean_true description: Disable IUB code expansion in input variants. - name: --no_interaction - type: boolean_false + type: boolean_true description: Disable inteaction annotations. - name: --no_motif - type: boolean_false + type: boolean_true description: Disable motif annotations. - name: --no_nextprot - type: boolean_false + type: boolean_true description: Disable NextProt annotations. - name: --only_reg type: boolean_true @@ -283,7 +281,8 @@ resources: test_resources: - type: bash_script path: test.sh - - path: test_data + - type: file + path: test_data engines: - type: docker image: quay.io/staphb/snpeff:5.2a diff --git a/src/snpeff/script.sh b/src/snpeff/script.sh index d547c486..bf3914bb 100644 --- a/src/snpeff/script.sh +++ b/src/snpeff/script.sh @@ -31,14 +31,6 @@ unset_if_false=( par_only_reg par_only_protein par_strict -) -for par in ${unset_if_false[@]}; do - test_val="${!par}" # contains the value of the 'par' - [[ "$test_val" == "false" ]] && unset $par -done - -# Unset flags if 'true' -unset_if_true=( par_no_stats par_no_downstream par_no_intergenic @@ -57,11 +49,12 @@ unset_if_true=( par_no_motif par_no_nextprot ) -for par in ${unset_if_true[@]}; do - test_val="${!par}" - [[ "$test_val" == "true" ]] && unset $par +for par in ${unset_if_false[@]}; do + test_val="${!par}" # contains the value of the 'par' + [[ "$test_val" == "false" ]] && unset $par done + # Run SnpEff snpEff \ ${par_chr:+-chr "$par_chr"} \ @@ -138,18 +131,18 @@ directory_path=$(dirname "$absolute_path") # Move the automatically generated outputs to their locations if [ -z "$par_no_stats" ]; then if [ ! -z "$par_summary" ]; then - mv -fn snpEff_summary.html "$par_summary" + mv -n snpEff_summary.html "$par_summary" else - mv -fn snpEff_summary.html "$directory_path" + mv -n snpEff_summary.html "$directory_path" fi -fi +fi if [ -z "$par_no_stats" ]; then if [ ! -z "$par_genes" ]; then - mv -fn snpEff_genes.txt "$par_genes" + mv -n snpEff_genes.txt "$par_genes" else - mv -fn snpEff_genes.txt "$directory_path" + mv -n snpEff_genes.txt "$directory_path" fi fi -exit 0 \ No newline at end of file +exit 0 diff --git a/src/snpeff/test.sh b/src/snpeff/test.sh index 241deb67..d8c72c20 100644 --- a/src/snpeff/test.sh +++ b/src/snpeff/test.sh @@ -104,7 +104,7 @@ output_files=("snpEff_genes.txt" "snpEff_summary.html") # Check if any of the files do not exist for file in "${output_files[@]}"; do if [ ! -e "temp/$file" ]; then - echo "File $file does not exist in "temp" folder." + echo "File $file does not exist in 'temp' folder." fi done