nf-core / cutandrun

Analysis pipeline for CUT&RUN and CUT&TAG experiments that includes QC, support for spike-ins, IgG controls, peak calling and downstream analysis.
https://nf-co.re/cutandrun
MIT License
79 stars 45 forks source link

PLOT_CONSENSUS_PEAKS worflow does not produce the upset plot #248

Open Alessandro201 opened 1 month ago

Alessandro201 commented 1 month ago

Description of the bug

Hello,

The workflow NFCORE_CUTANDRUN:CUTANDRUN:PEAK_QC:PLOT_CONSENSUS_PEAKS is run with 0 exit code, however, while the folder ${params.outdir}/04_reporting/consensus_upset_plots is created, the upset plots are not produced.

Here is the working directory of the workflow:

{workDir}/work/f5/f4[...]/
├── .command.begin
├── .command.err
├── .command.log
├── .command.out
├── .command.run
├── .command.sh
├── .command.trace
├── .exitcode
├── {GROUP 1}.macs2.consensus.peak_counts.bed -> {workDir}/work/f1/2eea337cf57ff46f6b3b77d9fb8265/{GROUP 1}.macs2.consensus.peak_counts.bed
├── {GROUP 2}.macs2.consensus.peak_counts.bed -> {workDir}/work/ed/19a8a14d34c607dcdaedd4153f8176/{GROUP 2}.macs2.consensus.peak_counts.bed
└── versions.yml

And here is .command.sh:

#!/bin/bash -euo pipefail
plot_consensus_peaks.py \
    --peaks "*.peaks.bed" \
    --outpath .

cat <<-END_VERSIONS > versions.yml
"NFCORE_CUTANDRUN:CUTANDRUN:PEAK_QC:PLOT_CONSENSUS_PEAKS":
    python: $(python --version | grep -E -o "([0-9]{1,}\.)+[0-9]{1,}")
    numpy: $(python -c 'import numpy; print(numpy.__version__)')
    pandas: $(python -c 'import pandas; print(pandas.__version__)')
    upsetplot: $(python -c 'import upsetplot; print(upsetplot.__version__)')
END_VERSIONS

After modifying the script: section in modules/local/python/plot_consensus_peaks.nf to:

plot_consensus_peaks.py \
    --peaks "*.peak_counts.bed" \
    --outpath .

cat <<-END_VERSIONS > versions.yml
"NFCORE_CUTANDRUN:CUTANDRUN:PEAK_QC:PLOT_CONSENSUS_PEAKS":
    python: $(python --version | grep -E -o "([0-9]{1,}\.)+[0-9]{1,}")
    numpy: $(python -c 'import numpy; print(numpy.__version__)')
    pandas: $(python -c 'import pandas; print(pandas.__version__)')
    upsetplot: $(python -c 'import upsetplot; print(upsetplot.__version__)')
END_VERSIONS

it works as expected.

Command used and terminal output

nextflow run nf-core/cutandrun -profile singularity -params-file params.yaml --input samplesheet.csv

params.yaml

input: "./samplesheet.csv"
outdir: "./results"
genome: "GRCh38"
peakcaller: "MACS2,SEACR"
dt_calc_all_matrix: true
use_control: false
skip_igv: true


### Relevant files

_No response_

### System information

Nextflow: 24.04.3.5916
Hardware: HPC
Executor: PBS
Container engine: Singularity
OS: Rocky Linux 8.10 kernel 4.18.0
Architecture: x86-64
nf-core/cutandrun: tested with both 3.2.2 and master
chris-cheshire commented 2 weeks ago

Thanks for the fix!

AprilJack commented 2 weeks ago

I am having the same issue using release 3.2.2.