topTable error: data.frame(logFC = M[top]) : row names contain missing values
1
0
Entering edit mode
owen.whitley ▴ 10
@owenwhitley-15693
Last seen 5.0 years ago

I am trying to run a typical workflow for microarray differential expression. HGCC_exp_mat_transp is a 17320 gene x 48 sample matrix. I've gone through the debugger for RStudio but I'm still at a loss as to what's going on.

Here's the code:

dim(HGCC_exp_mat_transp)
[1] 17320    48

DE_fit_mes_status <- lmFit(HGCC_exp_mat_transp, design = design_mat)
  DE_fit_mes_status.reduced <- eBayes(DE_fit)
  ranked_probes <- topTable(DE_fit_mes_status.reduced, number = 17000)

 

I get the following error:

Removing intercept from test coefficients
Error in data.frame(logFC = M[top]) : row names contain missing values

traceback()
4: stop("row names contain missing values")
3: data.frame(logFC = M[top])
2: .topTableT(fit = fit[c("coefficients", "stdev.unscaled")], coef = coef,
       number = number, genelist = genelist, A = fit$Amean, eb = fit[ebcols],
       adjust.method = adjust.method, sort.by = sort.by, resort.by = resort.by,
       p.value = p.value, lfc = lfc, confint = confint)
1: topTable(DE_fit_mes_status.reduced, number = 17000)

Here's the session Info:

sessionInfo()

R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.4 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8       
 [4] LC_COLLATE=en_CA.UTF-8     LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] clusteval_0.1              missMethyl_1.12.0          gtools_3.5.0              
 [4] GOSemSim_2.4.1             MOFAtools_0.1              sva_3.26.0                
 [7] BiocParallel_1.12.0        genefilter_1.60.0          mgcv_1.8-23               
[10] nlme_3.1-137               gProfileR_0.6.6            ggplot2_2.2.1             
[13] kernlab_0.9-26             SNFtool_2.3.0              edgeR_3.20.9              
[16] limma_3.34.9               DESeq2_1.18.1              SummarizedExperiment_1.8.1
[19] DelayedArray_0.4.1         matrixStats_0.53.1         Biobase_2.38.0            
[22] GenomicRanges_1.30.3       GenomeInfoDb_1.14.0        IRanges_2.12.0            
[25] S4Vectors_0.16.0           BiocGenerics_0.24.0        rrcovHD_0.2-5             
[28] rrcov_1.4-3                robustbase_0.93-0         

