Hi

I have a count matrix (TPM) for my samples. I have 4 replicate for each sample. My samples are as follows :

wt0hr wt6hr wt24hr mut0hr mut6hr mut24hr

I have a TPM matrix with geneids as rows and the columns as the 6 samples above. I am using follwoing R code to generate the heatmap:

dat <- read.csv("TPM.csv", row.names = 1,stringsAsFactors = FALSE, col.names = cols, header = TRUE)

counts_filtered_df <- dat[apply(dat, MARGIN = 1, FUN = function(x) sd(x) != 0),]

z.mat <- t(scale(t(counts_filtered_df), scale=TRUE, center=TRUE))

heatmap.2(z.mat, dendrogram="both", scale="none", trace="none")

Can anyone suggest me if this is the correct way to generate the heatmaps from TPM rather than using log2 FC.

Tanya

I am not sure I understand your question. You have 4 replicates, if these are in the matrix that goes into the heatmap function they will be plotted. If you want to average by column to combine replicates, just could google for that.