Skip to content

Commit

Permalink
Restructure calling intermediate dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed Feb 8, 2025
1 parent 167eef2 commit 3a61807
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions workflow/rules/calling-bcftools-combined.smk
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ rule merge_variants:
# Unfortunately, we cannot pipe here, as Picard fails with that, so temp file it is...
# If we do not use small contigs, we directly output the final file.
vcf=(
temp("calling/called/merged-all.vcf.gz")
temp("calling/merged/merged-all.vcf.gz")
if (config["settings"].get("contig-group-size"))
else "calling/genotyped-all.vcf.gz"
),
done=(
touch("calling/called/merged-all.done")
touch("calling/merged/merged-all.done")
if (config["settings"].get("contig-group-size"))
else touch("calling/genotyped-all.done")
),
Expand Down
18 changes: 9 additions & 9 deletions workflow/rules/calling-bcftools-individual.smk
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ rule combine_contig:
sample=config["global"]["sample-names"],
),
output:
gvcf="calling/called/all.{contig}.g.vcf.gz",
gtbi="calling/called/all.{contig}.g.vcf.gz.tbi",
gvcflist="calling/called/all.{contig}.g.txt",
done=touch("calling/called/all.{contig}.g.done"),
gvcf="calling/combined/all.{contig}.g.vcf.gz",
gtbi="calling/combined/all.{contig}.g.vcf.gz.tbi",
gvcflist="calling/combined/all.{contig}.g.txt",
done=touch("calling/combined/all.{contig}.g.done"),
log:
"logs/calling/bcftools/combine-contig-{contig}.log",
benchmark:
Expand Down Expand Up @@ -128,7 +128,7 @@ rule combine_contig:
# config file, this is the list of the group names.
def combined_contig_gvcfs(wildcards):
fai = checkpoints.samtools_faidx.get().output[0]
return expand("calling/called/all.{contig}.g.vcf.gz", contig=get_contigs(fai))
return expand("calling/combined/all.{contig}.g.vcf.gz", contig=get_contigs(fai))


# We also need a comma-separated list of the contigs, so that bcftools can output
Expand Down Expand Up @@ -160,22 +160,22 @@ rule combine_all:
# lst="calling/genotyped/all.txt",
# done="calling/genotyped-all.done"
vcf=(
temp("calling/called/merged-all.vcf.gz")
temp("calling/merged/merged-all.vcf.gz")
if (config["settings"].get("contig-group-size"))
else "calling/genotyped-all.vcf.gz"
),
tbi=(
temp("calling/called/merged-all.vcf.gz.tbi")
temp("calling/merged/merged-all.vcf.gz.tbi")
if (config["settings"].get("contig-group-size"))
else "calling/genotyped-all.vcf.gz.tbi"
),
lst=(
temp("calling/called/merged-all.txt")
temp("calling/merged/merged-all.txt")
if (config["settings"].get("contig-group-size"))
else "calling/genotyped-all.txt"
),
done=(
touch("calling/called/merged-all.done")
touch("calling/merged/merged-all.done")
if (config["settings"].get("contig-group-size"))
else touch("calling/genotyped-all.done")
),
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 @@ -63,7 +63,7 @@ if config["settings"].get("contig-group-size"):

rule sort_variants:
input:
vcf="calling/called/merged-all.vcf.gz",
vcf="calling/merged/merged-all.vcf.gz",
refdict=genome_dict(),
output:
vcf="calling/genotyped-all.vcf.gz",
Expand Down
8 changes: 4 additions & 4 deletions workflow/rules/calling-haplotypecaller.smk
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ rule combine_calls:
),
output:
gvcf=(
"calling/called/all.{contig}.g.vcf.gz"
"calling/combined/all.{contig}.g.vcf.gz"
if config["settings"]["keep-intermediate"]["calling"]
else temp("calling/called/all.{contig}.g.vcf.gz")
else temp("calling/combined/all.{contig}.g.vcf.gz")
),
done=touch("calling/called/all.{contig}.g.done"),
done=touch("calling/combined/all.{contig}.g.done"),
params:
extra=config["params"]["gatk"]["CombineGVCFs-extra"]
+ (
Expand Down Expand Up @@ -172,7 +172,7 @@ rule genotype_variants:
ext=["amb", "ann", "bwt", "pac", "sa", "fai"],
),
refdict=genome_dict(),
gvcf="calling/called/all.{contig}.g.vcf.gz",
gvcf="calling/combined/all.{contig}.g.vcf.gz",
output:
vcf=(
"calling/genotyped/all.{contig}.vcf.gz"
Expand Down

0 comments on commit 3a61807

Please sign in to comment.