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
81 stars 48 forks source link

PLOT_CONSENSUS_PEAKS worflow does not produce the upset plot #248

Open Alessandro201 opened 4 months ago

Alessandro201 commented 4 months 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 months ago

Thanks for the fix!

AprilJack commented 2 months ago

I am having the same issue using release 3.2.2.

Taratype0 commented 1 month ago

Hi there, I've been running into an issue with release v3.2.2-g6e1125d, similar to what others have experienced. Does anyone know if there's a way to tweak the script on the server side to fix this problem? Any guidance would be greatly appreciated!