Handling NA values in limma's voom design matrix
1
0
Entering edit mode
23 months ago
rubic ▴ 270

Hi, I'm trying to use limma's voom for RNA-seq data, where my design matrix contains NA values. Can voom handle these NAs or is the only solution to toss out the samples with these NAs?

Here's my example data:

set.seed(1)
counts.mat <- matrix(as.integer(runif(1000*10, 10,1000)),nrow = 1000, ncol = 10, dimnames = list(paste0("g",1:1000),paste0("s",1:10)))
design.df <- data.frame(id = paste0("s",1:10),
                        sex = sample(c("female","male"), 10, replace = T),
                        age = sample(c(5, 7, 10), 10, replace = T))
#adding NAs
design.df$sex[3] <- NA
design.df$age[5] <- NA

design.mat <- model.matrix(~ id + age + sex, model.frame(~ ., design.df, na.action = na.pass))
dge <- edgeR::DGEList(counts = counts.mat)
dge <- edgeR::calcNormFactors(dge)
voom.obj <- limma::voom(dge, design.mat, plot=TRUE)

The last last gives this error message:

Error in qr.default(x) : NA/NaN/Inf in foreign function call (arg 1)
rna-seq voom design.matrix limma NA • 735 views
ADD COMMENT
1
Entering edit mode
23 months ago

Cross-posted and answered by the limma developer: https://support.bioconductor.org/p/9144237/

ADD COMMENT

Login before adding your answer.

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