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

runSCENIC_4 thresholds not selected for AUCell::AUCell_plotTSNE #198

Open AAA-3 opened 3 years ago

AAA-3 commented 3 years ago

Hello everyone,

I want to adjust my binarisation thresholds. I have the following code from the vignette:

#binarize 
aucellApp <- plotTsne_AUCellApp(scenicOptions, exprMat=exprMat_filtered)
savedSelections <- shiny::runApp(aucellApp) #thresholds decided based on median value for each regulon
# Save 
newThresholds <- savedSelections$thresholds
scenicOptions@fileNames$int["aucell_thresholds",1] <- "int/newThresholds.Rds"
saveRDS(newThresholds, file=getIntName(scenicOptions, "aucell_thresholds"))
saveRDS(scenicOptions, file="int/scenicOptions.Rds") 
scenicOptions <- runSCENIC_4_aucell_binarize(scenicOptions, exprMat = exprMat_filtered,skipBoxplot=FALSE, skipHeatmaps=FALSE, skipTsne=FALSE)

Using the shiny app I adjusted the threshold to 0,455 for Sox11 but when I start to plot my graphs, it uses different thresholds!

image

Why is it using 0,7 instead of 0,455? Is there a way to force AUCell to use the SCENIC adjusted thresholds?

In another section I have the following:

AUCell::AUCell_plotTSNE(dr_coords,
                        cellsAUC=selectRegulons(regulonAUC, tfs),
                        plots=c("binaryAUC", "AUC", "Histogram"),
                        )

With the same issue.

AAA-3 commented 3 years ago

Adding

thresholds = newThresholds

Solved the problem but for my second code:

AUCell::AUCell_plotTSNE(dr_coords,
                        cellsAUC=selectRegulons(regulonAUC, tfs),
                        plots=c("binaryAUC", "AUC", "Histogram", "Expression"),
                        thresholds = newThresholds
                        )

I get no graph being produced and an error saying: Expression plot was requested, but no expression matrix provided. . When I remove the Expression graph it produces nothing. Removing the thresholds arguement produces a graph with the wrong thresholds. Any idea what's happening?