rnaseq icon indicating copy to clipboard operation
rnaseq copied to clipboard

Paramter not correctly set when passing via config file

Open riederd opened this issue 2 years ago • 1 comments

Hi,

I noticed that the -g parameter of the ext.args in the SUBREAD_FEATURECOUNTS process is not set correctly when passing the gencode parameter via a config file e.g. -c my_rnaseq.config.

e.g. my_rnaseq.config

params {
   gencode = true
   gtf = "gencode.v38.primary_assembly.annotation.gtf"
}

When one runs the pipeline passing this config file which uses a gencode GTF file, the SUBREAD_FEATURECOUNTS process will fail:

nextflow run nf-core/rnaseq -r 3.8.1 -profile singularity -c ./my_rnaseq.config

because the -g option will default to -g gene_biotype insead of being set to -g gene_type

This happens at: https://github.com/nf-core/rnaseq/blob/89bf536ce4faa98b4d50a8ec0a0343780bc62e0a/conf/modules.config#L826

When modules.config is included to nextflow.config via includeConfig() at https://github.com/nf-core/rnaseq/blob/89bf536ce4faa98b4d50a8ec0a0343780bc62e0a/nextflow.config#L236 params.gencode is not yet set to the value passed via -c my_rnaseq.config. It will be set later, but then it is to late :-(

Using the command line option --gencode works, though. I'm afraid, that this situation can occur on more places for different parameters.

riederd avatar Jul 20 '22 14:07 riederd

The same applies to umitools_extract_method and umitools_bc_pattern Tested with version 3.8.1

riederd avatar Aug 10 '22 07:08 riederd

Hi @riederd ! I have written up an explanation of this here: https://github.com/nf-core/viralrecon/issues/283#issuecomment-1046237471

TL;DR With the latest Nextflow DSL2 syntax we use in nf-core pipelines you can't use the -c option to override parameter values due to precedence.

drpatelh avatar Sep 29 '22 10:09 drpatelh

Now documented on the website: https://nf-co.re/usage/configuration#custom-configuration-files

grst avatar Feb 15 '23 09:02 grst