[WIP] Helper function to remove batch effects#280
Draft
hertafeldsr wants to merge 10 commits intov1.6rcfrom
Draft
[WIP] Helper function to remove batch effects#280hertafeldsr wants to merge 10 commits intov1.6rcfrom
hertafeldsr wants to merge 10 commits intov1.6rcfrom
Conversation
daler
reviewed
May 9, 2020
Contributor
daler
left a comment
There was a problem hiding this comment.
Thanks -- small review comments below
| beta <- fit$coefficients[,-(1:ncol(design)),drop=FALSE] | ||
| beta[is.na(beta)] <- 0 | ||
| as.matrix(x) - beta %*% t(X.batch) | ||
| } |
Contributor
There was a problem hiding this comment.
I think this would benefit from a small test -- we wouldn't need to mock up a bunch of RNA-seq data for this, we could just use a small matrix.
And maybe as a temporary test you could copy the function over to a real-world RNA-seq analysis and give it a shot there -- no need to wait for a merge for that.
Contributor
|
@hertafeldsr in 6095688 I added a test Rmd you can use for trying out the function. We may need to find another Bioconductor package with a more complex design in order to test multiple batches. |
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.
This is for issue #255 . I refactored the code from this function: https://rdrr.io/bioc/limma/src/R/removeBatchEffect.R to be able to accept an arbitrary number of factors. I haven't tested it much yet so I'll have to wait to merge until that's done.