This is a test version of Biostars. For the public version, visit https://www.biostars.org.
WGCNA Error in moduleEigengenes: object 'trapErrors' not found

I am not sure what this error mean and what can I do about it? I am using this code from https://rdrr.io/cran/WGCNA/man/moduleEigengenes.html

eigengenes <- moduleEigengenes(datExpr, 
                           moduleColors, 
                           impute = TRUE, 
                           nPC = 1, 
                           align = "along average", 
                           excludeGrey = FALSE, 
                           grey = if (is.numeric(colors)) 0 else "grey",
                           subHubs = TRUE,
                           trapErrors = FALSE,
                           returnValidOnly = trapErrors, 
                           softPower = 7,
                           scale = TRUE,
                           verbose = 0, indent = 0)

Error in moduleEigengenes(datExpr, moduleColors, impute = TRUE, nPC = 1, : object 'trapErrors' not found

wgcna

As trapErrors should be FALSE, you can replace returnValidOnly = trapErrors with returnValidOnly = FALSE to deal with the error

1 answer

Thanks! What is weird, I used the function in a shortened way and the error disappeared. Maybe that's because the function has been rewritten in WGCNA package (?)

eigengenes1 <- moduleEigengenes(datExpr, 
                           moduleColors)

This worked perfectly fine...

However all the eigengenes were NOT hub genes and I am now a bit confused, trying to understand what it means for my analysis exactly.

Log in to answer this question.