-
Notifications
You must be signed in to change notification settings - Fork 33
Add droplevels for meta.data in UpdateSeuratObject
#247
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
Conversation
5f1187e to
6896340
Compare
dcollins15
left a comment
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.
Thanks @samuel-marsh, this LGTM 🚀
I chose to add directly to UpdateSeuratObject though it could also be incorporated into droplevels.Seurat though that adds/changes functionality of that function so didn't do that for now in case that's not desired.
It's definitely odd that droplevels.Seurat only updates the object's Idents, but I agree that this would be a pretty significant change to that method's functionality.
The other place I think this could be helpful would be in subset.Seurat so that factor levels in meta.data are updated based on remaining values. I held off on that for now because wasn't sure that functionality was desired though if team thinks it would be good there too I'm happy to add second commit.
I'm on a bit of a tare ATM so I'll probably push these changes up in a follow-up PR shortly.
|
I think #251 should be reverted. This behavior is in striking contrast to the rest of the R world, e.g. If dropping unused levels for all factors in I also don't understand the motivation for adding this to I suggest you instead implement the |
|
@jan-glx I appreciate you taking the time to bring this to the team's attention (this change was introduced before I joined). I do agree with you that dropping unused levels is not behavior to expect by default when subsetting or updating an object, and rather should be a decision left to the user, which has been suggested in previous issues. I'm leaning towards reverting the change; however, it may take some time to see it updated here since we have some items higher on the priority list. Thanks! |
|
I have submitted PR #262 to revert #251 - that is the addition of #247 - that is the addition of Implementing the suggested change in In the meantime I am using below monkey-patch to avoid issues caused by #251 but downgrading and waiting is likely a better option. |
|
Hi All, The motivation was to provide quick way (within safety of another Seurat functions) to drop levels of factors in meta.data slot that were no longer relevant (as can happen after subset). I chose Best, |
Hi Seurat Team,
Quick PR here. Just adds
droplevelstoUpdateSeuratObject. I chose to add directly toUpdateSeuratObjectthough it could also be incorporated intodroplevels.Seuratthough that adds/changes functionality of that function so didn't do that for now in case that's not desired.The other place I think this could be helpful would be in
subset.Seuratso that factor levels in meta.data are updated based on remaining values. I held off on that for now because wasn't sure that functionality was desired though if team thinks it would be good there too I'm happy to add second commit.Thanks again for all you do maintaining the package!
Best,
Sam