diff --git a/workflow/envs/varlociraptor.yaml b/workflow/envs/varlociraptor.yaml index 50d1bbee..151fb266 100644 --- a/workflow/envs/varlociraptor.yaml +++ b/workflow/envs/varlociraptor.yaml @@ -3,4 +3,4 @@ channels: - bioconda - nodefaults dependencies: - - varlociraptor =5.3 + - varlociraptor =6.0 diff --git a/workflow/rules/assembly.smk b/workflow/rules/assembly.smk index 62cc5029..08c92dbb 100644 --- a/workflow/rules/assembly.smk +++ b/workflow/rules/assembly.smk @@ -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", diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index e3b72a97..79c87962 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -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): @@ -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"] diff --git a/workflow/rules/variant_filtration.smk b/workflow/rules/variant_filtration.smk index ab81d6d2..e9ed62cd 100644 --- a/workflow/rules/variant_filtration.smk +++ b/workflow/rules/variant_filtration.smk @@ -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}"