1111*/
1212
1313process {
14-
1514 publishDir = [
1615 path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
1716 mode: params.publish_dir_mode
1817 ]
1918
20- withName: ' SEQTK_SAMPLE' {
19+ withName: SEQTK_SAMPLE {
2120 ext.args = '-s100'
2221 }
2322
24- withName: ' FASTQC' {
23+ withName: FASTQC {
2524 ext.args = '--quiet'
2625 }
2726
28- withName: ' SEQFU_STATS' {
27+ withName: SEQFU_STATS {
2928 ext.args = ''
3029 publishDir = [
3130 path: { "${params.outdir}/seqfu_stats" },
@@ -34,93 +33,91 @@ process {
3433 ]
3534 }
3635
37- withName: ' BWAMEM2_INDEX' {
36+ withName: BWAMEM2_INDEX {
3837 publishDir = [
3938 path: { "${params.outdir}/bwamem2_index" },
4039 mode: params.publish_dir_mode
4140 ]
4241 }
4342
44- withName: ' PICARD_CREATESEQUENCEDICTIONARY' {
43+ withName: PICARD_CREATESEQUENCEDICTIONARY {
4544 publishDir = [
4645 path: { "${params.outdir}/picard_createsequencedictionary" },
4746 mode: params.publish_dir_mode
4847 ]
4948 }
5049
51- withName: ' BWAMEM2_MEM' {
50+ withName: BWAMEM2_MEM {
5251 publishDir = [
5352 path: { "${params.outdir}/bwamem2_mem" },
5453 mode: params.publish_dir_mode
5554 ]
5655 }
5756
58- withName: ' PICARD_COLLECTMULTIPLEMETRICS' {
57+ withName: PICARD_COLLECTMULTIPLEMETRICS {
5958 publishDir = [
6059 path: { "${params.outdir}/picard_collectmultiplemetrics" },
6160 mode: params.publish_dir_mode
6261 ]
6362 }
6463
65- withName: 'PICARD_COLLECTHSMETRICS' {
64+ withName: PICARD_COLLECTHSMETRICS {
65+ ext.args = { "--TMP_DIR ." }
6666 publishDir = [
6767 path: { "${params.outdir}/picard_collecthsmetrics" },
6868 mode: params.publish_dir_mode
6969 ]
70- ext.args = {"--TMP_DIR ."}
7170 }
7271
73- withName: ' SAMTOOLS_FAIDX' {
72+ withName: SAMTOOLS_FAIDX {
7473 publishDir = [
7574 path: { "${params.outdir}/samtools_faidx" },
7675 mode: params.publish_dir_mode
7776 ]
7877 }
7978
80- withName: ' SAMTOOLS_INDEX' {
79+ withName: SAMTOOLS_INDEX {
8180 publishDir = [
8281 path: { "${params.outdir}/bwamem2_mem" },
8382 mode: params.publish_dir_mode
8483 ]
8584 }
8685
87- withName: ' RUNDIRPARSER' {
86+ withName: RUNDIRPARSER {
8887 publishDir = [
8988 path: { "${params.outdir}/rundirparser" },
9089 mode: params.publish_dir_mode,
91- // The process _mqc.txt outputs should have identical names for the same sequencing platforms
92- // in order to be grouped together in the MultiQC report, but here we need to enforce uniqueness
93- // to avoid overwriting results in the publishDir.
94- saveAs: { filename -> "${meta.dirname}_${filename}" }
95- ]
90+ saveAs: { filename -> "${meta.dirname}_${filename}" }]
9691 }
9792
98- withName: ' MULTIQC_GLOBAL' {
99- ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
93+ withName: MULTIQC_GLOBAL {
94+ ext.args = { params.multiqc_title ? "--title \"${ params.multiqc_title} \"" : '' }
10095 publishDir = [
10196 path: { "${params.outdir}/multiqc/global_report" },
10297 mode: params.publish_dir_mode
10398 ]
10499 }
105100
106- withName: ' MULTIQC_PER_TAG' {
107- ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
101+ withName: MULTIQC_PER_TAG {
102+ ext.args = { params.multiqc_title ? "--title \"${ params.multiqc_title} \"" : '' }
108103 publishDir = [
109104 path: { "${params.outdir}/multiqc/group_reports" },
110105 mode: params.publish_dir_mode,
111106 saveAs: { filename ->
112- if (filename == 'versions.yml') {
113- return null
114- } else if (filename =~/\[TAG:.+\]_multiqc_(report\.html|plots|data)/) {
115- def tag = (filename =~ /\[TAG:(.+)\]_multiqc_(report\.html|plots|data)/)[0][1]
116- def new_filename = filename.replaceFirst(
117- "(?<prefix>.*)\\[TAG:${tag}\\]_(?<suffix>multiqc_(report\\.html|plots|data).*)",
118- '${prefix}${suffix}')
119- return "${tag}/${new_filename}"
120- } else {
121- return filename
122- }
107+ if (filename == 'versions.yml') {
108+ return null
123109 }
124- ]
110+ else if (filename =~ /\[TAG:.+\]_multiqc_(report\.html|plots|data)/) {
111+ def tag = (filename =~ /\[TAG:(.+)\]_multiqc_(report\.html|plots|data)/)[0][1]
112+ def new_filename = filename.replaceFirst(
113+ "(?<prefix>.*)\\[TAG:${tag}\\]_(?<suffix>multiqc_(report\\.html|plots|data).*)",
114+ '${prefix}${suffix}',
115+ )
116+ return "${tag}/${new_filename}"
117+ }
118+ else {
119+ return filename
120+ }
121+ }]
125122 }
126123}
0 commit comments