No such variable: params.mode

59 views
Skip to first unread message

Carlos Guzman

unread,
Dec 16, 2016, 4:21:24 PM12/16/16
to Nextflow
Some abilities seem to have broken in 2.3.

My help menus no longer work.

if (params.help && !params.mode) {
    log
.info ''
    log
.info 'C I P H E R ~ version 1.0.0'
    log
.info '========================================================================================================='
    log
.info 'Genomics Sequencing Pipeline'
    log
.info ''
    log
.info 'Usage:'
    log
.info '    main.nf --mode <MODE> --config <CONFIG> --genome <GENOME> --library <LIBRARY> [OPTIONS]...'
    log
.info ''
    log
.info 'For advanced help and optional parameters specify a pipeline mode:'
    log
.info '    main.nf --mode chip    --help'
    log
.info '    main.nf --mode dnase    --help'
    log
.info '    main.nf --mode mnase    --help'
    log
.info '    main.nf --mode gro    --help'
    log
.info '    main.nf --mode rna    --help'
    log
.info '========================================================================================================='
    log
.info ''
   
exit 1
}

Now results in a error of: No such variable: params.mode

Paolo Di Tommaso

unread,
Dec 16, 2016, 5:25:24 PM12/16/16
to nextflow

You have to define params.mode to a default valid at the beginning of your script.

p

--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.

Paolo Di Tommaso

unread,
Dec 16, 2016, 5:25:45 PM12/16/16
to nextflow

*value

Carlos Guzman

unread,
Dec 17, 2016, 1:40:13 PM12/17/16
to Nextflow
The same problem occurs with params.help ... does that have to be set to a default value as well?

This has changed in the new version, the pervious required neither to have default values.

Paolo Di Tommaso

unread,
Dec 19, 2016, 4:51:53 AM12/19/16
to nextflow
Hi Carlos, 

Yes, the latest version introduced a more strict check on user parameters (apologies if I forgot to mention it) which requires to define them before its usage. 

So, in practical term, you need to list all your params at the beginning of your script and to assign them a default value (even null). 

For example: 


Hope it helps. 

Cheers,
Paolo


On Sat, Dec 17, 2016 at 7:40 PM, Carlos Guzman <cguzma...@gmail.com> wrote:
The same problem occurs with params.help ... does that have to be set to a default value as well?

This has changed in the new version, the pervious required neither to have default values.
Reply all
Reply to author
Forward
0 new messages