Skip to content

Commit

Permalink
fix: missing check for has_annotation in somatic_variant_filtration…
Browse files Browse the repository at this point in the history
… rules (#505)
  • Loading branch information
tedil authored Apr 29, 2024
1 parent b971088 commit d7420f7
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions snappy_pipeline/workflows/somatic_variant_filtration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,13 @@ def get_input_files(self, action):
"""Return path to jannovar-annotated vcf input file"""
# Validate action
self._validate_action(action)

name_pattern = "{mapper}.{var_caller}"
if self.config["has_annotation"]:
name_pattern += ".{annotator}"

# VCF file and index
tpl = (
"output/{mapper}.{var_caller}.{annotator}.{tumor_library}/out/"
"{mapper}.{var_caller}.{annotator}.{tumor_library}"
)
tpl = f"output/{name_pattern}." "{tumor_library}/" f"out/{name_pattern}." "{tumor_library}"
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
somatic_variant = self.parent.sub_workflows["somatic_variant"]
for key, ext in key_ext.items():
Expand All @@ -523,10 +525,16 @@ def get_output_files(self, action):
"""Return output files for the filtration"""
# Validate action
self._validate_action(action)

name_pattern = "{mapper}.{var_caller}"
if self.config["has_annotation"]:
name_pattern += ".{annotator}"

prefix = (
r"work/{mapper}.{var_caller}.{annotator}."
r"dkfz_bias_filter.{tumor_library,[^\.]+}/out/{mapper}.{var_caller}."
r"{annotator}.dkfz_bias_filter.{tumor_library}"
rf"work/{name_pattern}."
r"dkfz_bias_filter.{tumor_library,[^\.]+}/"
rf"out/{name_pattern}."
r"dkfz_bias_filter.{tumor_library}"
)
key_ext = {
"vcf": ".vcf.gz",
Expand Down Expand Up @@ -588,11 +596,15 @@ def get_input_files(self, action):

@dictify
def _get_input_files_run(self, wildcards):
name_pattern = "{mapper}.{var_caller}"
if self.config["has_annotation"]:
name_pattern += ".{annotator}"
# VCF file and index
tpl = (
"work/{mapper}.{var_caller}.{annotator}."
"dkfz_bias_filter.{tumor_library}/out/{mapper}.{var_caller}."
"{annotator}.dkfz_bias_filter."
f"work/{name_pattern}."
"dkfz_bias_filter.{tumor_library}/"
f"out/{name_pattern}."
"dkfz_bias_filter."
"{tumor_library}"
)
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
Expand All @@ -619,10 +631,14 @@ def get_output_files(self, action):

@dictify
def _get_output_files_run(self):
name_pattern = "{mapper}.{var_caller}"
if self.config["has_annotation"]:
name_pattern += ".{annotator}"
# VCF file and index
prefix = (
r"work/{mapper}.{var_caller}.{annotator}."
r"dkfz_bias_filter.eb_filter.{tumor_library,[^\.]+}/out/"
r"{mapper}.{var_caller}.{annotator}."
rf"work/{name_pattern}."
r"dkfz_bias_filter.eb_filter.{tumor_library,[^\.]+}/"
rf"out/{name_pattern}."
r"dkfz_bias_filter.eb_filter.{tumor_library}"
)
key_ext = {
Expand Down

0 comments on commit d7420f7

Please sign in to comment.