Seurat: change colors of tSNE while using cells.highlight in DimPlot

Created on 18 Apr 2018  路  1Comment  路  Source: satijalab/seurat

Hi,

I upgraded my Seurat version to 2.3.0 and I was trying out the cells.highlight param added to DimPlot. Its a very simple tSNE plot.

cells=rownames([email protected])[1:200]
TSNEPlot(object = scrna,pt.size = 2.5,cells.highlight=cells,cols.use=c("red","lightgray"))

It works great. But is there some way to change the color ? I tried cols.use parameter and I am getting this error

Error in DimPlot(object = object, reduction.use = "tsne", cells.use = cells.use,  : 
  formal argument "cols.use" matched by multiple actual arguments

Also, is there a way to highlight the cells in Featureplot in case you want to look at cells that fall within a UMI range that might not very easily distinguishable with the color gradient ?

Analysis Question

Most helpful comment

Hi Aproova,

For the TSNEPlot error, pass the colors you want as colors.use, not cols.use

data('pbmc_small')
cols <- sample(x = colors(), size = length(x = unique(x = pbmc_small@ident)))
TSNEPlot(object = pbmc_small, colors.use = cols)

For the FeaturePlot question, you can't do that directly within FeaturePlot. However, if you want to see only cells that fall within a certain range for nUMI, you can achieve this by getting the cells that fall within the range of UMI counts that you desire and highlighting said cells with DimPlot

data('pbmc_small')
cells.use <- [email protected][which(x = [email protected]$nUMI > 200 & [email protected]$nUMI < 300)]
DimPlot(object = pbmc_small, reduction.use = 'tsne', cells.highlight = cells.use)

>All comments

Hi Aproova,

For the TSNEPlot error, pass the colors you want as colors.use, not cols.use

data('pbmc_small')
cols <- sample(x = colors(), size = length(x = unique(x = pbmc_small@ident)))
TSNEPlot(object = pbmc_small, colors.use = cols)

For the FeaturePlot question, you can't do that directly within FeaturePlot. However, if you want to see only cells that fall within a certain range for nUMI, you can achieve this by getting the cells that fall within the range of UMI counts that you desire and highlighting said cells with DimPlot

data('pbmc_small')
cells.use <- [email protected][which(x = [email protected]$nUMI > 200 & [email protected]$nUMI < 300)]
DimPlot(object = pbmc_small, reduction.use = 'tsne', cells.highlight = cells.use)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

htc502 picture htc502  路  3Comments

tmccra2 picture tmccra2  路  3Comments

kysbbubbu picture kysbbubbu  路  3Comments

sarahwajid picture sarahwajid  路  3Comments

RuiyangLiu94 picture RuiyangLiu94  路  3Comments