aertslab / SCENIC

SCENIC is an R package to infer Gene Regulatory Networks and cell types from single-cell RNA-seq data.
http://scenic.aertslab.org
GNU General Public License v3.0
396 stars 94 forks source link

runGENIE3 function from SCENIC does not produce complete file output. #154

Open charlesgwellem opened 3 years ago

charlesgwellem commented 3 years ago

Thanks a lot for this wonderful tool. Can anyone please hint me why I am not able to generate the complete list of files after running the runGENIE3 function in the SCENIC workflow? In the Int folder, I am only able to have the files from 1.1_genesKept.Rds to 3.3_aucellRankings.Rds and only 3 files in the output folder. After that I cannot run any further analysis because the missing files from running runGENIE3. I want to be able to generate an output similar to the one in this link.

I have used the following code, which I adapted from this tutorial.

library(SCENIC)
library(RcisTarget)
library(SCopeLoomR)
library(Seurat)
sce <- readRDS("4112 fibroblast.rds")
exprMat <- sce@assays$RNA@counts
exprMat <-as.matrix(exprMat)
cellInfo <-sce@meta.data 
charles
cellInfo <- data.frame(cellInfo)
cellTypeColumn <- "celltype"
colnames(cellInfo)[which(colnames(cellInfo)==cellTypeColumn)] <- "CellType"
cbind(table(cellInfo$CellType))
saveRDS(cellInfo, file="cellInfo.Rds")

colVars <- list(CellType=c("13-MYOC+ Fibroblast"="forestgreen", 
                           "19-Dermal Papilla Fibroblast"="darkorange", 
                           "2-CXCL12+ Fibroblast"="magenta4", 
                           "25-CCL19+ Fibroblast"="hotpink", 
                           "27-ANGPTL7+ Fibroblast"="red3", 
                           "30-DPEP1/COL11A1+ Fibroblast"="skyblue", 
                           "5-WIF1/SFRP2+ Fibroblast"="darkblue",
                           "7-PI16/MFAP5/CXCL14+ Fibroblast"="yellow"))
colVars$CellType <- colVars$CellType[intersect(names(colVars$CellType), cellInfo$CellType)]
saveRDS(colVars, file="colVars.Rds")
plot.new(); legend(0,1, fill=colVars$CellType, legend=names(colVars$CellType))

org="hgnc"
dbDir="/media/Pe/INTENSO/XXXX/10 sepecies database analysis(500bp)" # RcisTarget databases location
myDatasetTitle="SCENIC on human fibroblast" # choose a name for your analysis
data(defaultDbNames)
dbs <-c('500bp'= 'hg19-500bp-upstream-10species.mc9nr.feather','10kb' = 'hg19-tss-centered-10kb-10species.mc9nr.feather')
scenicOptions <- initializeScenic(org=org, dbDir=dbDir, dbs=dbs, datasetTitle=myDatasetTitle, nCores=30)
scenicOptions@inputDatasetInfo$cellInfo <- "cellInfo.Rds"
scenicOptions@inputDatasetInfo$colVars <- "colVars.Rds"

genesKept <- geneFiltering(exprMat, scenicOptions=scenicOptions,
                           minCountsPerGene=3*.01*ncol(exprMat),
                           minSamples=ncol(exprMat)*.01)

exprMat_filtered <- exprMat[genesKept, ]
dim(exprMat_filtered)
runCorrelation(exprMat_filtered, scenicOptions)
exprMat_filtered <- log2(exprMat_filtered+1) 

# Run GENIE3
runGenie3(exprMat_filtered, scenicOptions)
#Build and score the GRN
logMat <- log2(exprMat+1)
dim(exprMat)
saveRDS(scenicOptions, file="int/scenicOptions.Rds")

Thanks in advance from your kind help.

EAC-T commented 3 years ago

I'm also getting the same problem, did you find a solution?