Cannot color cells with 0 expression in certain color
1
0
Entering edit mode
3.6 years ago
leranwangcs ▴ 150

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 • 2.0k views
ADD COMMENT
0
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

ADD REPLY
0
Entering edit mode
2.2 years ago
shuaizh117 ▴ 10

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

ADD COMMENT

Login before adding your answer.

Traffic: 2604 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6