Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template: Better handling of params.fasta requirement #2289

Closed
Tracked by #2340
ewels opened this issue May 12, 2023 · 2 comments
Closed
Tracked by #2340

Template: Better handling of params.fasta requirement #2289

ewels opened this issue May 12, 2023 · 2 comments
Labels
template nf-core pipeline/component template

Comments

@ewels
Copy link
Member

ewels commented May 12, 2023

Description of feature

We currently have a check for params.fasta hardcoded into lib/WorkflowPipeline.groovy:

if (!params.fasta) {
Nextflow.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file."
}

This is not very easy to find and tricky for people creating non-genomics pipelines.

Needs one or more of the following:

  1. A // TODO nf-core: comment to flag it for review with nf-core lint
  2. Some inclusion in the templating feature switches, to exclude it for non-genomics workflows
  3. Moving out of lib to somewhere more visible? 🤔 eg. we already have similar checks here:
    // Check mandatory parameters
    if (params.input) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' }

My preference would be (3) unless there's a specific reason for having it where it is currently.. @drpatelh ?

@ewels ewels added enhancement template nf-core pipeline/component template and removed enhancement labels May 12, 2023
@drpatelh
Copy link
Member

I put it in lib/ so it sits with all of the other params checks we do so they are all together in a single initialise function and to avoid adding loads of boilerplate to the main workflows.

Think I added input in the main workflow because it is one of the only inputs that can be staged directly as a channel and doesn't need to pass through a module/sub-workflow like the reference files.

I would prefer (1) because you can quite easily search for the error code in VS code and find where it is.

(2) would be good either way.

adamrtalbot added a commit to adamrtalbot/tools that referenced this issue Sep 21, 2023
…n.initialise()

Changes:
 - Guts WorkflowMain, particularly the initialise() method
 - Replaces it with INIITIALISE subworkflow

- Should be easier to maintain via nf-core/modules (more regular updates)
- Uses more native Nextflow for bioinformatics developers to follow

Should incidentally fix nf-core#2289
adamrtalbot added a commit to adamrtalbot/tools that referenced this issue Sep 21, 2023
…n.initialise()

Changes:
 - Guts WorkflowMain, particularly the initialise() method
 - Replaces it with INIITIALISE subworkflow

- Should be easier to maintain via nf-core/modules (more regular updates)
- Uses more native Nextflow for bioinformatics developers to follow

Should incidentally fix nf-core#2289
@mirpedrol
Copy link
Member

params.fasta is now outside of the lib directory and can be skipped when creating a pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template nf-core pipeline/component template
Projects
None yet
Development

No branches or pull requests

3 participants