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

Update pipeline summary report #644

Merged
merged 8 commits into from
Oct 13, 2023
Merged

Conversation

d4straub
Copy link
Collaborator

@d4straub d4straub commented Oct 12, 2023

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

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/ampliseq branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@github-actions
Copy link

github-actions bot commented Oct 12, 2023

nf-core lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 6bfc861

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

❗ Test warnings:

  • readme - README did not have a Nextflow minimum version badge.
  • schema_lint - Parameter input is not defined in the correct subschema (input_output_options)

❔ Tests ignored:

✅ Tests passed:

Run details

  • nf-core/tools version 2.10
  • Run at 2023-10-13 09:15:17

Copy link
Member

@erikrikarddaniel erikrikarddaniel left a 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) ) {
Copy link
Member

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.)

Copy link
Collaborator Author

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?

Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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 ;)

Copy link
Member

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.

Copy link
Collaborator Author

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>
@d4straub d4straub merged commit a4f6339 into nf-core:dev Oct 13, 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.

2 participants