Entering edit mode
Alex Nesmelov
•
0
@alex-nesmelov-20660
Last seen 5.8 years ago
Hi! When I try to calculate module preservation statistics from adjacency data, modulePreservation function in WGCNA 1.67 package throws an error as follows:
> mp = modulePreservation(multiExpr,
+ multiColor,
+ dataIsExpr = F,
+ nPermutations = 2)
..checking adjacencies for excessive amounts of missing data
..calculating observed preservation values
Error in make.unique(rownames(datRef)) :
'names' must be a character vector
Here is a reproducible example with a fake dataset:
library(WGCNA)
setLabels = c("one", "two");
multiExpr = list(one = list(data = c()),
two = list(data = c()))
n <- 1000 # dimensionality
genes <- paste0("Gene", 1:n)
# Fill both datasets with fake adjacencies
for (i in 1:2) {
x <- matrix(runif(n*n, min = 0, max = 1), n)
diag(x) <- 1
x[lower.tri(x)] = t(x)[lower.tri(x)] # make matrix symmetric
row.names(x) <- genes
colnames(x) <- genes
print(x[1:3,1:3])
multiExpr[[i]]$data <- x
}
multiColor = list(one = sample(standardColors(50), n, replace = T))
mp = modulePreservation(multiExpr,
multiColor,
dataIsExpr = F,
nPermutations = 2)
I see this error only in WGCNA 1.67 when dataIsExpr = F. The same code works in both R 3.5.2/3.4.2 1) when dataIsExpr = T or 2) on WGCNA 1.64. I calculated preservation statistics directly from expression already, but I'm still curious whether this is just a WGCNA bug or some problem with my data which WGCNA 1.67 is unable to tolerate.
Thanks for the report, I will look into the issue.