diff --git a/CHANGELOG.md b/CHANGELOG.md index ef758c83..2312802c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [[#438](https://github.com/nf-core/atacseq/issues/438)] - Add `checkIfExists` to file inputs in `PREPARE_GENOME` and prevent S3 access errors during index validation. - [[PR #443](https://github.com/nf-core/atacseq/pull/443)] - Updated pipeline template to [nf-core/tools 4.0.2](https://github.com/nf-core/tools/releases/tag/4.0.2) - [[PR #453](https://github.com/nf-core/atacseq/pull/453)] - Updated pipeline template to [nf-core/tools 4.0.3](https://github.com/nf-core/tools/releases/tag/4.0.3) +- [[PR #454](https://github.com/nf-core/atacseq/pull/454)] - Sort the peak QC plot inputs by file name so that `PLOT_MACS3_QC` and `PLOT_HOMER_ANNOTATEPEAKS` outputs no longer depend on task completion order. ### Parameters diff --git a/modules/local/plot_homer_annotatepeaks.nf b/modules/local/plot_homer_annotatepeaks.nf index ef4b1ce6..6b2833a6 100644 --- a/modules/local/plot_homer_annotatepeaks.nf +++ b/modules/local/plot_homer_annotatepeaks.nf @@ -23,10 +23,12 @@ process PLOT_HOMER_ANNOTATEPEAKS { script: // This script is bundled with the pipeline, in nf-core/chipseq/bin/ def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "annotatepeaks" + // Files arrive in task-completion order; sort so sample order in the outputs is reproducible. + def anno_list = annos.toSorted { anno -> anno.name }.join(',') """ plot_homer_annotatepeaks.r \\ - -i ${annos.join(',')} \\ - -s ${annos.join(',').replaceAll("${suffix}","")} \\ + -i ${anno_list} \\ + -s ${anno_list.replaceAll("${suffix}","")} \\ -p $prefix \\ $args diff --git a/modules/local/plot_macs3_qc.nf b/modules/local/plot_macs3_qc.nf index 9ce2edfe..7cf371c2 100644 --- a/modules/local/plot_macs3_qc.nf +++ b/modules/local/plot_macs3_qc.nf @@ -21,10 +21,12 @@ process PLOT_MACS3_QC { script: // This script is bundled with the pipeline, in nf-core/atacseq/bin/ def args = task.ext.args ?: '' def peak_type = is_narrow_peak ? 'narrowPeak' : 'broadPeak' + // Files arrive in task-completion order; sort so sample order in the outputs is reproducible. + def peak_list = peaks.toSorted { peak -> peak.name }.join(',') """ plot_macs3_qc.r \\ - -i ${peaks.join(',')} \\ - -s ${peaks.join(',').replaceAll("_peaks.${peak_type}","")} \\ + -i ${peak_list} \\ + -s ${peak_list.replaceAll("_peaks.${peak_type}","")} \\ $args cat <<-END_VERSIONS > versions.yml