Closed Roger-GOAT closed 5 months ago
library(hdWGCNA) library(WGCNA) enableWGCNAThreads(nThreads = 0.75*parallel::detectCores()) Idents(sce) <- 'cluster' DefaultAssay(sce) <- 'RNA' sce <- SCTransform(sce,assay = 'RNA') sce <- RunPCA(sce,assay = 'SCT') seurat_obj <- SetupForWGCNA( sce, gene_select = "fraction" wgcna_name = "tutorial" ) DefaultAssay(seurat_obj) <- 'RNA' Idents(seurat_obj) <- 'cluster' seurat_obj <- MetacellsByGroups( seurat_obj = sce, wgcna_name = "tutorial", group.by = c("cluster",'batch') ident.group = "cluster", assay = 'RNA' ) seurat_obj <- NormalizeMetacells(seurat_obj = seurat_obj,wgcna_name = "tutorial") ##Test different soft powers:----------------- bicor <- WGCNA::bicor networkType <- "signed hybrid" corFnc <- "bicor" seurat_obj <- TestSoftPowers( seurat_obj, corFnc = corFnc, networkType = networkType # you can also use "unsigned" or "signed hybrid" ) Error in if (nGenes < 3) { : Argument is of length zero
I run this in R 4.2 is OK but update to R 4.3.1 get error. Some package must be conflicted. Do any one know why? Best!
Hi, it looks like you have forgotten to run the SetDatExpr function. Please consult this tutorial to see the suggested steps for running hdWGCNA.
I run this in R 4.2 is OK but update to R 4.3.1 get error. Some package must be conflicted. Do any one know why? Best!