Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Patch: Use tmpdir/lscratch with fastqc due to gpfs issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Feb 7, 2024
1 parent 5b60ba4 commit 728f268
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.5.6
0.5.7
6 changes: 4 additions & 2 deletions config/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@
"mem": "24g"
},
"rawfastqc": {
"threads": "8"
"threads": "8",
"gres": "lscratch:64"
},
"fastqc": {
"mem": "24g",
"threads": "32",
"time": "18:00:00"
"time": "18:00:00",
"gres": "lscratch:64"
},
"fastq_screen": {
"mem": "24g",
Expand Down
44 changes: 42 additions & 2 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -693,16 +693,36 @@ rule rawfastqc:
params:
rname='rawfastqc',
outdir=join(workpath,"rawfastQC"),
tmpdir=tmpdir,
envmodules:
config['tools']['FASTQCVER']
threads:
int(allocated("threads", "rawfastqc", 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 \\
{input.R1} \\
{input.R2} \\
-t {threads} \\
-o {params.outdir}
-o "${{tmp}}"
# Copy output files from tmpdir
# to output directory
find "${{tmp}}" \\
-type f \\
\\( -name '*.html' -o -name '*.zip' \\) \\
-exec cp {{}} {params.outdir} \\;
"""


Expand All @@ -725,16 +745,36 @@ rule fastqc:
params:
rname='fastqc',
outdir=join(workpath,"fastQC"),
tmpdir=tmpdir,
envmodules:
config['tools']['FASTQCVER']
threads:
int(allocated("threads", "fastqc", 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 \\
{input.R1} \\
{input.R2} \\
-t {threads} \\
-o {params.outdir}
-o "${{tmp}}"
# 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 728f268

Please sign in to comment.