<p>Is it possible to create a Heatmap in Seurat that takes in and displays modules of genes as its features rather than individual genes?  So if I have a module of genes associated with a trait or phenotype I can compare the expression of that module across clusters against the expression of other modules of genes.  </p>

<p>Currently the way that I am trying to do it is similar to the code below (In this example I am only using one module to test if it works):</p>

<pre><code>Module_28 &lt;- readLines(con = "Path_to_file/module28.txt")
Module_28 &lt;- list(Module_28)
Combined &lt;- AddModuleScore(Combined, features = Module_28, ctrl = 5, name = 'Module_28')
names(x = Combined[[]])
avg &lt;- AverageExpression(Combined, features = NULL, add.ident = NULL, return.seurat = TRUE, verbose = TRUE)
DoHeatmap(avg, features = c("Module_281"), group.by = "ident", size = 3, angle = 0, draw.lines = FALSE) + theme(axis.text.x = element_text(size = 7, angle = 45), axis.line = element_line(color = "#ffffff")) + scale_fill_gradient2(low = '#1000ff', mid = "#ffffff", hight = '#aa0101', space = "Lab", na.value = "#ffffff", midpoint = 0, guide = "colourbar", aesthetics = "fill") + coord_flip(expand = TRUE, clip = "on")
</code></pre>

<p>Often When I try to run the DoHeatmap function I get the following error:</p>

<pre><code>Error in DoHeatmap(avg, features = c("Module_281"), group.by = "ident",  : 
  No requested features found in the scale.data slot for the RNA assay.
</code></pre>

CC BY-SA 4.0
2019-09-23T13:24:08.923Z
What's wrong with your current approach?
Jared Andrews
CC BY-SA 4.0
2019-10-03T21:39:43.383Z
I get an error that I'll add to my post above so you can see it.
Rycon
CC BY-SA 4.0
2019-10-03T22:10:04.600Z
Did you scale your data at some point?
haci
CC BY-SA 4.0
2019-10-08T20:45:10.847Z
@haci yes I did scale the data, with the ScaleData() function.
Rycon
<r><seurat><gene-expression><heatmap>
Create a Heatmap that uses modules of genes rather than individual genes in Seurat
# Create a Heatmap that uses modules of genes rather than individual genes in Seurat

(Asked by: username_0 on 2019-09-20)

Is it possible to create a Heatmap in Seurat that takes in and displays modules of genes as its features rather than individual genes?  So if I have a module of genes associated with a trait or phenotype I can compare the expression of that module across clusters against the expression of other modules of genes.  
Currently the way that I am trying to do it is similar to the code below (In this example I am only using one module to test if it works):
Module_28 <- readLines(con = "Path_to_file/module28.txt")
Module_28 <- list(Module_28)
Combined <- AddModuleScore(Combined, features = Module_28, ctrl = 5, name = 'Module_28')
names(x = Combined[[]])
avg <- AverageExpression(Combined, features = NULL, add.ident = NULL, return.seurat = TRUE, verbose = TRUE)
DoHeatmap(avg, features = c("Module_281"), group.by = "ident", size = 3, angle = 0, draw.lines = FALSE) + theme(axis.text.x = element_text(size = 7, angle = 45), axis.line = element_line(color = "#ffffff")) + scale_fill_gradient2(low = '#1000ff', mid = "#ffffff", hight = '#aa0101', space = "Lab", na.value = "#ffffff", midpoint = 0, guide = "colourbar", aesthetics = "fill") + coord_flip(expand = TRUE, clip = "on")

Often When I try to run the DoHeatmap function I get the following error:
Error in DoHeatmap(avg, features = c("Module_281"), group.by = "ident",  : 
  No requested features found in the scale.data slot for the RNA assay.

**Tags:** r, seurat, gene-expression, heatmap
> **Comments:**
> **username_1**: What's wrong with your current approach?  
> **username_0**: I get an error that I'll add to my post above so you can see it.  
> **username_2**: Did you scale your data at some point?  
> **username_0**: @haci yes I did scale the data, with the ScaleData() function.  

---

## 0 answers

