-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fixing levels of grouping variables when splitting DimPlots #37
Comments
Hi Niko, no worries! Just to clarify does this also occur with Seurat::DimPlot or just when using DimPlot_scCustom? Thanks, |
Happens in Seurat as well :(
…On Fri 13. May 2022 at 12:22, Samuel Marsh ***@***.***> wrote:
Hi Niko,
no worries! Just to clarify does this also occur with Seurat::DimPlot or
just when using DimPlot_scCustom?
Thanks,
Sam
—
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGIDXV3ZKRNUS7LWHZKCSZTVJYUNDANCNFSM5V2T6IOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ok let me take look at DimPlot code in Seurat and see if there is fix. Not remembering how the split is implemented there but I feel like this should be addressable. |
Ok so I've done little testing and think Seurat is actually handling it ok but scCustomize has issue. Let me provide example to make sure what I'm testing is the same issue that you are describing. So for this example using object from my recent paper. It has 2 conditions under meta.data Transcription, 2 conditions under meta.data method and a combined variable called Transcription_Method with 4 variables. All 4 conidtions in Transcription Method contribute to all of the clusters.
Now I identify cells in one cluster to remove from only 2 of the conditions and then subset the object:
Now I plot DimPlot by Transcription Method to confirm cells are missing from 2 of the groups and then show that colors are retained across all clusters despite a missing level in 2 of the plots:
However, the error is present in scCustomize::DimPlot_scCustom:
It makes sense actually given the way I wrote the function because to avoid the shared y-axis that Seurat uses. I will work on scCustomize fix but looks like Seurat works ok if I'm understanding the issue correctly. If your issue is different from what I'm describing please let me know. Done with Seurat 4.1.0 and SeuratObject 4.0.4 Best, |
Yes, exactly the problem I was describing. And sorry, you were right Seurat handles this fine. Thanks so much already :) |
Ok ya no worries. I will work on fix for DimPlot_scCustom. I think it should be relatively easy by just creating additional variable that subsets the color list per plot being created. Best, |
ok so that solution did work (ish) but there is far easier one just setting manual scale using named vector. Should be fixed now in the develop branch v0.7.0.9912. If bug still occurs for you with this update let me know and I'll reopen the issue. Best, |
Hey,
sorry for already another feature request, but here it comes: When splitting DimPlots using
split.by
the number of levels of the grouping variable forgroup.by
gets reduced to only the levels that are actually in the cells being plotted in every split. This is very distracting for example when u split a clustering result over many subplots and the colors for the clusters change in every subplot due to some of the clusters being specific for one of the covariates split by.Thanks a lot,
Niko
The text was updated successfully, but these errors were encountered: