3
$\begingroup$

I saw in the extensive Seurat documentation for Dimplot (dimensional reduction plot), here, you can plot a gene by specifying it with group.by = "gene" but this does not work in practice.

> p <- DimPlot(DG.combined, reduction = "umap", group.by = "Fos")
Error: Cannot find 'Fos' in this Seurat object
> p <- DimPlot(DG.combined, reduction = "umap", group.by = "Inhba")
Error: Cannot find 'Inhba' in this Seurat object

Am I mistaken? Do I need to add a metadata column containing expression of the gene? How can I access individual cells gene expression data in seurat so I can create a metadata label based on binned expression levels? Also how would I tell seurat to use a color gradient to label them?

References https://satijalab.org/seurat/reference/dimplot

$\endgroup$

2 Answers 2

2
$\begingroup$

As @swbarnes2 has suggested, you can plot gene expression over the top of a dimensional reduction using the FeaturePlot function, using the features parameter for gene names:

p <- FeaturePlot(DG.combined, reduction = "umap", features = c("Fos", "Inhba"))

See the 3k tutorial here:

https://satijalab.org/seurat/articles/pbmc3k_tutorial.html#cb49

$\endgroup$
2
$\begingroup$

I am not totally sure what you are trying to do, but I think you want FeaturePlot, not DimPlot

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.