nf-core / scrnaseq

A single-cell RNAseq pipeline for 10X genomics data
https://nf-co.re/scrnaseq
MIT License
178 stars 154 forks source link

Crash when specifying existing --star_index using star aligner #277

Open ffmmulder opened 6 months ago

ffmmulder commented 6 months ago

Description of the bug

When specifying an existing STAR index using the --star_index parameter the pipeline crashes and gives the following error:

Missing process or function map([Script_396cc086$_runScript_closure1$_closure2$_closure5@20bc6f4d])

 -- Check script '/hpc/ubec/tools/pipelines/nfcore/scrnaseq/./workflows/scrnaseq.nf' at line: 170 or see '.nextflow.log' file for more 
details

This is because in this case the ch_star_index is defined as a file instead of a tuple which is expected by the starsolo subworkflow (and which is also returned by STAR_GENOMEGENERATE in case no existing star genome is specified).

scrnaseq.nf:

ch_star_index = params.star_index ? file(params.star_index) : []

This can be fixed by adjust the line above to:

ch_star_index = params.star_index ? Channel.fromPath(params.star_index).map{f -> [[id:f.baseName], f] } : []

Command used and terminal output

Command

nextflow run /path/to/nfcore/scrnaseq/main.nf \
--input /path/to/amplesheet.csv \
--star_index /path/to/reference/star \
--fasta /path/to/fasta.fna \
--gtf /path/to/reference.gtf \
--protocol 10XV3 \
--aligner star \
--outdir /path/to/output

Output:

N E X T F L O W  ~  version 23.04.2
WARN: It appears you have never run this project before -- Option `-resume` is ignored
Launching `/hpc/ubec/tools/pipelines/nfcore/scrnaseq/main.nf` [mighty_pasteur] DSL2 - revision: bd078e3da5
[-        ] process > NFCORE_SCRNASEQ:SCRNASEQ:INPUT_CHECK:SAMPLESHEET_CHECK -
Missing process or function map([Script_396cc086$_runScript_closure1$_closure2$_closure5@20bc6f4d])

 -- Check script '/hpc/ubec/tools/pipelines/nfcore/scrnaseq/./workflows/scrnaseq.nf' at line: 170 or see '.nextflow.log' file for more details


### Relevant files

_No response_

### System information

* Nextflow version: 23.04.2
* Hardware: HPC
* Executor: Slurm
* Container engine: singularity
* OS: CentOS8 Rocky
* version of nf-core/scrnaseq: 2.4.1
grst commented 6 months ago

Thanks for reporting!

Would you like to submit a PR with the fix?

ffmmulder commented 6 months ago

Sure, currently doing a small test to make sure all works fine but looks ok... will see if I can do it later today!

pinin4fjords commented 1 month ago

I'm still seeing this behaviour in 2.6.0 - did this fix not work?

Billsfriend commented 1 month ago

I met similar problem in 2.6.0. Setting --star_index with "/path/to/folder/" will end up with:

ERROR ~ ERROR: Validation of pipeline parameters failed!

 -- Check 'ye.1.log' file for details
The following invalid input values have been detected:

* --star_index: '/home/gjsx/append-ssd/work/star_index/' is not a file, but a directory (/home/gjsx/append-ssd/work/star_index/)

 -- Check script '/home/gjsx/.nextflow/assets/nf-core/scrnaseq/./workflows/../subworkflows/local/utils_nfcore_scrnaseq_pipeline/../../nf-core/utils_nfvalidation_plugin/main.nf' at line: 57 or see 'ye.1.log' file for more details
grst commented 1 month ago

I'm still seeing this behaviour in 2.6.0 - did this fix not work?

I don't think anyone made the PR up to now.

j-andrews7 commented 1 month ago

This is also a problem for all other aligners as far as I can tell.