-
Notifications
You must be signed in to change notification settings - Fork 131
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
Update pipeline summary report #644
Conversation
|
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.
Difficult to review due to the complexity, but since tests pass it must be fine.
Two tiny comments.
@@ -894,7 +892,7 @@ invisible(dev.off()) | |||
cat("## DADA2\n") | |||
|
|||
# indicate reference taxonomy | |||
if (!params$flag_dada_ref_tax_user) { | |||
if ( !isFALSE(params$dada2_ref_tax_title) ) { |
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.
This looks odd to me -- negating isFALSE
instead of testing for true -- but maybe it's the way it should be?
(In (at least) one more place further down.)
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.
True that looks odd. I actually havent tested isTRUE
but used !isFALSE
because the default of that params is FALSE
, if data is coming through it could be anything, TRUE, a string (file, setting, ...), a number,...
So I figured !isFALSE
is my safest bet. Am I wrong?
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've never used either of the two functions, but isTRUE
would be my choice even if the default for the param is false. The difference between if ( isTRUE(cond) )
and if ( cond )
appears to be that isTRUE
doesn't return NAs. isFALSE
is defined analogously according to the documentation. isTRUE('string')
returns false while evaluating a string as a logical returns NA. If you're not certain of what type the variable is (e.g. a logical or a string) I think you need to do something more elaborate.
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.
Yes, the point is here that I'm not certain of what type the variable is (e.g. a logical or a string) and
!isFALSE('string')
!isFALSE(TRUE)
!isFALSE(1)
all return TRUE, so seem to work as intended.
if ( 'string' ) {}
returns Error in if ("string") { : argument is not interpretable as logical
isTRUE('string')
is FALSE
, so not doing what I want.
So while I agree the double negation looks bad, it seems to do what it should and the cleaner versions I came up with didnt.
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 am open to suggestion ofc ;)
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 suppose the correct thing would be to make sure the variable is logical before using it. I understand if you have better things to do than correct working code though.
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 have considered giving additional logical params to the Rmd script, but that did blow up the list of params tremendously and make the already not easy to maintain Rmd file even more unhandy.
Then I considered making logical variables from the variables I am using now, but that again made the whole code more complicated (at least in my eyes) and I refrained from it.
I guess I go with whats in now. Thanks for the feedback anyway!
Co-authored-by: Daniel Lundin <erik.rikard.daniel@gmail.com>
Ironing out issues in the pipeline summary report, custom taxonomic databases weren't properly reported (NA).
Additionally moved a code snippet from
ampliseq.nf
to a subworkflow, a purely cosmetic change.PR checklist
nf-core lint
).nextflow run . -profile test,docker --outdir <OUTDIR>
).docs/usage.md
is updated.docs/output.md
is updated.CHANGELOG.md
is updated.README.md
is updated (including new tool citations and authors/contributors).