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

Make it possible to skip MultiQC #140

Merged
merged 10 commits into from
Aug 26, 2023
Merged

Make it possible to skip MultiQC #140

merged 10 commits into from
Aug 26, 2023

Conversation

Aratz
Copy link
Contributor

@Aratz Aratz commented Aug 24, 2023

This PR makes it possible to skip MultiQC when running the pipeline.

Additionally, it also fixes error raising (e.g. before, a missing column in the input samplesheet would result in No such variable: Nextflow instead of the correct error message).

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • CHANGELOG.md is updated.

@Aratz Aratz requested a review from maxulysse August 24, 2023 06:46
@Aratz Aratz requested a review from matthdsm as a code owner August 24, 2023 06:46
@Aratz Aratz self-assigned this Aug 24, 2023
@github-actions
Copy link

github-actions bot commented Aug 24, 2023

nf-core lint overall result: Passed ✅ ⚠️

Posted for pipeline commit c09b873

+| ✅ 154 tests passed       |+
#| ❔   2 tests were ignored |#
!| ❗   3 tests had warnings |!

❗ Test warnings:

  • pipeline_todos - TODO string in README.md: Describe the minimum required steps to execute the pipeline, e.g. how to prepare samplesheets.
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required

❔ Tests ignored:

✅ Tests passed:

Run details

  • nf-core/tools version 2.9
  • Run at 2023-08-26 02:40:41

Copy link
Member

@maxulysse maxulysse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, let's wait for the other PRs to be merged and fix the tests

Copy link
Collaborator

@edmundmiller edmundmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'm fine with the b2fq tests failing, they shouldn't be run in this case anyway(in a perfect world)!

@@ -21,7 +21,7 @@ def checkPathParamList = [
for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true) } }

// Check mandatory parameters
if (params.input) { ch_input = file(params.input) } else { Nextflow.error 'Input samplesheet not specified!' }
if (params.input) { ch_input = file(params.input) } else { error 'Input samplesheet not specified!' }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interested why you removed the Nextflow.errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, when I run it (e.g. by removing a column in the input samplesheet), I get No such variable: Nextflow, when I remove Nextflow I get the correct error message. Maybe you could try it on your side to confirm this is not because of some glitch in my setup?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Nextflow version are you on? Here's the commit that changed it: d271419

@adamrtalbot Could you explain it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on 23.04.3.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamrtalbot Could you explain it?

Honestly, no! If it doesn't import Nextflow and error works then go for it! Could be a good chance to add an explicit test for correctly raising an error.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other way around, @Aratz was finding Nextflow.error didn't work outside of a workflow context.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make sense, we have to import the Nextflow class in the groovy files I think...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the misunderstanding.

  • nextflow.Nextflow.error: Already imported into the namespace by Nextflow
  • nextflow.Nextflow: Not in namespace, but can be manually imported if you really want to (but really, don't).
  • nextflow: Not in namespace, but can be manually imported if you really want to (but really, don't).

For those that would prefer examples:

This will not work

Here because Nextflow is not in the namespace:

def testError() { 
    Nextflow.error "Exiting due to an error" 
}

workflow {
    testError()
}

The following will all work

Here we give the full namespace:

def testError() { 
    nextflow.Nextflow.error "Exiting due to an error" 
}

workflow {
    testError()
}

Here because we import Nextflow into the namespace:

import nextflow.Nextflow
def testError() { 
   Nextflow.error "Exiting due to an error" 
}

workflow {
    testError()
}

The two "working" examples are only provided for pedagogical purposes. They should always be abandoned in favour of the example below, where we rely on Nextflow importing nextflow.Nextflow.error into namespace for us:

and of course, the best and correct way:

def testError() { 
    error "Exiting due to an error" 
}

workflow {
    testError()
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome explanation! Thanks for going through that!

Now do you want to PR it to the official Nextflow docs or Nextflow gotchas? 😁

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, there's always a catch. Not quite sure if there's an obvious place in the Nextflow docs. Maybe a good home would be the "Groovy imports" module in the advanced training which is currently being merged into training.nextflow.io.

@edmundmiller edmundmiller added this to the 1.4.0 milestone Aug 26, 2023
@edmundmiller edmundmiller merged commit 69ca385 into nf-core:dev Aug 26, 2023
6 checks passed
@Aratz Aratz mentioned this pull request Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants