Skip to content

Commit

Permalink
Remove ERDS reference affecting wgs_cnv_annotation (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
eudesbarbosa committed Nov 30, 2022
1 parent f6aedfc commit 57ce889
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
17 changes: 4 additions & 13 deletions snappy_pipeline/workflows/wgs_cnv_annotation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,18 @@ def get_input_files(self, action):
def input_function(wildcards):
# Validate action
self._validate_action(action)

# TODO: make work for non-ERDS/ERDS+SV2
# Pedigree file
tpl = "work/write_pedigree.{index_ngs_library}/out/{index_ngs_library}.ped"
yield "ped", tpl.format(**wildcards)
# SVs
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
tpl = (
"work/{mapper}.{caller}.{index_ngs_library}/out/"
"output/{mapper}.{caller}.{index_ngs_library}/out/"
"{mapper}.{caller}.{index_ngs_library}"
)
if wildcards.caller.startswith("erds"):
key_ext = {"vcf": ".vcf.gz", "tbi": ".vcf.gz.tbi"}
else:
key_ext = {"vcf": ".bcf", "tbi": ".bcf.csi"}
# SVs
wgs_cnv_calling = self.parent.sub_workflows["wgs_cnv_calling"]
if wildcards.caller == "erds_sv2":
tpl = tpl.replace(".{index_ngs_library}", ".merge_genotypes")
elif not wildcards.caller.startswith("erds"):
tpl = tpl.replace(".{index_ngs_library}", ".merge_genotypes")
for key, ext in key_ext.items():
yield key, wgs_cnv_calling(tpl + ext).format(**wildcards)
return

return input_function

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ def minimal_config():
wgs_cnv_calling:
variant_calling_tool: gatk_ug
tools:
- erds_sv2
tools: [delly2, gcnv]
wgs_cnv_annotation:
path_ngs_mapping: ../ngs_mapping
path_wgs_cnv_calling: ../wgs_cnv_calling
tools_ngs_mapping: [bwa]
tools_wgs_cnv_calling: [erds_sv2]
tools_wgs_cnv_calling: [delly2, gcnv]
data_sets:
first_batch:
Expand Down Expand Up @@ -95,11 +94,11 @@ def wgs_cnv_annotation_workflow(
def test_vcf_cnv_filter_step_part_get_input_files(wgs_cnv_annotation_workflow):
"""Tests VcfCnvFilterStepPart.get_input_files()"""
wildcards = Wildcards(
fromdict={"mapper": "bwa", "index_ngs_library": "P001-N1-DNA1-WGS1", "caller": "erds_sv2"}
fromdict={"mapper": "bwa", "index_ngs_library": "P001-N1-DNA1-WGS1", "caller": "delly2"}
)
# Define expected
wgs_cnv_calling_path = (
"WGS_CNV_CALLING/work/bwa.erds_sv2.merge_genotypes/out/bwa.erds_sv2.merge_genotypes"
"WGS_CNV_CALLING/output/bwa.delly2.P001-N1-DNA1-WGS1/out/bwa.delly2.P001-N1-DNA1-WGS1"
)
expected = {
"ped": "work/write_pedigree.P001-N1-DNA1-WGS1/out/P001-N1-DNA1-WGS1.ped",
Expand Down Expand Up @@ -164,7 +163,7 @@ def test_wgs_cnv_annotation_workflow(wgs_cnv_annotation_workflow):
for i in (1, 4)
for ext in ("vcf.gz", "vcf.gz.md5", "vcf.gz.tbi", "vcf.gz.tbi.md5")
for mapper in ("bwa",)
for cnv_caller in ("erds_sv2",)
for cnv_caller in ("delly2", "gcnv")
]
expected = list(sorted(expected))
actual = list(sorted(wgs_cnv_annotation_workflow.get_result_files()))
Expand Down

0 comments on commit 57ce889

Please sign in to comment.