In WGCNA package, there is a function chooseTopHubInEachModule that selects top hub genes from each module of the network. Which filters and cut-off does it use for hub selection?
There are different ways to calculate hub scores. WGCNA's implementation is to simply return the gene with the maximum adjacency / 'connectivity' per module. Just type chooseTopHubInEachModule on your command line:
chooseTopHubInEachModule
function (datExpr, colorh, omitColors = "grey", power = 2, type = "signed",
...)
{
isIndex = FALSE
modules = names(table(colorh))
if (!is.na(omitColors)[1]))
modules = modules[!is.element(modules, omitColors)]
if (is.null(colnames(datExpr))) {
colnames(datExpr) = 1:dim(datExpr)[2]
isIndex = TRUE
}
hubs = rep(NA, length(modules))
names(hubs) = modules
for (m in modules) {
adj = adjacency(datExpr[, colorh == m], power = power,
type = type, ...)
hub = which.max(rowSums(adj))
hubs[m] = colnames(adj)[hub]
}
if (isIndex) {
hubs = as.numeric(hubs)
names(hubs) = modules
}
return(hubs)
}
Thanks, very helpful!
So as far as I understand, chooseTopHubInEachModule selects only one hub per module? I got confused because of the name of the function, thinking that one hub per module is calculated by chooseOneHubInEachModule.
I do not know what the utility is of the chooseOneHubInEachModule function. However, regarding the WGCNA package, there appears to be redundancy (in terms of code) across its various functions. Important to remember that WGCNA is not a Bioconductor package.
Thanks, very helpful! So as far as I understand,
chooseTopHubInEachModule
selects only one hub per module? I got confused because of the name of the function, thinking that one hub per module is calculated bychooseOneHubInEachModule
.I do not know what the utility is of the
chooseOneHubInEachModule
function. However, regarding the WGCNA package, there appears to be redundancy (in terms of code) across its various functions. Important to remember that WGCNA is not a Bioconductor package.