Hello everyone,
I'm doing Feature plots for a specific gene, and in the same cluster I have cells that express and does that doesn't express this specific gene. Is there a way to bring the positive cells to the front? I can see that some cells express the gene but the dot is behind other negative ones.
Thank you
Hi @EDYAC,
You can check this function I had shared a while ago (issue #235). You should use the customize_Seurat_FeaturePlot() function. Simply run it on your R session before executing the following code:
# Set do.return = TRUE to return ggplot2 object
p <- FeaturePlot(object = object, features.plot = "Actb", do.return = TRUE)
# Customize plot by bringing cells with higher expression levels to the front
customize_Seurat_FeaturePlot(p = p, expression.threshold = 0)
Best,
Leon
Thank you Leon
Hi, sorry to wade in on this question.
@leonfodoulian, is it possible to tweak the code you wrote for issue #235, so that it will work with brewer.pal for a continuous colour scale using the gradient.use argument?
Thanks,
Hi @smithsl,
Yes. Simply give the colour gradient of your choice as input for the gradient.use argument, as follows:
# Set do.return = TRUE to return ggplot2 object
p <- FeaturePlot(object = object,
features.plot = "Actb",
do.return = TRUE)
# Customize plot by bringing cells with higher expression levels to the front
customize_Seurat_FeaturePlot(p = p,
expression.threshold = 0,
gradient.use = RColorBrewer::brewer.pal(n = 10,
name = "RdYlBu"))
Best,
Leon
Thank-you!
Here is an alternative solution, explained here:
https://github.com/satijalab/seurat/issues/235#issuecomment-454937420
Does anyone know how to do this with the new Seurat V3?
I would like to second tmccra2's question. How do we execute this function in Seurat V3?
In Seurat v3, FeaturePlot now has baked in tools for ordering and filtering:
order = FALSE (default) set as TRUE will plot higher values on top of lower values.. doing the ordering for you.
min.cutoff = NA (default), set as a number to remove cells below a certain expression level.
max.cutoff = NA (default), set as a number to remove cells above a certain expression level.
The only thing it doesn't implement now is ALPHA. Which would be awesome.