Skip to content

Commit

Permalink
change boolean params and fix bug with output files
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarousseau committed Oct 15, 2024
1 parent 39357f4 commit 34da0c2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 39 deletions.
40 changes: 19 additions & 21 deletions src/snpeff/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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
Expand All @@ -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
Expand Down
27 changes: 10 additions & 17 deletions src/snpeff/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"} \
Expand Down Expand Up @@ -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 -f snpEff_summary.html "$par_summary"
mv -n snpEff_summary.html "$par_summary"
else
mv -f 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 -f snpEff_genes.txt "$par_genes"
mv -n snpEff_genes.txt "$par_genes"
else
mv -f snpEff_genes.txt "$directory_path"
mv -n snpEff_genes.txt "$directory_path"
fi
fi

exit 0
exit 0
2 changes: 1 addition & 1 deletion src/snpeff/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 34da0c2

Please sign in to comment.