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

Suggestion: jitter & shuffle defaults FeatureScatter #5876

Merged
merged 3 commits into from
Apr 25, 2022

Conversation

samuel-marsh
Copy link
Collaborator

Hi Seurat Team,

Just wanted to pop in potential suggestion for change in defaults on FeatureScatter based on recent issue #5875 where the jitter default can give false impression of data. In looking at this I started wondering whether changing the default behavior from jitter = TRUE and shuffle = FALSE might actually be more informative for the user. I'll describe my rationale and leave examples below and then leave it to your team. As I say just potential suggestion and I likely do not have the full rationale for the design choices so feel free to reject the PR.

In most cases on truly crowded plot the jitter being applied doesn't (at least to my eye) significantly alter the visualization. However, setting shuffle = TRUE does significantly alter things by reducing identity layering effects which can mask cell/identity location. I do concede that the interpretability of the shuffled plot is also difficult due to sheer number of points but overall I think the effect is better than shuffle = FALSE.

Using the SeuratData hcabm40K as moderately (compared to 100K+ cells at least) crowded dataset. I also cropped axes of plots below to increase resolution to see an effect of these parameters as raw dataset has some outliers.

Thanks again for everything you do!

Best,
Sam

library(tidyverse)
library(Seurat)
library(scCustomize)
library(patchwork)

hcabm40k <- hcabm40k.SeuratData::hcabm40k

hcabm40k <- Add_Mito_Ribo_Seurat(seurat_object = hcabm40k, species = "human")

p1 <- FeatureScatter(object = hcabm40k, cols = DiscretePalette(palette = "polychrome", n = 36), feature1 = "nCount_RNA", feature2 = "percent_mito", pt.size = 0.75, jitter = T) + NoLegend() + xlim(0, 75000) + ylim(0, 10)

p2 <- FeatureScatter(object = hcabm40k, cols = DiscretePalette(palette = "polychrome", n = 36), feature1 = "nCount_RNA", feature2 = "percent_mito", pt.size = 0.75, jitter = F) + NoLegend() + xlim(0, 75000) + ylim(0, 10)

wrap_plots(p1, p2)

image

p3 <- FeatureScatter(object = hcabm40k, cols = DiscretePalette(palette = "polychrome", n = 36), feature1 = "nCount_RNA", feature2 = "percent_mito", pt.size = 0.75, shuffle = F) + NoLegend() + xlim(0, 75000) + ylim(0, 10)

p4 <- FeatureScatter(object = hcabm40k, cols = DiscretePalette(palette = "polychrome", n = 36), feature1 = "nCount_RNA", feature2 = "percent_mito", pt.size = 0.75, shuffle = T) + NoLegend() + xlim(0, 75000) + ylim(0, 10)

wrap_plots(p3, p4)

image

Copy link
Member

@mojaveazure mojaveazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sam,

Thanks for the PR! We like setting jitter = FALSE by default, but we think we should keep shuffle = FALSE by default as well. Can you make that change? Then, we can get this merged in

@samuel-marsh
Copy link
Collaborator Author

Absolutely sounds good! Will update and push Monday AM.

Best,
Sam

@samuel-marsh
Copy link
Collaborator Author

Hi @mojaveazure

Just updated the PR switching shuffle to FALSE as well.

Best,
Sam

@saketkc saketkc merged commit 9646a73 into satijalab:develop Apr 25, 2022
@saketkc
Copy link
Collaborator

saketkc commented Apr 25, 2022

Thanks @samuel-marsh!

@samuel-marsh
Copy link
Collaborator Author

No problem! Thank you guys too!

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.

3 participants