This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to visualize co-expression of several genes simultaneously in Featureplot (scRNA-seq) in one figure?

Dear all, I am analysis the 10X genomics scRNA-seq data nowadays, and the problem i met was i want to know a set of gene distribution along all the clusters. As i know the Featureplot support one gene or two gene, how can i plot a list of genes?

typical code as follows:

FeaturePlot(object = pbmc, features.plot = c("MS4A1", cols.use = c("grey", "blue"), reduction.use = "tsne")
seurat scrna featureplot

Try grid package.

thanks, cpad, but can you mention a little bit more details, i web the grid package, and it seems like work on the picture layout

sorry..it was gridextra, not grid. Btw, did you go through the visualization examples provided by seurat devs? https://satijalab.org/seurat/visualization_vignette.html. They provided an example of list with 7 genes.

esp

features.plot <- c("LYZ", "CCL5", "IL32", "PTPRCAP", "FCGR3A", "PF4")
FeaturePlot(object = pbmc, features.plot = features.plot, cols.use = c("lightgrey", 
    "blue"))

many thanks, but that's not what i mean, i wanna one scatter plot which contain all the gene expression i want simultaneously, not split into many figure,and each figure shows the expression of single gene.

1 answer

Hi, if you don't mind visualizing all the markers without being able to differentiate each of them, you can simply use this:

markers <- c("MS4A1", "GNLY", "CD3E", "CD14", "FCER1A", "FCGR3A", "LYZ", "PPBP", "CD8A")
markers_percent <- Matrix::colSums(pbmc_small@raw.data[markers, ])/Matrix::colSums(pbmc_small@raw.data)
pbmc_small <- AddMetaData(object = pbmc_small, metadata = markers_percent , col.name = "markers_percent")
FeaturePlot(object = pbmc_small, features.plot = "markers_percent", cols.use = c("grey", "blue"), reduction.use = "tsne", no.legend = F)

@biologo, this is the optimal solution. If you plot all the markers with individual colors, then the color will mix up if the same cell expresses multiple markers and the visualization won't be that straightforward.

Log in to answer this question.