How to handle duplicate genes in DoHeatmap() for top DEGs across clusters (seurat single cell)
0
0
Entering edit mode
2 hours ago
Picasa ▴ 650

Hi,

I would like to create a heatmap of the top 20 DEGs for each of my 5 clusters. However, there are duplicates among these 100 genes, and the DoHeatmap() function only plots unique genes.

I have a Seurat v5 object.

Is there a solution to this issue?

seurat • 87 views
ADD COMMENT
0
Entering edit mode

Why are there duplicates? What do you mean? Add code and plots to illustrate a problem.

ADD REPLY
0
Entering edit mode

Example:

cluster1 <- c("A", "B", "C", "D")
cluster2 <- c("A", "E", "F", "G")
...
cluster5 <- c("B", "H", "I", "J")

marker_all <- c(cluster1, cluster2, ..., cluster5)

For instance the gene A is expressed in cluster1 and cluster2 but after doing:

seurat <- ScaleData(seurat, features = marker_all, assay = "RNA")

Only one A is retained for the heatmap:

DoHeatmap(subset(seurat, downsample = 1500), features = marker_all), 
          group.by = "Cluster_name")

I would like both A to be retained.

ADD REPLY
0
Entering edit mode

I bet you ran FindAllMarkers on your dataset and ended up with the same genes found as DE in multiple clusters

ADD REPLY
0
Entering edit mode

Yes, right

ADD REPLY
0
Entering edit mode

Finding DEGs is not a finality, what do you want to show on the heatmap ? Expression of these genes in each cluster I presume. Then, calculate the expression of each gene in each cluster to plot a heatmap of gene expression.

What you get in the output of FindAllMarkers is a logFC between one cluster to the rest of the cells, indeed some genes can be makers in different clusters. But you cannot plot the output of FindAllMarkers as it is on an heatmap

ADD REPLY

Login before adding your answer.

Traffic: 2084 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6