Dear Peter, Steve,
I am writing to seek your help in using 'chooseOneHubInEachModule' function from the WGCNA package.
I am trying to generate hierarchical clustering plot on my data matrix with samples from two groups.
https://rdrr.io/cran/WGCNA/man/orderBranchesUsingHubGenes.html
However, using this function is gives me an error:
colorh_new <- labels2colors(y_data, colorSeq = c("#00FFFFFF","#FF0000FF"))
str(as.matrix(samp2))
num [1:250, 1:100] -0.197 -0.593 0.212 2.661 -0.342 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:250] "sample1" "sample2" "sample3" "sample4" ...
..$ : chr [1:100] "gene1" "gene2" "gene3" "gene4" ...
hubs = chooseOneHubInEachModule(as.matrix(samp2), colorh_new)
Error in datExpr[, keep] : subscript out of bounds
Can you please help.
Thanks
Sharvari