heat map code not working
1
0
Entering edit mode
8 weeks ago
Patricia • 0

hii everyone,

I am trying to create a heatMAP from my RNAseq data but it seems that this code is using ALL of the genes, so I get a heat map that is pretty much impossible to read. Is there a way to filter and only use for example the significant values? Or even select which genes I want to include in the heat map?

library(DESeq2)
library(ggplot2)
library(ComplexHeatmap)

sigs2h <- read.csv("deseq2_analysis/DFE_condition_pri_vs_Control2h.csv")
sigs2h

mat <- counts(dds, normalized = T)

mat.z <- t(apply(mat,1,scale))
colnames(mat.z) <- rownames("samples_round2h.txt")

#mat.z [is.na(mat.z)] = 0 
mat.z[is.na(mat.z)] = 0
Heatmap(mat.z, cluster_rows = T, cluster_columns = T, column_labels = colnames(mat.z), name ="Z=score")
deseq2 rnaseq heatmap complexheatmap • 146 views
ADD COMMENT
0
Entering edit mode
8 weeks ago
Asaf 9.4k
  1. Usually, it's better to use the output of vst rather than plotting the counts after scale, it will keep the variance constant.
  2. If you want to select the genes from a list you should subset the matrix, simply run:

    glist <- # A list of genes

    mat.s <- mat[, glist]

    Heatmap(mat.s ...

ADD COMMENT

Login before adding your answer.

Traffic: 2319 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