diff --git a/VERSION b/VERSION index a918a2a..ee6cdce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 +0.6.1 diff --git a/config/cluster.json b/config/cluster.json index 5f58068..d43ab15 100644 --- a/config/cluster.json +++ b/config/cluster.json @@ -8,11 +8,13 @@ }, "fastqc_raw": { "threads": "8", - "mem": "16g" + "mem": "16g", + "gres": "lscratch:64" }, "fastqc_filtered": { "threads": "8", - "mem": "16g" + "mem": "16g", + "gres": "lscratch:64" }, "minimap2_genome": { "threads": "4", diff --git a/workflow/rules/qc.smk b/workflow/rules/qc.smk index 40351d7..8500af3 100644 --- a/workflow/rules/qc.smk +++ b/workflow/rules/qc.smk @@ -83,14 +83,34 @@ rule fastqc_raw: params: rname = "rawfqc", outdir = join(workpath, "{name}", "fastqc"), + tmpdir = tmpdir, conda: depending(join(workpath, config['conda']['modr']), use_conda) container: depending(config['images']['modr'], use_singularity) 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} \\; """ @@ -110,14 +130,34 @@ rule fastqc_filtered: params: rname = "filtfqc", outdir = join(workpath, "{name}", "fastqc"), + tmpdir = tmpdir, conda: depending(join(workpath, config['conda']['modr']), use_conda) container: depending(config['images']['modr'], use_singularity) threads: int(allocated("threads", "fastqc_filtered", 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} \\; """