Plotting a scatterplot in R of a gene against 2 different conditions

85 Views Asked by At

I have a seurat object and want to compare the expression level of X gene between cancer fibroblast and normal fibroblast as well? E.g., a scatter plot with x = gene vs y = gene in a specfic cell-type

I know you can plot a scatterplot within Seurat using this command:

FeatureScatter(cells4, feature1 = "gene1", feature2 = "gene2")
1

There are 1 best solutions below

0
Cloudberry On

A scatterplot consists of (x,y) pairs of values, and the points must represent something. When single cell data is presented with scatterplots, each dot is usually a cell, as in the plot produced by FeatureScatter(). For comparing two groups of cells, Seurat has other plotting functions, like VlnPlot().

VlnPlot(cells4, features = "GLI2")

If you have more clusters in the data besides the ones you want to plot, you can first subset them in the same object.

fibr_subset <- subset(cells4, idents = c("Normal Fibr","CAFs"))

Take a look at the Seurat visualization vignette for more examples on how to plot data.