Skip to content

Commit 30b44ae

Browse files
committed
Editing rules to decrease the chance of accidental overwrite or deletion of existing runs
1 parent a29c7c7 commit 30b44ae

File tree

5 files changed

+76
-40
lines changed

5 files changed

+76
-40
lines changed

workflow/rules/atac.smk

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,21 @@ rule count:
6161
if [ -d '{params.id}' ]; then
6262
if ! [ -f '{output.html}' ]; then
6363
rm -rf '{params.id}/'
64+
cellranger-atac count \\
65+
--id {params.id} \\
66+
--sample {params.sample} \\
67+
--reference {params.reference} \\
68+
--fastqs {params.fastqs} \\
69+
2>{log.err} 1>{log.log}
6470
fi
71+
else
72+
cellranger-atac count \\
73+
--id {params.id} \\
74+
--sample {params.sample} \\
75+
--reference {params.reference} \\
76+
--fastqs {params.fastqs} \\
77+
2>{log.err} 1>{log.log}
6578
fi
66-
67-
cellranger-atac count \\
68-
--id {params.id} \\
69-
--sample {params.sample} \\
70-
--reference {params.reference} \\
71-
--fastqs {params.fastqs} \\
72-
2>{log.err} 1>{log.log}
7379
"""
7480

7581
rule summaryFiles:

workflow/rules/cite.smk

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ rule count:
8383
lib = join(workpath, "{sample}_libraries.csv"),
8484
features = features
8585
output:
86-
join(workpath, "{sample}", "outs", "web_summary.html")
86+
html = join(workpath, "{sample}", "outs", "web_summary.html")
8787
log:
8888
err = "run_{sample}_10x_cellranger_count.err",
8989
log ="run_{sample}_10x_cellranger_count.log"
@@ -101,17 +101,27 @@ rule count:
101101
# Remove output directory
102102
# prior to running cellranger
103103
if [ -d '{params.prefix}' ]; then
104-
rm -rf '{params.prefix}/'
104+
if ! [ -f '{output.html}' ]; then
105+
rm -rf '{params.prefix}/'
106+
cellranger count \\
107+
--id={params.prefix} \\
108+
--transcriptome={params.transcriptome} \\
109+
--libraries={input.lib} \\
110+
--feature-ref={input.features} \\
111+
{params.introns} \\
112+
{params.createbam} \\
113+
2>{log.err} 1>{log.log}
114+
fi
115+
else
116+
cellranger count \\
117+
--id={params.prefix} \\
118+
--transcriptome={params.transcriptome} \\
119+
--libraries={input.lib} \\
120+
--feature-ref={input.features} \\
121+
{params.introns} \\
122+
{params.createbam} \\
123+
2>{log.err} 1>{log.log}
105124
fi
106-
107-
cellranger count \\
108-
--id={params.prefix} \\
109-
--transcriptome={params.transcriptome} \\
110-
--libraries={input.lib} \\
111-
--feature-ref={input.features} \\
112-
{params.introns} \\
113-
{params.createbam} \\
114-
2>{log.err} 1>{log.log}
115125
"""
116126

117127

workflow/rules/multi.smk

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,19 @@ rule multi:
123123
# Remove output directory
124124
# prior to running cellranger
125125
if [ -d '{params.prefix}' ]; then
126-
rm -rf '{params.prefix}/'
126+
if ! [ -f '{output}' ]; then
127+
rm -rf '{params.prefix}/'
128+
cellranger multi \\
129+
--id={params.prefix} \\
130+
--csv={input} \\
131+
2>{log.err} 1>{log.log}
132+
fi
133+
else
134+
cellranger multi \\
135+
--id={params.prefix} \\
136+
--csv={input} \\
137+
2>{log.err} 1>{log.log}
127138
fi
128-
129-
cellranger multi \\
130-
--id={params.prefix} \\
131-
--csv={input} \\
132-
2>{log.err} 1>{log.log}
133139
"""
134140

135141
rule summaryFiles:

workflow/rules/multiome.smk

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ rule count:
8080
input:
8181
lib = join(workpath, "{sample}_libraries.csv")
8282
output:
83-
join(workpath, "{sample}", "outs", "web_summary.html")
83+
html = join(workpath, "{sample}", "outs", "web_summary.html")
8484
log:
8585
err = "run_{sample}_10x_cellranger_count.err",
8686
log = "run_{sample}_10x_cellranger_count.log"
@@ -95,15 +95,23 @@ rule count:
9595
# Remove output directory
9696
# prior to running cellranger
9797
if [ -d '{params.prefix}' ]; then
98-
rm -rf '{params.prefix}/'
98+
if ! [ -f '{output.html}' ]; then
99+
rm -rf '{params.prefix}/'
100+
cellranger-arc count \\
101+
--id={params.prefix} \\
102+
--reference={params.reference} \\
103+
--libraries={input.lib} \\
104+
{params.introns} \\
105+
2>{log.err} 1>{log.log}
106+
fi
107+
else
108+
cellranger-arc count \\
109+
--id={params.prefix} \\
110+
--reference={params.reference} \\
111+
--libraries={input.lib} \\
112+
{params.introns} \\
113+
2>{log.err} 1>{log.log}
99114
fi
100-
101-
cellranger-arc count \\
102-
--id={params.prefix} \\
103-
--reference={params.reference} \\
104-
--libraries={input.lib} \\
105-
{params.introns} \\
106-
2>{log.err} 1>{log.log}
107115
"""
108116

109117
rule summaryFiles:

workflow/rules/vdj.smk

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,21 @@ rule count:
6262
if [ -d '{params.id}' ]; then
6363
if ! [ -f '{output.html}' ]; then
6464
rm -rf '{params.id}/'
65+
cellranger vdj \\
66+
--id {params.id} \\
67+
--sample {params.sample} \\
68+
--reference {params.reference} \\
69+
--fastqs {params.fastqs} \\
70+
2>{log.err} 1>{log.log}
6571
fi
72+
else
73+
cellranger vdj \\
74+
--id {params.id} \\
75+
--sample {params.sample} \\
76+
--reference {params.reference} \\
77+
--fastqs {params.fastqs} \\
78+
2>{log.err} 1>{log.log}
6679
fi
67-
68-
cellranger vdj \\
69-
--id {params.id} \\
70-
--sample {params.sample} \\
71-
--reference {params.reference} \\
72-
--fastqs {params.fastqs} \\
73-
2>{log.err} 1>{log.log}
7480
"""
7581

7682
rule summaryFiles:

0 commit comments

Comments
 (0)