-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Hello!
First of all, congrats on the amazing package, really!
I was trying to project WGCNA modules that were laying around in the lab from past experiments onto a recent scRNA-seq dataset.
The modules were saved as a text file with each row containing the gene name and the module assignment. We wanted to use hdWGCNA::ProjectModules to score their activities on scRNA-seq data and I used the following code:
library(Seurat)
library(hdWGCNA)
seurObj <- readRDS("Seurat.rds")
mods <- read.table('bulk_modules.txt',
header = F,
sep = "\t")
colnames(mods) <- c("gene_name", "module")
mods$color <- "grey" # just to fill the column
seurObj <- ProjectModules(
seurat_obj = seurObj,
modules = mods,
seurat_ref = NULL,
wgcna_name = "hdWGCNA",
wgcna_name_proj = 'Modules_consensus')Now, based on the documentation, ProjectModules can also work with a user-defined table of modules bypassing the argument seurat_ref. However, I was getting the following error:
Error in seurat_obj@misc :
no applicable method for `@` applied to an object of class "NULL"Which seems to be coming from CheckWGCNAName at line 38.
For this reason I created a pull request #405 for ProjectModules where:
seurat_refhas a default value ofNULLseurat_refis checked withCheckWGCNANameonly when different thanNULL- function stops if both
seurat_refandmodulesareNULL
It works on my end, and the classical behavior (with both seurat_obj and seurat_ref being provided) should not changed.
Let me know if I misunderstood anything!
Vittorio