Skip to content

Commit

Permalink
Add a conditional output if there is no results
Browse files Browse the repository at this point in the history
  • Loading branch information
akcorut committed Nov 22, 2021
1 parent df236ed commit 51798c8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions workflow/rules/fetch_kmers.smk
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ checkpoint fetch_kmers_from_res_table:
output:
directory("results/fetch_kmers")
params:
threshold = config["params"]["fetch_kmers"]["threshold"]
threshold = config["params"]["fetch_kmers"]["threshold"],
check_file = "results/kmers_gwas_summary/NO_KMERS_PASS_5PER_THRESHOLD_FOUND"
conda:
"../envs/kmers_stats.yaml"
message:
"Fetching significant k-mers for each phenotype from kmersGWAS results table ({input.res_tab})..."
shell:
"""
python scripts/fetch_kmers_from_results_table.py -i {input.res_tab} \
-t {params.threshold} -p {input.phenos_list} -o {output}
r"""
if [ -f {params.check_file} ]; then
mkdir {output} # Do nothing : Just create empty folder
else
python scripts/fetch_kmers_from_results_table.py -i {input.res_tab} \
-t {params.threshold} -p {input.phenos_list} -o {output}
fi
"""

# =========================================================================================================
Expand Down

0 comments on commit 51798c8

Please sign in to comment.