r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
300 stars 125 forks source link

Colors of plots #122

Closed kallaway14 closed 4 years ago

kallaway14 commented 4 years ago

Hi, This is pretty trivial but is there a way to choose what colors are used for the points when plotting tSNEs or UMAPs? I'd like to change them so that clusters corresponding to certain cell types match the colors we use for those cell types in other figures but not sure how to do so. Thanks!

ccruizm commented 4 years ago

Hello @r3fang

I have the same question. Your tool is great! I have been playing around to change the color of the plots but haven't succeeded. Any updates about @kallaway14 question?

Thanks in advance!

TheSallyGardens commented 4 years ago

Hello @r3fang I have the same question. Your tool is great!

Thanks in advance!

suragnair commented 4 years ago

The colours seem to be hardcoded here

https://github.com/r3fang/SnapATAC/blob/c3ab177558f0fe9c47cbd68969df7b06de5b07d9/R/plottings-utilities.R#L28

An alternative is to use ggplot which is simple and will give you more control:

df = data.frame(x.sp@umap, x.sp@sample)

ggplot(df) +
geom_point(size=0.1, alpha=1, aes(x=umap.1 , y=umap.2, col=x.sp.sample))
kallaway14 commented 4 years ago

Yes, I came to the same solution of simply using ggplot instead and it works very well!