cutandrun icon indicating copy to clipboard operation
cutandrun copied to clipboard

test run TRIMGALORE error

Open JakobHofvander opened this issue 2 months ago • 3 comments

Description of the bug

Hello! I'm trying to install and test the pipeline. nextflow run nf-core/cutandrun -profile test,singularity --outdir ~/test but I get the following error

ERROR ~ Cannot invoke method optional() on null object

-- Check script '.nextflow/assets/nf-core/cutandrun/modules/local/for_patch/trimgalore/main.nf' at line: 18 or see '.nextflow.log' file for more details

Command used and terminal output


Relevant files

No response

System information

Nextflow 25.10.0 cutandrun 3.2.2 Singularity Linux

JakobHofvander avatar Oct 23 '25 12:10 JakobHofvander

Hello, also getting this error on Nextflow 25.10.0. Same error if forcing to cutandrun 3.0. Traceback to '.nextflow/assets/nf-core/cutandrun/modules/local/for_patch/trimgalore/main.nf at line 18 yields this command:

tuple val(meta), path("*.html"), emit: html optional true

Not sure how to interpret this error, some google suggests Groovy might have issues with hyphens in html addresss?

pcream avatar Oct 24 '25 15:10 pcream

Same here, same versions. This is true if I try a test run (-profile test,apptainer) or a real run. Also doesn't matter if I run using nf-core pipelines ... or nextflow run. I tried using my own yml, as well as one put together with the builder.

Here is my terminal output from a test, and attached is my .nextflow.log

nextflow.log

nextflow run nf-core/cutandrun -r 3.2.2 -profile test,singularity 
 N E X T F L O W   ~  version 25.10.0
Launching `https://github.com/nf-core/cutandrun` [irreverent_crick] DSL2 - revision: 6e1125d4fe [3.2.2]
WARN: =========================================================================================================
  dt_calc_all_matrix is switched on which will calculate a deeptools matrix for all samples. 
  If you have a large sample count, this may affect pipeline performance and result in errors. 
  Set this option to false to disable this feature and only calculate deeptools heatmaps for single samples
===============================================================================================================
------------------------------------------------------
                                        ,--./,-.
        ___     __   __   __   ___     /,-._.--~'
  |\ | |__  __ /  ` /  \ |__) |__         }  {
  | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                        `._,._,'
  nf-core/cutandrun v3.2.2-g6e1125d
------------------------------------------------------
Core Nextflow options
  revision                  : 3.2.2
  runName                   : irreverent_crick
  containerEngine           : singularity
  launchDir                 : /projects/standard/swernimo/shared/RI/2025_cutntag/scripts
  workDir                   : /projects/standard/swernimo/shared/RI/2025_cutntag/scripts/work
  projectDir                : /users/4/chaco001/.nextflow/assets/nf-core/cutandrun
  userName                  : chaco001
  profile                   : test,singularity
  configFiles               : 
Input/output options
  input                     : https://raw.githubusercontent.com/nf-core/test-datasets/cutandrun/samplesheet_2_0/test-GSE145187-small.csv
Reference data options
  bowtie2                   : https://raw.githubusercontent.com/nf-core/test-datasets/cutandrun/reference/genomes/hg38-chr20-bowtie2.tar.gz
  gtf                       : https://raw.githubusercontent.com/nf-core/test-datasets/cutandrun/reference/genomes/hg38-chr20-genes.gtf.gz
  gene_bed                  : https://raw.githubusercontent.com/nf-core/test-datasets/cutandrun/reference/genomes/hg38-chr20-genes.bed.gz
  blacklist                 : /users/4/chaco001/.nextflow/assets/nf-core/cutandrun/assets/blacklists/hg38-blacklist.bed
  spikein_bowtie2           : https://raw.githubusercontent.com/nf-core/test-datasets/cutandrun/reference/genomes/e_coli_U00096_3.tar.gz
  spikein_fasta             : https://raw.githubusercontent.com/nf-core/test-datasets/cutandrun/reference/genomes/e_coli_U00096_3.fa.gz
  fasta                     : https://raw.githubusercontent.com/nf-core/test-datasets/cutandrun/reference/genomes/hg38-chr20.fa.gz
Pipeline Options
  remove_mitochondrial_reads: true
  mito_name                 : chrM
  remove_linear_duplicates  : true
  macs_gsize                : 2700000000.0
  replicate_threshold       : 1.0
Institutional config options
  config_profile_name       : Test profile
  config_profile_description: Minimal test dataset to check pipeline function
Max job request options
  max_cpus                  : 2
  max_memory                : 6.GB
  max_time                  : 6.h
!! Only displaying parameters that differ from the pipeline defaults !!
------------------------------------------------------
------------------------------------------------------
If you use nf-core/cutandrun for your analysis please cite:
  https://doi.org/10.5281/zenodo.5653535
* The nf-core framework
  https://doi.org/10.1038/s41587-020-0439-x
* Software dependencies
  https://github.com/nf-core/cutandrun/blob/master/CITATIONS.md
ERROR ~ Cannot invoke method optional() on null object
 -- Check script '/users/4/chaco001/.nextflow/assets/nf-core/cutandrun/modules/local/for_patch/trimgalore/main.nf' at line: 18 or see '.nextflow.log' file for more details

jeremymchacon avatar Oct 28 '25 16:10 jeremymchacon

I had the same issue earlier and after lots of digging, I found that Nextflow 25 rewired the channel emit syntax so modifiers (like optional, collect, saveAs, etc.) have to use the key: value form now. So you actually have to either use an earlier version or set NXF_ENABLE_STRICT=false to allow the old syntax until they make the necessary changes.

eghasemy avatar Nov 03 '25 00:11 eghasemy

I wanted to report that if I reverted to Nextflow 24, I was able to pull and run the cutandrun pipeline without issue if anybody is still looking for a (hopefully temporary) solution.

pcream avatar Nov 11 '25 22:11 pcream

the two lines: https://github.com/nf-core/cutandrun/blob/3.2.2/modules/local/for_patch/trimgalore/main.nf#L18-L19, are wrong with missing commas. you also need to remove the empty line, see follows.

output: tuple val(meta), path("trimmed.fastq.gz") , emit: reads tuple val(meta), path("report.txt") , emit: log path "versions.yml" , emit: versions tuple val(meta), path(".html"), emit: html, optional: true tuple val(meta), path(".zip") , emit: zip, optional: true

haibol2016 avatar Nov 25 '25 19:11 haibol2016

I wanted to report that if I reverted to Nextflow 24, I was able to pull and run the cutandrun pipeline without issue if anybody is still looking for a (hopefully temporary) solution.

same here

sunta3iouxos avatar Nov 27 '25 17:11 sunta3iouxos