From 6e3a2de61519a450822ceee7cbf6944615f557ae Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Wed, 15 Nov 2023 15:15:12 -0500 Subject: [PATCH 1/2] fix: sort deeptools plots by file basenames otherwise, it uses the full filepath which may contain the workdir random hash --- modules/local/deeptools.nf | 5 +++-- subworkflows/local/deeptools/main.nf | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/local/deeptools.nf b/modules/local/deeptools.nf index a2d139f7..aa2758ed 100644 --- a/modules/local/deeptools.nf +++ b/modules/local/deeptools.nf @@ -81,9 +81,10 @@ process BIGWIG_SUM { path("bigWigSum.npz"), emit: array script: + // sort files on basenames, otherwise uses full file path """ multiBigwigSummary bins \\ - -b ${bigwigs.join(' ')} \\ + -b ${bigwigs.sort({ a, b -> a.baseName <=> b.baseName }).join(' ')} \\ --smartLabels \\ -o bigWigSum.npz """ @@ -257,7 +258,7 @@ process COMPUTE_MATRIX { """ echo "$mattype" > file.txt computeMatrix ${cmd} \\ - -S ${bigwigs.sort().join(' ')} \\ + -S ${bigwigs.sort({ a, b -> a.baseName <=> b.baseName }).join(' ')} \\ -R ${bed} \\ -p ${task.cpus} \\ -o ${meta.id}.${bed.baseName}.${mattype}.mat.gz \\ diff --git a/subworkflows/local/deeptools/main.nf b/subworkflows/local/deeptools/main.nf index a3742c28..fdd45b2e 100644 --- a/subworkflows/local/deeptools/main.nf +++ b/subworkflows/local/deeptools/main.nf @@ -23,8 +23,8 @@ workflow DEEPTOOLS { .set { bigwigs } bigwigs - .map{ meta, bigwig -> bigwig } // sort files on basenames, otherwise uses full file path - .toSortedList( { a, b -> a.baseName <=> b.baseName } ) | BIGWIG_SUM + .map{ meta, bigwig -> bigwig } + .collect() | BIGWIG_SUM bw_array = BIGWIG_SUM.out.array bw_array.combine(Channel.of('heatmap', 'scatterplot')) | PLOT_CORRELATION bw_array | PLOT_PCA @@ -63,7 +63,7 @@ workflow DEEPTOOLS { ch_all_bigwigs = Channel.value([ id: 'inputnorm' ]) .combine(bigwigs_norm) .mix(bigwigs_raw) - .groupTuple() + .groupTuple() // sort files on basenames, otherwise uses full file path .combine(beds) .combine(Channel.of('metagene','TSS')) COMPUTE_MATRIX(ch_all_bigwigs) From 4e13d3eb72f341292d2293163ecb0702bc02ba4e Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Wed, 15 Nov 2023 15:17:39 -0500 Subject: [PATCH 2/2] chore: add #150 to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0d624b..84da69f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Per sample fingerprint plots instead of per replicate - Input normalized profile plots - Protein-coding-only versions of plots + - Ensure sample IDs are sorted (#150) ## CHAMPAGNE 0.2.1