smorabit / hdWGCNA

High dimensional weighted gene co-expression network analysis
https://smorabit.github.io/hdWGCNA/
Other
316 stars 31 forks source link

seurat_obj <- ModuleEigengenes( seurat_obj, assay = "RNA", use_layer = "data", verbose = FALSE ) Error in ModuleEigengenes(seurat_obj, assay = "RNA", use_layer = "data", : "data"槽名不存在于"Assay5"类别对象中 #177

Closed rraky closed 5 months ago

rraky commented 5 months ago

Describe the bug Provide a clear and concise description of what the bug/error is. If there is an error message, please copy it here. If you have more than one bug/error, please open separate GitHub issues.

Steps to reproduce Describe the steps included to reproduce the error, including all of the hdWGCNA code used prior reaching the error. Describe the dataset that you are using, and whether or not the error could be reproduced on one of our provided tutorial datasets, or on another publicly available dataset.

# Put code in this box

R session info Please run sessionInfo() and report the output.

Screenshots If applicable, add screenshots to help explain your problem.

More than one problem? If you have more than one problem with hdWGCNA, create separate issues for your individual problems.

smorabit commented 5 months ago

I am not sure if you meant to do this but your issue is just the blank issue template. I think that the title of your issue contains your code and an error message but I am not sure.

Please fill out the issue correctly, and provide me with relevant information that I can use to understand and resolve the issue.

rraky commented 5 months ago

Hello, here is my code. Aging is divided into a group from MSC, and then a subgroup from Aging is divided into hdWGCNA. MSC is integrated into batches. I have been wrong for several days, thank you very much for your answer

View(Aging)

library(Seurat) BMSC<-Aging[,Idents(Aging)%in%c("BMSC")] View(BMSC) View(BMSC@meta.data) BMSC$cell_type<-Idents(BMSC) library(Seurat) library(Seurat) library(tidyverse) library(cowplot) library(patchwork) library(WGCNA) library(hdWGCNA) seurat_obj <- SetupForWGCNA(BMSC,gene_select = "fraction", fraction = 0.05, wgcna_name = "tutorial" ) Error in cut.default(1:nrow(expr_mat), n_chunks) : 间隔数目不对 DefaultAssay(BMSC)='RNA' seurat_obj <- SetupForWGCNA(BMSC,gene_select = "fraction", fraction = 0.05, wgcna_name = "tutorial" ) [1] "Assay must contain counts slot." seurat_obj <- MetacellsByGroups(seurat_obj = seurat_obj,group.by = c("cell_type"),max_shared = 10, ident.group = 'cell_type') seurat_obj <- NormalizeMetacells(seurat_obj) metacell_obj <- GetMetacellObject(seurat_obj) seurat_obj <- NormalizeMetacells(seurat_obj) seurat_obj <- ScaleMetacells(seurat_obj, features=VariableFeatures(seurat_obj)) seurat_obj <- RunPCAMetacells(seurat_obj, features=VariableFeatures(seurat_obj)) seurat_obj <- RunUMAPMetacells(seurat_obj, dims=1:15) seurat_obj <- SetDatExpr(seurat_obj,group_name = "BMSC", group.by='cell_type', assay = 'RNA', slot = 'data') seurat_obj <- TestSoftPowers(seurat_obj,networkType = 'signed') pickSoftThreshold: will use block size 5161. pickSoftThreshold: calculating connectivity for given powers... ..working on genes 1 through 5161 of 5161 Power SFT.R.sq slope truncated.R.sq mean.k. median.k. max.k. 1 1 0.1390 34.60 0.813 2.59e+03 2.59e+03 2680.000 2 2 0.0534 -10.80 0.968 1.31e+03 1.31e+03 1420.000 3 3 0.4830 -20.10 0.914 6.71e+02 6.67e+02 771.000 4 4 0.5910 -14.90 0.903 3.46e+02 3.43e+02 429.000 5 5 0.7050 -11.40 0.914 1.80e+02 1.77e+02 243.000 6 6 0.8230 -9.59 0.950 9.42e+01 9.19e+01 143.000 7 7 0.8930 -8.49 0.973 4.98e+01 4.79e+01 89.000 8 8 0.9220 -7.42 0.970 2.66e+01 2.52e+01 57.100 9 9 0.9270 -6.38 0.950 1.43e+01 1.33e+01 37.800 10 10 0.4670 -8.55 0.383 7.81e+00 7.08e+00 25.800 11 12 0.9530 -4.17 0.959 2.39e+00 2.03e+00 13.100 12 14 0.9830 -3.24 0.993 7.73e-01 5.95e-01 7.350 13 16 0.9740 -2.61 0.971 2.66e-01 1.78e-01 4.460 14 18 0.9640 -2.15 0.954 9.92e-02 5.43e-02 2.880 15 20 0.9830 -1.83 0.979 4.09e-02 1.68e-02 2.130 16 22 0.9850 -1.62 0.982 1.90e-02 5.30e-03 1.660 17 24 0.9870 -1.45 0.987 9.94e-03 1.70e-03 1.350 18 26 0.9870 -1.35 0.987 5.84e-03 5.54e-04 1.130 19 28 0.9580 -1.29 0.960 3.77e-03 1.83e-04 0.966 20 30 0.9640 -1.24 0.960 2.61e-03 6.14e-05 0.833 Warning message: executing %dopar% sequentially: no parallel backend registered plot_list <- PlotSoftPowers(seurat_obj) wrap_plots(plot_list, ncol=2) power_table <- GetPowerTable(seurat_obj) head(power_table) seurat_obj <- ConstructNetwork(seurat_obj, soft_power=9,setDatExpr=FALSE,tom_name = 'BMSC') PlotDendrogram(seurat_obj, main='INH hdWGCNA Dendrogram') PlotDendrogram(seurat_obj, main='BMSC hdWGCNA Dendrogram') TOM <- GetTOM(seurat_obj) Found more than one class "dist" in cache; using the first, from namespace 'spam' Also defined by ‘BiocGenerics’ Found more than one class "dist" in cache; using the first, from namespace 'spam' Also defined by ‘BiocGenerics’

seurat_obj <- ScaleData(seurat_obj, features=VariableFeatures(seurat_obj)) seurat_obj <- ModuleEigengenes(

  • seurat_obj
  • ) Error in ModuleEigengenes(seurat_obj) : "data"槽名不存在于"Assay5"类别对象中
rraky commented 5 months ago
image
rraky commented 5 months ago
image
smorabit commented 5 months ago

Thank you for sending the details. Are you using Seurat version 5? I think that you might be using it because I see something about "Assay5" in your error message. Unfortunately Seurat 5 does not work with hdWGCNA. We are working on an update that will make them compatible.

rraky commented 5 months ago

Hi, I was wondering, can hdWGCNA draw other genes co-expressed with a certain gene, like this

image
smorabit commented 5 months ago

If you have a separate question or issue that is unrelated, please open it as a new issue and I will be happy to answer.