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
394 stars 94 forks source link

Error in file(con, "w") : all connections are in use #453

Open TZUwang opened 2 months ago

TZUwang commented 2 months ago

HI there I have encountered some problems and would like to ask for advice.When I run

scenicOptions <- runSCENIC_2_createRegulons(scenicOptions, coexMethod=c("top5perTarget")) always encounter Error Error in file(con, "w") : all connections are in use In addition: Warning message: In MulticoreParam(nCores) : MulticoreParam() not supported on Windows, use SnowParam()

I solved it by using this code closeAllConnections() but no improvement what should I do

Osterzone commented 1 month ago

hello,I see somebody tell the answer in another issue. Hope it works! https://github.com/aertslab/SCENIC/issues/71

TZUwang commented 1 month ago

Reference TKX But I have seen this issue and tried to solve it, but it has not been improved. Maybe I have not set it up. This is my code. I want to know where the problem lies.

dermis <- subset(x = age.combined.PC30.r0.25, idents = c("1", "3", "6", "8", "13", "19")) exprMat <- GetAssayData(dermis_ND0, assay = "RNA", slot = "counts") exprMat <- as.matrix(exprMat) mode(exprMat) <- "numeric" plan(multisession, workers = 1) scenicOptions <- initializeScenic(org="mgi", dbDir=dbDir, nCores=1) genesKept <- geneFiltering(exprMat, scenicOptions) exprMat_filtered <- exprMat[genesKept, ] runCorrelation(exprMat_filtered, scenicOptions) exprMat_filtered_log <- log2(exprMat_filtered + 1) runGenie3(exprMat_filtered_log, scenicOptions) exprMat_log <- log2(exprMat + 1) scenicOptions@settings$dbs <- scenicOptions@settings$dbs["10kb"] scenicOptions <- runSCENIC_1_coexNetwork2modules(scenicOptions) scenicOptions <- runSCENIC_2_createRegulons(scenicOptions, coexMethod=c("top5perTarget")) Error in file(con, "w") : all connections are in use