-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
As seen in `workflows/demultiplex.nf`, when neither trimming nor fastq are skipped, md5 sums will only be generated for fastp files.
|
There was a problem hiding this 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
There was a problem hiding this 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)!
workflows/demultiplex.nf
Outdated
@@ -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!' } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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 Nextflownextflow.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()
}
There was a problem hiding this comment.
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? 😁
There was a problem hiding this comment.
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.
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
nf-core lint
).nextflow run . -profile test,docker --outdir <OUTDIR>
).CHANGELOG.md
is updated.