Skip to content

Commit 11f1ba9

Browse files
committed
Patch: Use tmpdir/lscratch with fastqc due to gpfs fs issue.
1 parent 1c644b5 commit 11f1ba9

File tree

3 files changed

+47
-5
lines changed

3 files changed

+47
-5
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.6.0
1+
0.6.1

config/cluster.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
},
99
"fastqc_raw": {
1010
"threads": "8",
11-
"mem": "16g"
11+
"mem": "16g",
12+
"gres": "lscratch:64"
1213
},
1314
"fastqc_filtered": {
1415
"threads": "8",
15-
"mem": "16g"
16+
"mem": "16g",
17+
"gres": "lscratch:64"
1618
},
1719
"minimap2_genome": {
1820
"threads": "4",

workflow/rules/qc.smk

+42-2
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,34 @@ rule fastqc_raw:
8383
params:
8484
rname = "rawfqc",
8585
outdir = join(workpath, "{name}", "fastqc"),
86+
tmpdir = tmpdir,
8687
conda: depending(join(workpath, config['conda']['modr']), use_conda)
8788
container: depending(config['images']['modr'], use_singularity)
8889
threads: int(allocated("threads", "fastqc_raw", cluster))
8990
shell: """
91+
# Setups temporary directory for
92+
# intermediate files with built-in
93+
# mechanism for deletion on exit
94+
if [ ! -d "{params.tmpdir}" ]; then mkdir -p "{params.tmpdir}"; fi
95+
tmp=$(mktemp -d -p "{params.tmpdir}")
96+
trap 'rm -rf "${{tmp}}"' EXIT
97+
98+
# Running fastqc with local
99+
# disk or a tmpdir, fastqc
100+
# has been observed to lock
101+
# up gpfs filesystems, adding
102+
# this on request by HPC staff
90103
fastqc \\
91104
-t {threads} \\
92-
-o {params.outdir} \\
105+
-o "${{tmp}}" \\
93106
{input.fq}
107+
108+
# Copy output files from tmpdir
109+
# to output directory
110+
find "${{tmp}}" \\
111+
-type f \\
112+
\\( -name '*.html' -o -name '*.zip' \\) \\
113+
-exec cp {{}} {params.outdir} \\;
94114
"""
95115

96116

@@ -110,14 +130,34 @@ rule fastqc_filtered:
110130
params:
111131
rname = "filtfqc",
112132
outdir = join(workpath, "{name}", "fastqc"),
133+
tmpdir = tmpdir,
113134
conda: depending(join(workpath, config['conda']['modr']), use_conda)
114135
container: depending(config['images']['modr'], use_singularity)
115136
threads: int(allocated("threads", "fastqc_filtered", cluster))
116137
shell: """
138+
# Setups temporary directory for
139+
# intermediate files with built-in
140+
# mechanism for deletion on exit
141+
if [ ! -d "{params.tmpdir}" ]; then mkdir -p "{params.tmpdir}"; fi
142+
tmp=$(mktemp -d -p "{params.tmpdir}")
143+
trap 'rm -rf "${{tmp}}"' EXIT
144+
145+
# Running fastqc with local
146+
# disk or a tmpdir, fastqc
147+
# has been observed to lock
148+
# up gpfs filesystems, adding
149+
# this on request by HPC staff
117150
fastqc \\
118151
-t {threads} \\
119-
-o {params.outdir} \\
152+
-o "${{tmp}}" \\
120153
{input.fq}
154+
155+
# Copy output files from tmpdir
156+
# to output directory
157+
find "${{tmp}}" \\
158+
-type f \\
159+
\\( -name '*.html' -o -name '*.zip' \\) \\
160+
-exec cp {{}} {params.outdir} \\;
121161
"""
122162

123163

0 commit comments

Comments
 (0)