Skip to content

Commit

Permalink
Patch: using tmpdir/lscratch with fastqc due to issue with gpfs files…
Browse files Browse the repository at this point in the history
…ystem.
  • Loading branch information
skchronicles committed Feb 6, 2024
1 parent e0dc6bd commit 924fe4d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.2
0.1.3
6 changes: 4 additions & 2 deletions config/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@
"fastqc_raw": {
"threads": "4",
"mem": "16g",
"time": "0-04:00:00"
"time": "0-04:00:00",
"gres": "lscratch:64"
},
"fastqc_trim": {
"threads": "4",
"mem": "16g",
"time": "0-04:00:00"
"time": "0-04:00:00",
"gres": "lscratch:64"
},
"multiqc": {
"threads": "4",
Expand Down
44 changes: 42 additions & 2 deletions workflow/rules/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,33 @@ rule fastqc_raw:
params:
rname = "rawfqc",
outdir = join(workpath, "fastqc"),
tmpdir = tmpdir,
container: config['images']['mir-seek'],
threads: int(allocated("threads", "fastqc_raw", cluster))
shell: """
# Setups temporary directory for
# intermediate files with built-in
# mechanism for deletion on exit
if [ ! -d "{params.tmpdir}" ]; then mkdir -p "{params.tmpdir}"; fi
tmp=$(mktemp -d -p "{params.tmpdir}")
trap 'rm -rf "${{tmp}}"' EXIT
# Running fastqc with local
# disk or a tmpdir, fastqc
# has been observed to lock
# up gpfs filesystems, adding
# this on request by HPC staff
fastqc \\
-t {threads} \\
-o {params.outdir} \\
-o "${{tmp}}" \\
{input.fq}
# Copy output files from tmpdir
# to output directory
find "${{tmp}}" \\
-type f \\
\\( -name '*.html' -o -name '*.zip' \\) \\
-exec cp {{}} {params.outdir} \\;
"""


Expand All @@ -46,13 +66,33 @@ rule fastqc_trim:
params:
rname = "filtfqc",
outdir = join(workpath, "fastqc"),
tmpdir = tmpdir,
container: config['images']['mir-seek'],
threads: int(allocated("threads", "fastqc_trim", cluster))
shell: """
# Setups temporary directory for
# intermediate files with built-in
# mechanism for deletion on exit
if [ ! -d "{params.tmpdir}" ]; then mkdir -p "{params.tmpdir}"; fi
tmp=$(mktemp -d -p "{params.tmpdir}")
trap 'rm -rf "${{tmp}}"' EXIT
# Running fastqc with local
# disk or a tmpdir, fastqc
# has been observed to lock
# up gpfs filesystems, adding
# this on request by HPC staff
fastqc \\
-t {threads} \\
-o {params.outdir} \\
-o "${{tmp}}" \\
{input.fq}
# Copy output files from tmpdir
# to output directory
find "${{tmp}}" \\
-type f \\
\\( -name '*.html' -o -name '*.zip' \\) \\
-exec cp {{}} {params.outdir} \\;
"""


Expand Down

0 comments on commit 924fe4d

Please sign in to comment.