Skip to content

Commit

Permalink
fix: improved clonality event definition, usage of major subclone for…
Browse files Browse the repository at this point in the history
… assembly polishing; upgrade to varlociraptor 6.0 (#585)

* fix: improved clonality event definition, usage of major subclone for assembly polishing; upgrade to varlociraptor 6.0

* adapt wildcard constraints
  • Loading branch information
johanneskoester authored Mar 23, 2023
1 parent 406d456 commit aced95e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion workflow/envs/varlociraptor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ channels:
- bioconda
- nodefaults
dependencies:
- varlociraptor =5.3
- varlociraptor =6.0
4 changes: 2 additions & 2 deletions workflow/rules/assembly.smk
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ rule filter_chr0:
rule assembly_polishing_illumina:
input:
fasta="results/{date}/contigs/ordered/{sample}.fasta",
bcf="results/{date}/filtered-calls/ref~{sample}/{sample}.clonal.nofilter.orf.bcf",
bcfidx="results/{date}/filtered-calls/ref~{sample}/{sample}.clonal.nofilter.orf.bcf.csi",
bcf="results/{date}/filtered-calls/ref~{sample}/{sample}.subclonal-major.nofilter.orf.bcf",
bcfidx="results/{date}/filtered-calls/ref~{sample}/{sample}.subclonal-major.nofilter.orf.bcf.csi",
output:
report(
"results/{date}/polishing/bcftools-illumina/{sample}.fasta",
Expand Down
16 changes: 10 additions & 6 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,16 @@ def get_bwa_index(wildcards):


def get_target_events(wildcards):
if wildcards.reference == "main" or wildcards.clonality != "clonal":
# calling variants against the wuhan reference or we are explicitly interested in subclonal as well
return "SUBCLONAL_MINOR SUBCLONAL_MAJOR SUBCLONAL_HIGH CLONAL"
else:
# only keep clonal variants
if wildcards.clonality == "clonal":
return "CLONAL"
elif wildcards.clonality == "subclonal-major":
return "CLONAL SUBCLONAL_MAJOR SUBCLONAL_HIGH"
elif wildcards.clonality == "subclonal-high":
return "CLONAL SUBCLONAL_HIGH"
elif wildcards.clonality == "subclonal":
return "CLONAL SUBCLONAL_MAJOR SUBCLONAL_HIGH SUBCLONAL_MINOR"
else:
raise ValueError(f"Unsupported clonality value: {wildcards.clonality}")


def get_control_fdr_input(wildcards):
Expand Down Expand Up @@ -1670,7 +1674,7 @@ def get_genome_annotation(suffix=""):
wildcard_constraints:
sample="[^/.]+",
vartype="|".join(VARTYPES),
clonality="subclonal|clonal",
clonality="subclonal|clonal|subclonal-major|subclonal-high",
annotation="orf|protein",
filter="|".join(
list(map(re.escape, config["variant-calling"]["filters"])) + ["nofilter"]
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/variant_filtration.smk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ rule control_fdr:
conda:
"../envs/varlociraptor.yaml"
shell:
"varlociraptor filter-calls control-fdr --local {input} --var {wildcards.vartype} "
"varlociraptor filter-calls control-fdr --mode local-smart {input} --var {wildcards.vartype} "
"--events {params.events} --fdr {params.fdr} > {output} 2> {log}"


Expand Down

0 comments on commit aced95e

Please sign in to comment.