Skip to content

Commit f05e224

Browse files
Arnold KuzniarArnold Kuzniar
Arnold Kuzniar
authored and
Arnold Kuzniar
committed
Fix conditional and path joining. GooglingTheCancerGenome#76
1 parent f4f7002 commit f05e224

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

workflow/Snakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from helper_functions import *
88

99
__author__ = "Arnold Kuzniar"
10-
__version__ = "1.2.0"
10+
__version__ = "1.2.1"
1111
__license__ = "Apache License, Version 2.0"
1212

1313

workflow/rules/delly.smk

+14-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ rule delly_p: # paired-samples analysis
1010
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
1111
output:
1212
os.path.join(
13-
"{path}/{tumor}--{normal}",
13+
"{path}",
14+
"{tumor}--{normal}",
1415
get_outdir("delly"),
1516
"delly-{}{}".format("{sv_type}", config.file_exts.bcf),
1617
),
@@ -80,7 +81,8 @@ rule delly_s: # single-sample analysis
8081
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
8182
output:
8283
os.path.join(
83-
"{path}/{sample}",
84+
"{path}",
85+
"{sample}",
8486
get_outdir("delly"),
8587
"delly-{}{}".format("{sv_type}", config.file_exts.bcf),
8688
),
@@ -130,30 +132,34 @@ rule delly_merge: # used by both modes
130132
input:
131133
[
132134
os.path.join(
133-
"{path}/{tumor}--{normal}",
135+
"{path}",
136+
"{tumor}--{normal}",
134137
get_outdir("delly"),
135138
"delly-{}{}".format(sv, config.file_exts.bcf),
136139
)
137140
for sv in config.callers.delly.sv_types
138141
]
139-
if config.mode.PAIRED_SAMPLE is True
142+
if config.mode is config.mode.PAIRED_SAMPLE
140143
else [
141144
os.path.join(
142-
"{path}/{sample}",
145+
"{path}",
146+
"{sample}",
143147
get_outdir("delly"),
144148
"delly-{}{}".format(sv, config.file_exts.bcf),
145149
)
146150
for sv in config.callers.delly.sv_types
147151
],
148152
output:
149153
os.path.join(
150-
"{path}/{tumor}--{normal}",
154+
"{path}",
155+
"{tumor}--{normal}",
151156
get_outdir("delly"),
152157
"delly{}".format(config.file_exts.vcf),
153158
)
154-
if config.mode.PAIRED_SAMPLE is True
159+
if config.mode is config.mode.PAIRED_SAMPLE
155160
else os.path.join(
156-
"{path}/{sample}",
161+
"{path}",
162+
"{sample}",
157163
get_outdir("delly"),
158164
"delly{}".format(config.file_exts.vcf),
159165
),

workflow/rules/gridss.smk

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ rule gridss_p: # paired-samples analysis
1010
excl_opt="BLACKLIST={}".format(get_bed()) if exclude_regions() else "",
1111
output:
1212
os.path.join(
13-
"{path}/{tumor}--{normal}",
13+
"{path}",
14+
"{tumor}--{normal}",
1415
get_outdir("gridss"),
1516
"gridss{}".format(config.file_exts.vcf),
1617
),
@@ -76,7 +77,8 @@ rule gridss_s: # single-sample analysis
7677
excl_opt="BLACKLIST={}".format(get_bed()) if exclude_regions() else "",
7778
output:
7879
os.path.join(
79-
"{path}/{sample}",
80+
"{path}",
81+
"{sample}",
8082
get_outdir("gridss"),
8183
"gridss{}".format(config.file_exts.vcf),
8284
),

workflow/rules/lumpy.smk

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ rule lumpy_p: # paired-samples analysis
1010
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
1111
output:
1212
os.path.join(
13-
"{path}/{tumor}--{normal}",
13+
"{path}",
14+
"{tumor}--{normal}",
1415
get_outdir("lumpy"),
1516
"lumpy{}".format(config.file_exts.vcf),
1617
),
@@ -64,7 +65,8 @@ rule lumpy_s: # single-sample analysis
6465
excl_opt='-x "%s"' % get_bed() if exclude_regions() else "",
6566
output:
6667
os.path.join(
67-
"{path}/{sample}",
68+
"{path}",
69+
"{sample}",
6870
get_outdir("lumpy"),
6971
"lumpy{}".format(config.file_exts.vcf),
7072
),

workflow/rules/manta.smk

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ rule manta_p: # paired-samples analysis
1111
outfile="results/variants/somaticSV.vcf.gz",
1212
output:
1313
os.path.join(
14-
"{path}/{tumor}--{normal}",
14+
"{path}",
15+
"{tumor}--{normal}",
1516
get_outdir("manta"),
1617
"manta{}".format(config.file_exts.vcf),
1718
),
@@ -66,7 +67,8 @@ rule manta_s: # single-sample analysis: germline or tumor-only
6667
else "results/variants/diploidSV.vcf.gz",
6768
output:
6869
os.path.join(
69-
"{path}/{sample}",
70+
"{path}",
71+
"{sample}",
7072
get_outdir("manta"),
7173
"manta{}".format(config.file_exts.vcf),
7274
),

workflow/rules/survivor.smk

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rule survivor_filter: # used by both modes
77
"viola",
88
"{}{}".format("{prefix}", config.file_exts.vcf),
99
)
10-
if config.mode.PAIRED_SAMPLE is True
10+
if config.mode is config.mode.PAIRED_SAMPLE
1111
else os.path.join(
1212
"{path}",
1313
"{sample}",
@@ -23,7 +23,7 @@ rule survivor_filter: # used by both modes
2323
get_outdir("survivor"),
2424
"{}{}".format("{prefix}", config.file_exts.vcf),
2525
)
26-
if config.mode.PAIRED_SAMPLE is True
26+
if config.mode is config.mode.PAIRED_SAMPLE
2727
else os.path.join(
2828
"{path}",
2929
"{sample}",
@@ -69,7 +69,7 @@ rule survivor_merge: # used by both modes
6969
)
7070
for c in config.enable_callers
7171
]
72-
if config.mode.PAIRED_SAMPLE is True
72+
if config.mode is config.mode.PAIRED_SAMPLE
7373
else [
7474
os.path.join(
7575
"{path}",
@@ -87,7 +87,7 @@ rule survivor_merge: # used by both modes
8787
os.path.join("{path}", "{tumor}--{normal}", survivor_args("merge")[0]),
8888
os.path.join("{path}", "{tumor}--{normal}", survivor_args("merge")[-1]),
8989
]
90-
if config.mode.PAIRED_SAMPLE is True
90+
if config.mode is config.mode.PAIRED_SAMPLE
9191
else [
9292
os.path.join("{path}", "{sample}", survivor_args("merge")[0]),
9393
os.path.join("{path}", "{sample}", survivor_args("merge")[-1]),

workflow/rules/viola.smk

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ rule viola: # used by both modes
66
"{outdir}",
77
"{}{}".format("{prefix}", config.file_exts.vcf),
88
)
9-
if config.mode.PAIRED_SAMPLE is True
9+
if config.mode is config.mode.PAIRED_SAMPLE
1010
else os.path.join(
1111
"{path}",
1212
"{sample}",
@@ -21,7 +21,7 @@ rule viola: # used by both modes
2121
"viola",
2222
"{}{}".format("{prefix}", config.file_exts.vcf),
2323
)
24-
if config.mode.PAIRED_SAMPLE is True
24+
if config.mode is config.mode.PAIRED_SAMPLE
2525
else os.path.join(
2626
"{path}",
2727
"{sample}",

0 commit comments

Comments
 (0)