smorabit / hdWGCNA

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

Subset dataset to cell type before constructing metacells #209

Closed mitchTwoTimes closed 3 months ago

mitchTwoTimes commented 4 months ago

Hi,

I'm curious what effects, if any, would occur if I subset my Seurat object to the cell type of interest I would like to find a co-expression network for. In your tutorial, you run MetacellsByGroups() on seurat_obj followed by SetDatExpr(), where you choose "INH" as the group.name. What would happen if you did something like inh <- subset(seurat_obj, idents = "INH") and then ran all downstream functions on inh?

Thanks!

smorabit commented 3 months ago

Hi,

If you do what you describe, you would end up with a co-expression network for just the INH group since you have subset the dataset to only include the INH cluster. However, in the tutorial note that we also have the module expression levels (module eigengenes, MEs) computed for the whole dataset, so that information tells us which modules are expressed in the INH or which modules might be expressed in other cell types as well. If you subset the data as you described, you will only have the ME values for the INH cluster. I think that both approaches are equally valid and it is up to you based on your preference. You can see examples of running hdWGCNA these two separate ways in the hdWGCNA paper. Fig 6 shows our analysis of the microglia where we first subset the data to only have microglia, which contrasts the analysis presented in Fig 1 which is quite similar to the hdWGCNA tutorials.