Simplify dream contrast handling#11584
Open
grst wants to merge 4 commits into
Open
Conversation
grst
commented
May 11, 2026
| } | ||
|
|
||
| # Use makeContrasts if contrast_string exists | ||
| if (is_valid_string(contrast_string)) { |
Member
Author
There was a problem hiding this comment.
@delfiterradas would I need this check, too? I.e. is there a valid usecase to call this module without contrast, e.g. for normalization only?
Is there any way this could have been false, als both branches of the previous if set a contrast_string?
Contributor
There was a problem hiding this comment.
You are right, that check was redundant!
Member
Author
|
@delfiterradas et al. could you please take that over and make sure the change trickles down into differentialabundance? |
Member
Author
|
pre-commit failure is unrelated (API rate limit) |
Co-authored-by: Delfina Terradas <155591053+delfiterradas@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was running into an error in the repeated call of eBayes after fit.contrasts.
It turns out that according to the dream vignette the recommended way of setting contrasts it to directly pass it to the
dream()call viaL=.Using
nobars() + design()before calling dream, we can construct the contrast vector beforehand also avoiding the manipulation of matrix dimnames after the dream call.In summary, I think this version is cleaner, more computationally efficient, and solves the specific error I had.
PR checklist
Closes #XXX
topic: versions- See version_topicslabelnf-core modules test <MODULE> --profile dockernf-core modules test <MODULE> --profile singularitynf-core modules test <MODULE> --profile condanf-core subworkflows test <SUBWORKFLOW> --profile dockernf-core subworkflows test <SUBWORKFLOW> --profile singularitynf-core subworkflows test <SUBWORKFLOW> --profile conda