Question: DESeq2 pheatmap returns Error in check.length("fill") : 'gpar' element 'fill' must not be length 0
0
gravatar for Anthony.Knox
2.0 years ago by
Anthony.Knox50
Anthony.Knox50 wrote:

I am relatively new to this type of analysis, so bear with me but when I am following the Analyzing RNA-seq data with DESeq2 (http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html) I get an error when creating a heatmap. I know this issue has been addressed here, but the solution to the last thread was that the column names of log2.norm.counts is the same as row names of df, which I have as shown below... However, I still get the error message. Here is my code...

Note: I only show 6 samples although I have 171 total.

> select <- order(rowMeans(counts(dds, normalized=TRUE)), decreasing=TRUE)[1:20]
> select
 [1] 10424    10     1  6904 14004   222  9620  7570  1166 14637   224  3744  7578  1026 13151    30 12887 14646  5177  2154

> ntd <- normTransform(dds)
> ntd
class: DESeqTransform 
dim: 16078 171 
metadata(1): version
assays(1): ''
rownames(16078): '' 1-acylglycerol-3-phosphate O-acyltransferase 1 (lysophosphatidic acid acyltransferase, alpha)(Agpat1) ... zyg-ll family member
  B, cell cycle regulator(Zyg11b) zyxin(Zyx)
rowData names(26): baseMean baseVar ... maxCooks replace
colnames(171): E14.5_17687 E14.5_17703 ... p21_20341 p21_20343
colData names(3): run condition replaceable

> log2.norm.counts <- assay(ntd)[select,]
> log2.norm.counts
                                                                                                     E14.5_17687 E14.5_17703 E14.5_17704 E14.5_17705 E14.5_17706 E14.5_17707
Rap guanine nucleotide exchange factor (GEF) 4(Rapgef4)                                                13.164505   12.281460   10.996595    9.746221   11.396687   12.633184
18S ribosomal RNA(Rn18s)                                                                               13.533771   11.815265   11.427905   12.433906   11.262133   12.254745
                                                                                                       13.945668   12.715591   12.041674   12.898887   12.420905   13.751992
metastasis associated lung adenocarcinoma transcript 1 (non-coding RNA)(Malat1)                        13.946493   13.815606   13.646218   11.781393   13.043065   13.909520
titin(Ttn)                                                                                              6.033377   13.235685   11.315809   11.051142   12.824853    6.790753

> df <- as.data.frame(colData(dds)[,c("run")])
> df
    colData(dds)[, c("run")]
1                E14.5_17687
2                E14.5_17703
3                E14.5_17704
4                E14.5_17705
5                E14.5_17706
6                E14.5_17707

> pheatmap(log2.norm.counts, cluster_rows=FALSE, show_rownames=TRUE, cluster_cols=FALSE, annotation_col=df)
Error in check.length("fill") : 
  'gpar' element 'fill' must not be length 0

Any ideas on how to fix this? Thank you!

gpar rna-seq deseq2 pheatmap • 3.3k views
ADD COMMENTlink written 2.0 years ago by Anthony.Knox50

Are you sure that you have the rownames of df set? What's returned with rownames(df)? It looks like your rownames are just the default numerical rownames, i.e., 1, 2, 3, 4, 5, ...

These rownames must match the column names of your input data matrix.

ADD REPLYlink modified 15 months ago • written 2.0 years ago by Kevin Blighe51k

See potential solution here: A: DESeq2 pheatmap returns Error in check.length("fill") : 'gpar' element 'fill' mu

ADD REPLYlink written 15 months ago by Kevin Blighe51k
Please log in to add an answer.

Help
Access

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