I can not create the HeatMap chart on DEseq2
1
0
Entering edit mode
pertille • 0
@pertille-9104
Last seen 5.2 years ago
Sweden

I am trying to do a heatmap using this pipeline:
http://bio.biomedicine.gu.se/~marcela/courses/2014/imbi/practicals/4-RNASeq.html

Everything works well except the "heatmap.2" graph

I think that it is a problem with the object: "sig2heatmap", that is generated by:

assay(rld)[rownames(assay(rld))%in%rownames(sig),] -> sig2heatmap

With this result:

sig2heatmap
     RJF_AV163 RJF_AV170 RJF_AV171 RJF_AV176 RJF_C165 RJF_C167 RJF_C172
     RJF_C174 RJF_C175 RJF_C178

When I try the command to generate the graph: 
​
tiff("heatmap.2.tiff", units="in", width=11, height=8.5, res=600, compress="lzw")
heatmap.2( sig2heatmap, scale="row",
           trace="none", dendrogram="column",
           col = colorRampPalette( rev(brewer.pal(9, "RdBu")) )(255))

The follow error appear:

Error in heatmap.2(sig2heatmap, scale = "row", trace = "none", dendrogram = "column",  :

  `x' must have at least 2 rows and 2 columns

Follow my objects used in the command:

> head(assay(rld))
     RJF_AV163 RJF_AV170 RJF_AV171 RJF_AV176 RJF_C165 RJF_C167 RJF_C172
[1,]  3.385057  1.812603  2.721344  3.452685 1.817673 1.816809 1.815895
...
     RJF_C174 RJF_C175 RJF_C178
[1,] 1.817404 1.820117 1.813146
...
> rownames(assay(rld))
NULL
> rownames(sig)
NULL

> sig
log2 fold change (MAP): condition Ctrl vs AV
Wald test p-value: condition Ctrl vs AV
DataFrame with 37 rows and 6 columns
     baseMean log2FoldChange     lfcSE      stat       pvalue         padj
    <numeric>      <numeric> <numeric> <numeric>    <numeric>    <numeric>
1    89.09102       8.159865  1.443825  5.651562 1.589961e-08 5.126605e-07
...       ...            ...       ...       ...          ...          ...

Thank you

 

 

 

 

deseq2 R • 1.4k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 1 day ago
United States

It looks like the problem is that you can't use rownames() for filtering because there are no annotated rownames on your dds object (see the NULL lines in your R output).

If dim(dds) and dim(rld) are the same (and you are not rearranging / reordering either) you can accomplish the same thing but avoid the problem of missing rownames like so:

res <- results(dds)
sig2heatmap <- assay(rld)[ which(res$padj < 0.1), ]

 

ADD COMMENT

Login before adding your answer.

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