loaded via a namespace (and not attached):
  [1] backports_1.1.2                                     Hmisc_4.1-1                                        
  [3] corrplot_0.84                                       plyr_1.8.4                                         
  [5] lazyeval_0.2.1                                      shinydashboard_0.7.0                               
  [7] heatmap.plus_1.3                                    splines_3.4.3                                      
  [9] robustHD_0.5.1                                      digest_0.6.15                                      
 [11] ExPosition_2.8.19                                   foreach_1.4.4                                      
 [13] htmltools_0.3.6                                     GO.db_3.5.0                                        
 [15] alluvial_0.1-2                                      magrittr_1.5                                       
 [17] checkmate_1.8.5                                     memoise_1.1.0                                      
 [19] cluster_2.0.7-1                                     doParallel_1.0.11                                  
 [21] readr_1.1.1                                         Biostrings_2.46.0                                  
 [23] annotate_1.56.2                                     perry_0.2.0                                        
 [25] siggenes_1.52.0                                     prettyunits_1.0.2                                  
 [27] colorspace_1.3-2                                    blob_1.1.1                                         
 [29] ggrepel_0.8.0                                       BiasedUrn_1.07                                     
 [31] dplyr_0.7.4                                         RCurl_1.95-4.10                                    
 [33] GEOquery_2.46.15                                    bindr_0.1.1                                        
 [35] survival_2.42-3                                     iterators_1.0.9                                    
 [37] glue_1.2.0                                          ruv_0.9.7                                          
 [39] registry_0.5                                        gtable_0.2.0                                       
 [41] zlibbioc_1.24.0                                     XVector_0.18.0                                     
 [43] spls_2.2-2                                          DEoptimR_1.0-8                                     
 [45] scales_0.5.0                                        pheatmap_1.0.8                                     
 [47] mvtnorm_1.0-7                                       rngtools_1.3.1                                     
 [49] DBI_1.0.0                                           Rcpp_0.12.16                                       
 [51] progress_1.1.2                                      xtable_1.8-2                                       
 [53] htmlTable_1.11.2                                    bumphunter_1.20.0                                  
 [55] foreign_0.8-70                                      bit_1.1-13                                         
 [57] mclust_5.4                                          preprocessCore_1.40.0                              
 [59] Formula_1.2-3                                       httr_1.3.1                                         
 [61] htmlwidgets_1.2                                     RColorBrewer_1.1-2                                 
 [63] acepack_1.4.1                                       pkgconfig_2.0.1                                    
 [65] reshape_0.8.7                                       XML_3.98-1.11                                      
 [67] nnet_7.3-12                                         locfit_1.5-9.1                                     
 [69] rlang_0.2.0                                         reshape2_1.4.3                                     
 [71] later_0.7.2                                         AnnotationDbi_1.40.0                               
 [73] munsell_0.4.3                                       tools_3.4.3                                        
 [75] RSQLite_2.1.1                                       pls_2.6-0                                          
 [77] stringr_1.3.1                                       yaml_2.1.19                                        
 [79] org.Hs.eg.db_3.5.0                                  knitr_1.20                                         
 [81] bit64_0.9-7                                         beanplot_1.2                                       
 [83] methylumi_2.24.1                                    purrr_0.2.4                                        
 [85] bindrcpp_0.2.2                                      doRNG_1.6.6                                        
 [87] mime_0.5                                            nor1mix_1.2-3                                      
 [89] xml2_1.2.0                                          biomaRt_2.34.2                                     
 [91] compiler_3.4.3                                      rstudioapi_0.7                                     
 [93] beeswarm_0.2.3                                      statmod_1.4.30                                     
 [95] tibble_1.4.2                                        geneplotter_1.56.0                                 
 [97] pcaPP_1.9-73                                        stringi_1.2.2                                      
 [99] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0  GenomicFeatures_1.30.3                             
[101] minfi_1.24.0                                        IlluminaHumanMethylationEPICanno.ilm10b2.hg19_0.6.0
[103] lattice_0.20-35                                     Matrix_1.2-14                                      
[105] IlluminaHumanMethylation450kmanifest_0.4.0          multtest_2.34.0                                    
[107] pillar_1.2.2                                        data.table_1.11.2                                  
[109] cowplot_0.9.2                                       bitops_1.0-6                                       
[111] rtracklayer_1.38.3                                  httpuv_1.4.3                                       
[113] R6_2.2.2                                            latticeExtra_0.6-28                                
[115] RMySQL_0.10.15                                      promises_1.0.1                                     
[117] gridExtra_2.3                                       vipor_0.4.5                                        
[119] codetools_0.2-15                                    MASS_7.3-50                                        
[121] assertthat_0.2.0                                    rhdf5_2.22.0                                       
[123] pkgmaker_0.22                                       openssl_1.0.1                                      
[125] GenomicAlignments_1.14.2                            Rsamtools_1.30.0                                   
[127] GenomeInfoDbData_1.0.0                              hms_0.4.2                                          
[129] MultiAssayExperiment_1.4.9                          quadprog_1.5-5                                     
[131] grid_3.4.3                                          rpart_4.1-13                                       
[133] tidyr_0.8.0                                         base64_2.0                                         
[135] illuminaio_0.20.0                                   shiny_1.0.5                                        
[137] base64enc_0.1-3                                     ggbeeswarm_0.6.0 

 

limma • 4.0k views
ADD COMMENT
1
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 18 hours ago
The city by the bay

Sometimes the error message is actually helpful. Running the following:

set.seed(0)
g <- gl(2, 5)
y <- matrix(rnorm(100*length(g)), ncol=length(g))
rownames(y) <- c(NA, 2:nrow(y)) # missing values here!

library(limma)
design <- model.matrix(~g)
fit <- lmFit(y, design)
fit <- eBayes(fit)
topTable(fit, n=Inf)

... yields the error:

Error in data.frame(logFC = M[top]) : row names contain missing values

Hardly surprising, as there are missing values in rownames(y). So get rid of them.

ADD COMMENT

Login before adding your answer.

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