Cannot color cells with 0 expression in certain color
Entering edit mode
7 weeks ago
leranwangcs ▴ 40

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"), = "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 • 114 views
Entering edit mode

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


Login before adding your answer.

Traffic: 1834 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6