songw01 / MEGENA

Multiscale embedded gene co-expression network analysis
GNU General Public License v3.0
48 stars 16 forks source link

MEGENA.ModuleSummary #19

Open hanguojun007 opened 2 years ago

hanguojun007 commented 2 years ago

if (!is.null(hub.output) & !is.na(hub.output)) { # <- maybe wrong module.scaleGroup <- lapply( hub.output$scale.summary.clusters, names ) scale.group <- rep(NA, length(module.output$modules)) names(scale.group) <- names(module.output$modules) for (i in seq(1, length(module.scaleGroup))) { scale.group[module.scaleGroup[[i]]] <- names(module.scaleGroup)[i] } module.id <- names(module.output$modules) module.table <- data.frame( module.id = module.id, module.size = module.size[module.id], module.parent = module.parent[module.id], module.hub = hub.summary[module.id], module.scale = scale.group[module.id], module.pvalue = module.pvalue[module.id] )

etwatson commented 1 year ago

I think I am getting an error based on this. The tutorial MEGENA_pipeline_03102022.Rmd throws the following error:

Error in if (!is.null(hub.output) & !is.na(hub.output)) { : the condition has length > 1

zhuhw0916 commented 1 year ago

I think line 47 of the function "MEGENA.ModuleSummary" if (!is.null(hub.output) & !is.na(hub.output)) could be changed to the following form if (all(!is.null(hub.output)) & all(!is.na(hub.output))) As far as I've run it, it works.