Question: Plotting heatmap of Marker genes in each celltypes in Seurat
0
gravatar for David_emir
6 weeks ago by
David_emir370
India
David_emir370 wrote:

Hi,

I am working on single-cell data, I have identified cell types in each cluster by using marker genes expression using Seurat. I want to Plot a Heatmap which shows gene scores for the marker genes (rows) in each expression module identified by clustering. Example figure is as follows. Please let me know how best i can plot this type of image using Seurat or any other pipeline.

Thanks a lot for your kind help,

Regards, Dave

HeatMap for marker genes in each cell type

ADD COMMENTlink modified 6 weeks ago by jared.andrews076.9k • written 6 weeks ago by David_emir370

Seurat has a function DoHeatmap that will make a heatmap based on the given features and clusters.

ADD REPLYlink written 6 weeks ago by rpolicastro1.7k

Thanks a lot for such a fast reply, I tried with DoHeatmap, but i couldn't add Tissue/Donor/Sample Info to the Heatmap. I couldn't produce heatmap wth all the cell type markers, my graph will become very cluttery and it's difficult to read.

ADD REPLYlink written 6 weeks ago by David_emir370

If you want to add extra information like tissue and donor, you'll need to extract the metadata and UMI counts from the seurat object, and then construct the heatmap using the ComplexHeatmap library. You can get the counts using the GetAssayData function, and the metadata can be accessed with two opened and closed square brackets seurat_object[[]].

ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by rpolicastro1.7k

Can you please share any script for this, i am a biologist, my hold on R is very Limited.

ADD REPLYlink written 6 weeks ago by David_emir370
1

ComplexHeatmap has a long but detailed vignette that you can go through.

Your can prepare your count matrix with this code. Put the genes you want to include the the genes vector.

library("Seurat")

counts <- GetAssyData(seurat_obj, assay="RNA", slot="data")
genes <- c(...)
counts <- as.matrix(counts[rownames(counts) %in% genes, ])

You can then prepare your metadata using this code.

metadata <- seurat_obj[[]]
metadata <- metadata[rownames(metadata) %in% colnames(counts), ]

These can then be used as input to ComplexHeatmap.

ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by rpolicastro1.7k

Thanks a lot for your kind help, i am trying this code.

ADD REPLYlink written 5 weeks ago by David_emir370
2
gravatar for jared.andrews07
6 weeks ago by
jared.andrews076.9k
Memphis, TN
jared.andrews076.9k wrote:

This can be done very simply with the dittoHeatmap command from dittoSeq. It will allow you to add any other annotations you'd like very simply via the annot.by parameter. It will work on your default Seurat object with no changes or conversions.

ADD COMMENTlink written 6 weeks ago by jared.andrews076.9k

That's a really handy wrapper for pheatmap, thanks for sharing!

ADD REPLYlink written 6 weeks ago by rpolicastro1.7k

Thanks. We will probably change the underlying code to utilize ComplexHeatmap eventually, as it's an easy switch and will allow us to use some of the rasterization features that will really help reduce the plot file size and make plots easier to edit in Illustrator, etc.

ADD REPLYlink written 5 weeks ago by jared.andrews076.9k
1

I find that the scRNA-seq dim plots will sometimes melt illustrator as well. I found a handy library, ggraster, that will let you rasterize the points but keep the labels and such as vectors. I figured I would pass this along in case you haven't seen it.

ADD REPLYlink written 5 weeks ago by rpolicastro1.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1117 users visited in the last hour