Question: Differential Gene Expression Using Deseq2
gravatar for aropri
3 months ago by
aropri10 wrote:


I am trying to create a heatmap of differentially expressed lncRNAs in normal, atypical, dcis, and invasive breast cancer patient samples. I have created a heatmap from the counts file but that seems to be the cumulative count of the 4 conditions for each lncRNA and the lncRNAs with the highest total count are represented first or ranked first. I would like to see how the expression (gene count) changes between the 4 conditions for each lncRNAs to see how they are going up or down in expression from normal breast tissue to breast cancer. Is there a way to achieve that? If someone is able to help with this, I would truly appreciate it.

rna-seq • 181 views
ADD COMMENTlink modified 3 months ago by tiago2112871.2k • written 3 months ago by aropri10
gravatar for tiago211287
3 months ago by
tiago2112871.2k wrote:

The count matrix is a non-normalized data format. If you are using Deseq2 you can extract the normalized matrix with :


#Extract the rlog matrix from the Deseq2 results
rld <- rlog(dds, blind=FALSE)
mat <- assay(rld)

#Pseudocode to get significant genes
sig.genes <- c("gene1", "gene2", ...)

mat <- mat[sig.genes,]
mat <- scale(t(mat), center = T, scale = T)

HM <- Heatmap(t(mat), column_split = 2, row_split = 2)

Keep in mind that this code was not tested and was not made using examples. You should take a look at the Deseq2 Manual to really understand what is going on here.

ADD COMMENTlink modified 3 months ago • written 3 months ago by tiago2112871.2k

Thank you will try this

ADD REPLYlink written 3 months ago by aropri10

So what is the problem? You just opened a new question with identical content? This answer tells you what to do, you must scale your data to get values relative to the mean of each row. That is what the scale part does.

Basically if you have your log2 expression values or vst, do scaled <- t(scale(t(log2Values))) to transform them to the standardized scale. From there on you can plot them, check the ComplexHeatmap package, it has an extensive manual with plenty of example code. Ask if there are questions, please do not open identical questions, that is utterly disrespectful towards the users who took the time here to answer you since you pretend their posts never happened.

ADD REPLYlink written 12 weeks ago by ATpoint41k
Please log in to add an answer.


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