Skip to content

Commit

Permalink
Fix gatk and bcftools rule setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed Feb 11, 2025
1 parent cacf59b commit 9d7c550
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion workflow/envs/gatk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- pandas ==2.2.2
- numpy ==2.0.0
# Tools
- gatk4 ==4.5.0.0
- gatk4 ==4.6.1.0
- snakemake-wrapper-utils ==0.6.2
# For plotting the VSQR output, we need R
- r #==4.1
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/calling-bcftools.smk
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if config["settings"].get("contig-group-size"):
if platform.system() == "Darwin"
else ""
),
java_opts=config["params"]["picard"]["SortVcf-java-opts"] + " -Xmx" + config["params"]["picard"].get("SortVcf-mem-mb", 1024) + "m",
java_opts=config["params"]["picard"]["SortVcf-java-opts"] + " -Xmx" + str(config["params"]["picard"].get("SortVcf-mem-mb", 1024)) + "m",
log:
"logs/calling/picard/sort-genotyped.log",
benchmark:
Expand Down
9 changes: 4 additions & 5 deletions workflow/rules/calling-haplotypecaller.smk
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def get_gatk_call_variants_params(wildcards, input):
get_gatk_regions_param(
regions=input.regions, default="--intervals '{}'".format(wildcards.contig)
)
+ " --native-pair-hmm-threads "
+ str(config["params"]["gatk"]["HaplotypeCaller-threads"])
# + " --native-pair-hmm-threads "
# + str(config["params"]["gatk"]["HaplotypeCaller-threads"])
+ " "
+ config["params"]["gatk"]["HaplotypeCaller-extra"]
)
Expand Down Expand Up @@ -68,9 +68,6 @@ rule call_variants:
"benchmarks/calling/called/gatk-haplotypecaller/{sample}.{contig}.log"
# Need to set threads here so that snakemake can plan the job scheduling properly
threads: config["params"]["gatk"]["HaplotypeCaller-threads"]
# resources:
# Increase time limit in factors of 24h, if the job fails due to time limit.
# time = lambda wildcards, input, threads, attempt: int(1440 * int(attempt))
params:
# The function here is where the contig variable is propagated to haplotypecaller.
# Took me a while to figure this one out...
Expand All @@ -79,6 +76,8 @@ rule call_variants:
java_opts=config["params"]["gatk"]["HaplotypeCaller-java-opts"],
resources:
mem_mb=config["params"]["gatk"].get("HaplotypeCaller-mem-mb", 1024),
# Increase time limit in factors of 24h, if the job fails due to time limit.
# time = lambda wildcards, input, threads, attempt: int(1440 * int(attempt))
group:
"call_variants"
conda:
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/filtering-gatk-vqsr.smk
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ rule gatk_variant_recalibrator:
annotation=config["params"]["gatk-vqsr"]["annotation"],
# Extras
extra=get_variant_recalibrator_extra,
java_opts=config["params"]["gatk-vqsr"]["variantrecalibrator-java-opts"] + " -Xmx" + config["params"]["gatk-vqsr"].get("variantrecalibrator-mem-mb", 1024) + "m",
java_opts=config["params"]["gatk-vqsr"]["variantrecalibrator-java-opts"] + " -Xmx" + str(config["params"]["gatk-vqsr"].get("variantrecalibrator-mem-mb", 1024)) + "m",
log:
"logs/calling/gatk-variantrecalibrator/{vartype}.log",
benchmark:
Expand Down Expand Up @@ -147,7 +147,7 @@ rule gatk_apply_vqsr:
# set mode, must be either SNP, INDEL or BOTH
mode="{vartype}",
extra=get_apply_vqsr_extra,
java_opts=config["params"]["gatk-vqsr"]["applyvqsr-java-opts"] + " -Xmx" + config["params"]["gatk-vqsr"].get("applyvqsr-mem-mb", 1024) + "m",
java_opts=config["params"]["gatk-vqsr"]["applyvqsr-java-opts"] + " -Xmx" + str(config["params"]["gatk-vqsr"].get("applyvqsr-mem-mb", 1024)) + "m",
# resources:
# mem_mb=50
conda:
Expand Down

0 comments on commit 9d7c550

Please sign in to comment.