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

Exclude rows with no variance from batch adjustment #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

khughitt
Copy link

Currently ComBat fails when the input data matrix contains rows with no variance. There is likely a better solution for dealing with this, but for now at least, stopping execution with an informative error message may be useful.

@wevanjohnson
Copy link
Contributor

This is a useful contribution. I will check it out!

The other related concern is if the variance is zero within a single batch for any gene, ComBat will also fail. So the complete check will need to be at this level as well. However, one alternative though: instead of throwing an error, another more useful approach would be to just remove these rows, note this to the user, do batch correction, and then put the zero variance genes back in.

On May 28, 2016, at 6:19 AM, Keith Hughitt [email protected] wrote:

Currently ComBat fails when the input data matrix contains rows with no variance. There is likely a better solution for dealing with this, but for now at least, stopping execution with an informative error message may be useful.

You can view, comment on, or merge this pull request online at:

#13 #13
Commit Summary

Added check for rows in input dat with no variance
File Changes

M R/ComBat.R https://github.com/jtleek/sva-devel/pull/13/files#diff-0 (4)
Patch Links:

https://github.com/jtleek/sva-devel/pull/13.patch https://github.com/jtleek/sva-devel/pull/13.patch
https://github.com/jtleek/sva-devel/pull/13.diff https://github.com/jtleek/sva-devel/pull/13.diff

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #13, or mute the thread https://github.com/notifications/unsubscribe/AJgbPHUqI7DIHplbmrwq4ebWu8LOwidYks5qGDLLgaJpZM4IpEE8.

@khughitt
Copy link
Author

Good suggestion - I've also encountered the issue with zero-variance within batches in the past. It seems like more recent versions of ComBat are able to handle those scenarios a bit better - for example, ComBat will now still run even if one of the batches contains only a single replicate.

I like the idea of ignoring the adjustment for zero-var genes and adding them back in afterwards. This way the shape of the data isn't changed (no hard filtering), and as long as there aren't too many such genes, the results should still be useful.

@khughitt
Copy link
Author

Updated PR per your suggestion. It doesn't attempt to deal with within-batch uniformity, but will at least leave out genes with no variance across all samples during batch adjustment.

@khughitt khughitt changed the title Added check for rows in input dat with no variance Exclude rows with no variance from batch adjustment May 30, 2016
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