This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Cannot color cells with 0 expression in certain color

I'm trying to use FeaturePlot() function, but when there is a gene has 0 existence in all cells (the right most one), that plot was colored to a dark scale which I expected it to be all gray.

tsne plot

My command is:

feature.plot <- FeaturePlot(combined.all, features = c("Ifnlr1","Ifnl2","Ifnl3","Stat1","Isg15","Murine-astrovirus-STL1","Murine-astrovirus-STL5"), split.by = "modified.ident", cols = c( "gray","red"),reduction = "tsne")

I saw similar questions and one answer was to modify the cols = c( "gray","red") parameter to cols = c( "gray","gray"), however in that case other plots would not be able to correctly colored.

Is there anyway that I can have the figures combined and also have the correct colors for any scenarios?

Also, I cannot get the legend show up when I use combine = TRUE parameter, is there anyway that I could have a legend show in the combined plot?

Thanks so much! Leran

seurat scrna

There may be some way to change Rs default rounding behavior. My guess would be ggplot generates quantiles corresponding to colors and then applies some variant of "less than/greater than" which is rounded up. There may be some way to adjust that to round down instead, but I'm not aware of it

1 answer

FeaturePlot(..., keep.scale = "all")

Log in to answer this question.