Skip to content

Commit

Permalink
Fix conditional and path joining. GooglingTheCancerGenome#76
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnold Kuzniar authored and Arnold Kuzniar committed Sep 6, 2022
1 parent f4f7002 commit f05e224
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 21 deletions.
2 changes: 1 addition & 1 deletion workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from helper_functions import *

__author__ = "Arnold Kuzniar"
__version__ = "1.2.0"
__version__ = "1.2.1"
__license__ = "Apache License, Version 2.0"


Expand Down
22 changes: 14 additions & 8 deletions workflow/rules/delly.smk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ rule delly_p: # paired-samples analysis
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
output:
os.path.join(
"{path}/{tumor}--{normal}",
"{path}",
"{tumor}--{normal}",
get_outdir("delly"),
"delly-{}{}".format("{sv_type}", config.file_exts.bcf),
),
Expand Down Expand Up @@ -80,7 +81,8 @@ rule delly_s: # single-sample analysis
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
output:
os.path.join(
"{path}/{sample}",
"{path}",
"{sample}",
get_outdir("delly"),
"delly-{}{}".format("{sv_type}", config.file_exts.bcf),
),
Expand Down Expand Up @@ -130,30 +132,34 @@ rule delly_merge: # used by both modes
input:
[
os.path.join(
"{path}/{tumor}--{normal}",
"{path}",
"{tumor}--{normal}",
get_outdir("delly"),
"delly-{}{}".format(sv, config.file_exts.bcf),
)
for sv in config.callers.delly.sv_types
]
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else [
os.path.join(
"{path}/{sample}",
"{path}",
"{sample}",
get_outdir("delly"),
"delly-{}{}".format(sv, config.file_exts.bcf),
)
for sv in config.callers.delly.sv_types
],
output:
os.path.join(
"{path}/{tumor}--{normal}",
"{path}",
"{tumor}--{normal}",
get_outdir("delly"),
"delly{}".format(config.file_exts.vcf),
)
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else os.path.join(
"{path}/{sample}",
"{path}",
"{sample}",
get_outdir("delly"),
"delly{}".format(config.file_exts.vcf),
),
Expand Down
6 changes: 4 additions & 2 deletions workflow/rules/gridss.smk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ rule gridss_p: # paired-samples analysis
excl_opt="BLACKLIST={}".format(get_bed()) if exclude_regions() else "",
output:
os.path.join(
"{path}/{tumor}--{normal}",
"{path}",
"{tumor}--{normal}",
get_outdir("gridss"),
"gridss{}".format(config.file_exts.vcf),
),
Expand Down Expand Up @@ -76,7 +77,8 @@ rule gridss_s: # single-sample analysis
excl_opt="BLACKLIST={}".format(get_bed()) if exclude_regions() else "",
output:
os.path.join(
"{path}/{sample}",
"{path}",
"{sample}",
get_outdir("gridss"),
"gridss{}".format(config.file_exts.vcf),
),
Expand Down
6 changes: 4 additions & 2 deletions workflow/rules/lumpy.smk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ rule lumpy_p: # paired-samples analysis
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
output:
os.path.join(
"{path}/{tumor}--{normal}",
"{path}",
"{tumor}--{normal}",
get_outdir("lumpy"),
"lumpy{}".format(config.file_exts.vcf),
),
Expand Down Expand Up @@ -64,7 +65,8 @@ rule lumpy_s: # single-sample analysis
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
output:
os.path.join(
"{path}/{sample}",
"{path}",
"{sample}",
get_outdir("lumpy"),
"lumpy{}".format(config.file_exts.vcf),
),
Expand Down
6 changes: 4 additions & 2 deletions workflow/rules/manta.smk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ rule manta_p: # paired-samples analysis
outfile="results/variants/somaticSV.vcf.gz",
output:
os.path.join(
"{path}/{tumor}--{normal}",
"{path}",
"{tumor}--{normal}",
get_outdir("manta"),
"manta{}".format(config.file_exts.vcf),
),
Expand Down Expand Up @@ -66,7 +67,8 @@ rule manta_s: # single-sample analysis: germline or tumor-only
else "results/variants/diploidSV.vcf.gz",
output:
os.path.join(
"{path}/{sample}",
"{path}",
"{sample}",
get_outdir("manta"),
"manta{}".format(config.file_exts.vcf),
),
Expand Down
8 changes: 4 additions & 4 deletions workflow/rules/survivor.smk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rule survivor_filter: # used by both modes
"viola",
"{}{}".format("{prefix}", config.file_exts.vcf),
)
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else os.path.join(
"{path}",
"{sample}",
Expand All @@ -23,7 +23,7 @@ rule survivor_filter: # used by both modes
get_outdir("survivor"),
"{}{}".format("{prefix}", config.file_exts.vcf),
)
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else os.path.join(
"{path}",
"{sample}",
Expand Down Expand Up @@ -69,7 +69,7 @@ rule survivor_merge: # used by both modes
)
for c in config.enable_callers
]
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else [
os.path.join(
"{path}",
Expand All @@ -87,7 +87,7 @@ rule survivor_merge: # used by both modes
os.path.join("{path}", "{tumor}--{normal}", survivor_args("merge")[0]),
os.path.join("{path}", "{tumor}--{normal}", survivor_args("merge")[-1]),
]
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else [
os.path.join("{path}", "{sample}", survivor_args("merge")[0]),
os.path.join("{path}", "{sample}", survivor_args("merge")[-1]),
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/viola.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule viola: # used by both modes
"{outdir}",
"{}{}".format("{prefix}", config.file_exts.vcf),
)
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else os.path.join(
"{path}",
"{sample}",
Expand All @@ -21,7 +21,7 @@ rule viola: # used by both modes
"viola",
"{}{}".format("{prefix}", config.file_exts.vcf),
)
if config.mode.PAIRED_SAMPLE is True
if config.mode is config.mode.PAIRED_SAMPLE
else os.path.join(
"{path}",
"{sample}",
Expand Down

0 comments on commit f05e224

Please sign in to comment.