Skip to content

Commit

Permalink
make tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Dec 27, 2022
1 parent 75f5e56 commit 625bd56
Show file tree
Hide file tree
Showing 144 changed files with 456 additions and 410 deletions.
4 changes: 2 additions & 2 deletions snappy_pipeline/workflows/gcnv/gcnv_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
RESULT_EXTENSIONS = {
"vcf": ".vcf.gz",
"vcf_md5": ".vcf.gz.md5",
"tbi": ".vcf.gz.tbi",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
}

#: Predefined file name keys and extensions for log files.
Expand Down
4 changes: 2 additions & 2 deletions snappy_pipeline/workflows/ngs_mapping/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,8 +992,8 @@ def get_output_files(self, action):
def _get_output_files_run_work(self):
yield "vcf", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.vcf.gz"
yield "vcf_md5", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.vcf.gz.md5"
yield "tbi", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.vcf.gz.tbi"
yield "tbi_md5", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.vcf.gz.tbi.md5"
yield "vcf_tbi", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.vcf.gz.tbi"
yield "vcf_tbi_md5", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.vcf.gz.tbi.md5"
yield "bw", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.bw"
yield "bw_md5", "work/{mapper}.{library_name}/report/cov/{mapper}.{library_name}.cov.bw.md5"

Expand Down
6 changes: 3 additions & 3 deletions snappy_pipeline/workflows/panel_of_normals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
EXT_VALUES = (".vcf.gz", ".vcf.gz.tbi", ".vcf.gz.md5", ".vcf.gz.tbi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

#: Names of the tools that might use panel of normals
TOOLS = ["mutect2"]
Expand Down Expand Up @@ -220,8 +220,8 @@ def get_output_files(self, action):
ext_dict = {
"vcf": "vcf.gz",
"vcf_md5": "vcf.gz.md5",
"tbi": "vcf.gz.tbi",
"tbi_md5": "vcf.gz.tbi.md5",
"vcf_tbi": "vcf.gz.tbi",
"vcf_tbi_md5": "vcf.gz.tbi.md5",
}
tpls = {
"prepare_panel": "work/{{mapper}}.{tool}.prepare_panel/out/{{normal_library}}.{ext}",
Expand Down
6 changes: 3 additions & 3 deletions snappy_pipeline/workflows/roh_calling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@
#: Key => extension mapping for BED file.
BED_EXTENSIONS = {
"bed": ".bed.gz",
"tbi": ".bed.gz.tbi",
"vcf_tbi": ".bed.gz.tbi",
"bed_md5": ".bed.gz.md5",
"tbi_md5": ".bed.gz.tbi.md5",
"tbi_vcf_md5": ".bed.gz.tbi.md5",
}


Expand Down Expand Up @@ -168,7 +168,7 @@ def _get_input_files_run(self, wildcards):
"output/{mapper}.{var_caller}.{index_ngs_library}/out/"
"{mapper}.{var_caller}.{index_ngs_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
variant_calling = self.parent.sub_workflows["variant_calling"]
for key, ext in key_ext.items():
yield key, variant_calling(tpl.format(**wildcards) + ext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
BCF_KEY_EXTS = (
("bcf", ".bcf"),
("bcf_md5", ".bcf.md5"),
("csi", ".bcf.csi"),
("csi_md5", ".bcf.csi.md5"),
("bcf_csi", ".bcf.csi"),
("bcf_csi_md5", ".bcf.csi.md5"),
)


Expand Down Expand Up @@ -635,7 +635,7 @@ def _get_output_files_plot(self):

@staticmethod
def _get_output_files_export():
keys = ("bed", "seg", "vcf", "tbi")
keys = ("bed", "seg", "vcf", "vcf_tbi")
exts = ("bed", "seg", "vcf.gz", "vcf.gz.tbi")
name_pattern = "{mapper}.cnvkit.export.{library_name}"
tpl = os.path.join("work", name_pattern, "out", name_pattern + ".{ext}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
EXT_VALUES = (".vcf.gz", ".vcf.gz.tbi", ".vcf.gz.md5", ".vcf.gz.tbi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

#: Default configuration for the somatic_variant_calling step
DEFAULT_CONFIG = r"""
Expand Down Expand Up @@ -144,7 +144,7 @@ def get_input_files(self, action):
"output/{mapper}.{var_caller}.{tumor_library}/out/"
"{mapper}.{var_caller}.{tumor_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
variant_calling = self.parent.sub_workflows["somatic_variant_calling"]
for key, ext in key_ext.items():
yield key, variant_calling(tpl + ext)
Expand All @@ -158,7 +158,7 @@ def get_output_files(self, action):
"work/{mapper}.{var_caller}.jannovar_annotate_somatic_vcf.{tumor_library}/out/"
"{mapper}.{var_caller}.jannovar_annotate_somatic_vcf.{tumor_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
for key, ext in key_ext.items():
yield key, prefix + ext
yield key + "_md5", prefix + ext + ".md5"
Expand Down
42 changes: 21 additions & 21 deletions snappy_pipeline/workflows/somatic_variant_calling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@
EXT_VALUES = (".vcf.gz", ".vcf.gz.tbi", ".vcf.gz.md5", ".vcf.gz.tbi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

EXTS_MATCHED = {
"mutect": {
"vcf": ".vcf.gz",
"vcf_md5": ".vcf.gz.md5",
"tbi": ".vcf.gz.tbi",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
"full": ".full.vcf.gz",
"full_md5": ".full.vcf.gz.md5",
"full_tbi": ".full.vcf.gz.tbi",
"full_tbi_md5": ".full.vcf.gz.tbi.md5",
"full_vcf_tbi": ".full.vcf.gz.tbi",
"full_vcf_tbi_md5": ".full.vcf.gz.tbi.md5",
"txt": ".txt",
"txt_md5": ".txt.md5",
"wig": ".wig",
Expand All @@ -120,23 +120,23 @@
"scalpel": {
"vcf": ".vcf.gz",
"vcf_md5": ".vcf.gz.md5",
"tbi": ".vcf.gz.tbi",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
"full": ".full.vcf.gz",
"full_md5": ".full.vcf.gz.md5",
"full_tbi": ".full.vcf.gz.tbi",
"full_tbi_md5": ".full.vcf.gz.tbi.md5",
"full_vcf_tbi": ".full.vcf.gz.tbi",
"full_vcf_tbi_md5": ".full.vcf.gz.tbi.md5",
"tar": ".tar.gz",
},
"mutect2": {
"vcf": ".vcf.gz",
"vcf_md5": ".vcf.gz.md5",
"tbi": ".vcf.gz.tbi",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
"full": ".full.vcf.gz",
"full_md5": ".full.vcf.gz.md5",
"full_tbi": ".full.vcf.gz.tbi",
"full_tbi_md5": ".full.vcf.gz.tbi.md5",
"full_vcf_tbi": ".full.vcf.gz.tbi",
"full_vcf_tbi_md5": ".full.vcf.gz.tbi.md5",
"stats": ".vcf.stats",
"stats_md5": ".vcf.stats.md5",
"f1r2": ".f1r2_tar.tar.gz",
Expand Down Expand Up @@ -670,12 +670,12 @@ def get_output_files(self, action):
exts = {
"full": ".full.vcf.gz",
"full_md5": ".full.vcf.gz.md5",
"full_tbi": ".full.vcf.gz.tbi",
"full_tbi_md5": ".full.vcf.gz.tbi.md5",
"full_vcf_tbi": ".full.vcf.gz.tbi",
"full_vcf_tbi_md5": ".full.vcf.gz.tbi.md5",
"vcf": ".vcf.gz",
"vcf_md5": ".vcf.gz.md5",
"tbi": ".vcf.gz.tbi",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
}
if action == "contamination":
exts = {
Expand Down Expand Up @@ -808,12 +808,12 @@ class Strelka2StepPart(SomaticVariantCallingStepPart):
extensions = {
"vcf": ".vcf.gz",
"vcf_md5": ".vcf.gz.md5",
"tbi": ".vcf.gz.tbi",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
"full": ".full.vcf.gz",
"full_md5": ".full.vcf.gz.md5",
"full_tbi": ".full.vcf.gz.tbi",
"full_tbi_md5": ".full.vcf.gz.tbi.md5",
"full_vcf_tbi": ".full.vcf.gz.tbi",
"full_vcf_tbi_md5": ".full.vcf.gz.tbi.md5",
"stats": ".tsv",
"stats_md5": ".tsv.md5",
"report": ".xml",
Expand Down
16 changes: 8 additions & 8 deletions snappy_pipeline/workflows/somatic_variant_filtration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
EXT_VALUES = (".vcf.gz", ".vcf.gz.tbi", ".vcf.gz.md5", ".vcf.gz.tbi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

#: Default configuration for the somatic_variant_calling step
DEFAULT_CONFIG = r"""
Expand Down Expand Up @@ -216,7 +216,7 @@ def get_input_files(self, action):
"output/{mapper}.{var_caller}.jannovar_annotate_somatic_vcf.{tumor_library}/out/"
"{mapper}.{var_caller}.jannovar_annotate_somatic_vcf.{tumor_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
variant_annotation = self.parent.sub_workflows["somatic_variant_annotation"]
for key, ext in key_ext.items():
yield key, variant_annotation(tpl + ext)
Expand All @@ -239,9 +239,9 @@ def get_output_files(self, action):
)
key_ext = {
"vcf": ".vcf.gz",
"tbi": ".vcf.gz.tbi",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_md5": ".vcf.gz.md5",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
}
for key, ext in key_ext.items():
yield key, prefix + ext
Expand Down Expand Up @@ -293,7 +293,7 @@ def _get_input_files_run(self, wildcards):
"jannovar_annotate_somatic_vcf.dkfz_bias_filter."
"{tumor_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
for key, ext in key_ext.items():
yield key, tpl.format(**wildcards) + ext
# BAM file and index
Expand Down Expand Up @@ -325,9 +325,9 @@ def _get_output_files_run(self):
)
key_ext = {
"vcf": ".vcf.gz",
"tbi": ".vcf.gz.tbi",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_md5": ".vcf.gz.md5",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
}
for key, ext in key_ext.items():
yield key, prefix + ext
Expand Down Expand Up @@ -445,7 +445,7 @@ def get_input_files(self, action):
"jannovar_annotate_somatic_vcf.dkfz_bias_filter.eb_filter."
"{tumor_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
for key, ext in key_ext.items():
yield key, tpl + ext

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_input_files(self, action):
"output/{mapper}.{var_caller}.{tumor_library}/out/"
"{mapper}.{var_caller}.{tumor_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
variant_calling = self.parent.sub_workflows["somatic_variant_calling"]
for key, ext in key_ext.items():
yield key, variant_calling(tpl + ext)
Expand Down
9 changes: 7 additions & 2 deletions snappy_pipeline/workflows/somatic_wgs_cnv_calling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
BCF_EXT_VALUES = (".bcf", ".bcf.csi", ".bcf.md5", ".bcf.csi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

#: Available somatic WGS CNV callers
SOMATIC_WGS_CNV_CALLERS = ("canvas", "cnvetti", "control_freec")
Expand Down Expand Up @@ -287,7 +287,12 @@ class CnvettiSomaticWgsStepPart(SomaticWgsCnvCallingStepPart):
actions = ("coverage", "tumor_normal_ratio", "segment")

#: Extension file dictionary. Key: file type (string); Value: file extension (string)
bcf_dict = {"bcf": ".bcf", "csi": ".bcf.csi", "bcf_md5": ".bcf.md5", "csi_md5": ".bcf.csi.md5"}
bcf_dict = {
"bcf": ".bcf",
"bcf_csi": ".bcf.csi",
"bcf_md5": ".bcf.md5",
"bcf_csi_md5": ".bcf.csi.md5",
}

def get_input_files(self, action):
"""Return input function for CNVetti rule"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
EXT_VALUES = (".vcf.gz", ".vcf.gz.tbi", ".vcf.gz.md5", ".vcf.gz.tbi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

#: Available somatic variant callers
SOMATIC_VARIANT_CALLERS = ("manta", "delly2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
EXT_VALUES = (".vcf.gz", ".vcf.gz.tbi", ".vcf.gz.md5", ".vcf.gz.tbi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

#: Default configuration of the targeted_seq_cnv_filtration step
DEFAULT_CONFIG = r"""
Expand Down Expand Up @@ -155,7 +155,7 @@ def input_function(wildcards):
"output/{mapper}.{caller}.{index_ngs_library}/out/"
"{mapper}.{caller}.{index_ngs_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
# SVs
targeted_seq_cnv_calling = self.parent.sub_workflows["targeted_seq_cnv_calling"]
if wildcards.caller == "xhmm":
Expand Down Expand Up @@ -184,9 +184,9 @@ def get_output_files(self, action):
)
key_ext = {
"vcf": ".vcf.gz",
"tbi": ".vcf.gz.tbi",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_md5": ".vcf.gz.md5",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
}
for key, ext in key_ext.items():
yield key, prefix + ext
Expand Down
12 changes: 6 additions & 6 deletions snappy_pipeline/workflows/targeted_seq_cnv_calling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
EXT_VALUES = (".vcf.gz", ".vcf.gz.tbi", ".vcf.gz.md5", ".vcf.gz.tbi.md5")

#: Names of the files to create for the extension
EXT_NAMES = ("vcf", "tbi", "vcf_md5", "tbi_md5")
EXT_NAMES = ("vcf", "vcf_tbi", "vcf_md5", "vcf_tbi_md5")

#: Available WGS CNV callers
TARGETED_SEQ_CNV_CALLERS = ("xhmm", "gcnv")
Expand Down Expand Up @@ -366,7 +366,7 @@ def _get_input_files_extract_ped(self, wildcards):
name_pattern = "{mapper}.xhmm_genotype.{library_kit}".format(
library_kit=library_kit, **wildcards
)
for key, ext in (("vcf", ".vcf.gz"), ("tbi", ".vcf.gz.tbi")):
for key, ext in (("vcf", ".vcf.gz"), ("vcf_tbi", ".vcf.gz.tbi")):
yield key, "work/{name_pattern}/out/{name_pattern}{ext}".format(
name_pattern=name_pattern, ext=ext
)
Expand Down Expand Up @@ -476,8 +476,8 @@ def _get_output_files_genotype():
kvs = (
("vcf", ".vcf.gz"),
("vcf_md5", ".vcf.gz.md5"),
("tbi", ".vcf.gz.tbi"),
("tbi_md5", ".vcf.gz.tbi.md5"),
("vcf_tbi", ".vcf.gz.tbi"),
("vcf_tbi_md5", ".vcf.gz.tbi.md5"),
)
for key, suffix in kvs:
yield key, "work/{name_pattern}/out/{name_pattern}{suffix}".format(
Expand All @@ -491,8 +491,8 @@ def _get_output_files_extract_ped():
kvs = (
("vcf", ".vcf.gz"),
("vcf_md5", ".vcf.gz.md5"),
("tbi", ".vcf.gz.tbi"),
("tbi_md5", ".vcf.gz.tbi.md5"),
("vcf_tbi", ".vcf.gz.tbi"),
("vcf_tbi_md5", ".vcf.gz.tbi.md5"),
)
for key, suffix in kvs:
yield key, "work/{name_pattern}/out/{name_pattern}{suffix}".format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_input_files(self, action):
"output/{mapper}.{var_caller}.annotated.{index_ngs_library}/out/"
"{mapper}.{var_caller}.annotated.{index_ngs_library}"
)
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
key_ext = {"vcf": ".vcf.gz", "vcf_tbi": ".vcf.gz.tbi"}
targeted_seq_cnv_annotation = self.parent.sub_workflows["targeted_seq_cnv_annotation"]
for key, ext in key_ext.items():
yield key, targeted_seq_cnv_annotation(tpl + ext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ def _get_output_files_analysis():
"vcf": ".vcf",
"vcf_gz": ".vcf.gz",
"vcf_gz_md5": ".vcf.gz.md5",
"tbi": ".vcf.gz.tbi",
"tbi_md5": ".vcf.gz.tbi.md5",
"vcf_tbi": ".vcf.gz.tbi",
"vcf_tbi_md5": ".vcf.gz.tbi.md5",
}
for key, ext in ext_dict.items():
yield key, "work/{name_pattern}/out/{name_pattern}{ext}".format(
Expand Down
Loading

0 comments on commit 625bd56

Please sign in to comment.