nextflow-io / nextflow

A DSL for data-driven computational pipelines
http://nextflow.io
Apache License 2.0
2.71k stars 621 forks source link

ERROR ~ Strings must not be null #4980

Closed AMCalejandro closed 4 months ago

AMCalejandro commented 4 months ago

Bug report

Expected behavior and actual behavior

Nextflow finds my input files from nextflow.config and run my Nextflow DSL2 pipeline end to end. The pipeline is hosted here https://github.com/michael-ta/longitudinal-GWAS-pipeline/tree/main

Steps to reproduce the problem

Command to run onto the issue

nextflow run main.nf -profile standard

Program output

N E X T F L O W  ~  version 23.10.1
Launching `main.nf` [nauseous_waddington] DSL2 - revision: 8417faf5f4
 LONG-GWAS - GWAS P I P E L I N E
 ======================================
 Chunk size for genetic processing        : 30000
 Kinship matrix threshold                 : 0.177
 R2 threshold                             : -9
 MAF threshold                            : 0.05
 data ancestry                            : EUR
 genetic data assemble                    : hg19
 phenotype name                           : y
 covariates                               : SEX age_at_baseline
 analysis                                 : glm
 outdir                                   : /home/amcalejandro/Data/WorkingDirectory/LONG-GWAS/longwas-dev/longitudinal-GWAS-pipeline/files/longGWAS_pipeline/results/cache/TEST

ERROR ~ Strings must not be null

 -- Check script 'main.nf' at line: 46 or see '.nextflow.log' file for more details

Note: I am attaching here the .nextflow.log

Additional comment

If I run the code above, main.nf is calling this nextflow workflow

Then, the error I highlight above arises.

It is interesting to mention that if, instead of running the code above, I run the following code

nextflow run workflows/gwas.nf -profile standard

Then, the workflow initiates successfullt

N E X T F L O W  ~  version 23.10.1
Launching `workflows/gwas.nf` [high_mendel] DSL2 - revision: 201af77ed2
 LONG-GWAS - GWAS P I P E L I N E
 ======================================
 Chunk size for genetic processing        : 30000
 Kinship matrix threshold                 : 0.177
 R2 threshold                             : -9
 MAF threshold                            : 0.05
 data ancestry                            : EUR
 genetic data assemble                    : hg19
 phenotype name                           : y
 covariates                               : SEX age_at_baseline
 analysis                                 : glm
 outdir                                   : /home/amcalejandro/Data/WorkingDirectory/LONG-GWAS/longwas-dev/longitudinal-GWAS-pipeline/files/longGWAS_pipeline/results/cache/TEST

executor >  local (1)
[-        ] process > DOQC:GENETICQC               [  0%] 0 of 3
[-        ] process > DOQC:MERGER_SPLITS           -
[-        ] process > DOQC:MERGER_CHRS             -
[-        ] process > DOQC:GWASQC                  -
[83/4eb8b3] process > GWASDATA_PREP:GETPHENOS      [  0%] 0 of 1
[-        ] process > GWASDATA_PREP:REMOVEOUTLIERS -
[-        ] process > GWASDATA_PREP:COMPUTE_PCA    -
[-        ] process > GWASDATA_PREP:MERGE_PCA      -
[-        ] process > GWASDATA_PREP:EXPORT_PLINK   -
[-        ] process > GWAS_RUN:GWASGLM             -
[-        ] process > SAVE_RESULTS:SAVEGWAS        -
[-        ] process > SAVE_RESULTS:MANHATTAN       -

There are two key things I would like to highlight

Environment

nextflow.log

bentsherman commented 4 months ago

The main script imports GWAS from ./workflows/gwas.nf but there is no GWAS workflow defined there.

Error message could be improved though, specifically the error handling of the include statement:

    at nextflow.extension.Bolts.closest(Bolts.groovy:735)
    at nextflow.exception.MissingModuleComponentException.message(MissingModuleComponentException.groovy:23)
    at nextflow.exception.MissingModuleComponentException.<init>(MissingModuleComponentException.groovy:16)
    at nextflow.script.ScriptMeta.addModule(ScriptMeta.groovy:329)
    at nextflow.script.ScriptMeta.addModule(ScriptMeta.groovy:320)
    at nextflow.script.IncludeDef.load0(IncludeDef.groovy:126)
    at nextflow.script.IncludeDef$load0$1.call(Unknown Source)
AMCalejandro commented 4 months ago

Thank you for the very prompt reply Ben.

Got it working now.

I have always undefined the workflow section but it makes sense we need to give them a name if we want to include it somewhere else...

pditommaso commented 4 months ago

Error message could be improved though, specifically the error handling of the include statement

Agree, let's capture the condition and report a better message