-
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
Adding Alpha/Transparency to FeaturePlot #21
Comments
Hi Julia, Thanks so much and so glad you are enjoying the package!! I think in this case the easiest thing might be if I test whether a potential PR to Seurat would work and the devs would be open to it. Since While not perfect solution using the Nebulosa-based plotting features I've included could help overcome some of this issue of potential masking. https://samuel-marsh.github.io/scCustomize/articles/Gene_Expression_Plotting.html#density-plots. Best, |
Thanks for looking into this, I understand that it would be easiest to implement this in the original Seurat option. The last I've found in their github was an issue from 2019 addressing this which resulted in the order option but no alpha add-on. I think on larger datasets this could massively improve the visualization, so any update that you see would be easy to implement would be amazing! I am playing around with the Nebulosa-based feature as you have described in your vignette and agree that this could be an interesting option! Just for my understanding, what would the "density" refer to? I have some genes that would be above 1 (1.5 eg), so its probably not referring to density = % of gene expression in the area compared to max expression? Also, it seems that splitting into samples isn't possible in the provided function, and in the original version might result in the density of ALL samples being overlayed on top of each facet instead of being calculated for each column specifically, which would raise the same issue as the featureplot without alpha? Either way, just wanted to thank you again for your input into this and am looking forward to any potential updates or ideas you might have :) |
Ya I'll keep looking into it. And just to confirm as well what you are describing is only changing the transparency of the expressing points not the points below the In terms of Nebulosa, no it's a density metric you can see Nebulosa paper here for more info: In terms of splitting you are right currently that isn't supported by Nebulosa and yes you are right there I forgot about the splitting issue. I looked into it when I created the function and it would require Nebulosa to add that feature so that kernel density was calculated independently for each sample (currently just calculates across all cells). Best, |
I think one could argue for both ways that the non-expressing cells should be either transparent (then it would be easier to assess how many cells generally are in each cluster etc) or non-transparent (then the expression of the expression cells will be highlighted more), so imho either way would benefit the visualization! I don't know if one would be easier to implement over the other, or if someone else has a strong opinion for one or the other, but for my specific case both would work well. Thanks again, best, |
Ya it's definitely tricky. FeaturePlot may not be best implementation either because especially with UMAP dim reduction it;s extremely common for the density of points to be really high so when dealing with large datasets it's quite tricky. I'm currently working on adding this type of plot as addition column annotation on Best, |
Hey Julia, So I've just implemented a solution to control one or both of the alpha values for the expressing and non-expressing points. The new parameters are Best, |
Hey Samuel, thank you so much for putting together this tool, I am exploring it at the moment and am already super happy with it!
As you noted in the vignette, the FeaturePlot from Seurat makes it sometwhat difficult to interpret the gene expression in a way as the non-expressing cells are sometimes plotted on top of the expressing cells, your solution to by default order them imho makes a lot of sense! However, in this case, you might also be over-emphasizing certain areas in the case that there are more non-expressing cells but the few expressing cells are placed on top?
For this reason, I was wondering if it would be possible to implement the alpha parameter to the function, as it would allow to "see through" the expressors and would additionally highlight areas of high expression.
I have searched this in the Seurat github aswell and it doesn't seem that they are implementing it, but I found this code snippet that makes it somewhat work: plot$layers[[1]]$aes_params$alpha <- 0.6 (my main issue is that this will only affect the last column if split by sample e.g.)
Thanks again for all the work you put into this and for sharing it!
Best, Julia
The text was updated successfully, but these errors were encountered: