combiz / scFlow

Single-cell/nuclei RNA-seq analysis tools in R for a complete workflow.
https://combiz.github.io/scFlow/
Other
56 stars 14 forks source link

[bug] Error with UMAP plot generation #204

Open vd4mmind opened 9 months ago

vd4mmind commented 9 months ago

Describe the bug Unable to run the steps in the Vigenette. Section Step four – Merging multiple datasets into one SingleCellExperiment object

To Reproduce Steps to reproduce the behavior:

  1. In R:
    
    .sce_list <- list()

for(i in dir_list){ mat <- read_sparse_matrix(i) metadata <- read_metadata( uniquekey = manifest$key[as.numeric(gsub("individual", "", basename(i)))], key_colname = "manifest", samplesheet_path = samplesheet_fp ) var_classes <- c( individual = "factor" ) metadata <- read_metadata( uniquekey = manifest$key[as.numeric(gsub("individual", "", basename(i)))], key_colname = "manifest", samplesheet_path = samplesheet_fp, col_classes = var_classes ) sce <- generate_sce(mat, metadata) sce <- annotate_sce( sce, ensembl_mapping_file = ensembl_fp ) sce <- filter_sce(sce) sce <- find_singlets(sce, "doubletfinder", pK = 0.005, vars_to_regress_out = c("nCount_RNA", "pc_mito"), num.cores = 1) sce <- filter_sce(sce) outdir <- file.path(outputDir,"/scflow_vignette_data") dir.create(outdir, showWarnings = FALSE)

dir_report <- file.path(outdir, "qc_report") dir.create(dir_report, showWarnings = FALSE)

report_qc_sce(sce, report_file = paste0("qcreport", basename(i)),

report_folder_path = dir_report)

sce_list[[basename(i)]] <- sce

}

sce <- merge_sce( sce_list, ensembl_mapping_file = ensembl_fp )

3. See error: <!-- [Please provide your error message] -->

→ Calculating tSNE reduced dimensions → Calculating UMAP reduced dimensions Error in RunUMAP.default(object = data.use, reduction.model = reduction.model, : lazy-load database '/home/sagemaker-user/R/x86_64-pc-linux-gnu-library/4.2/uwot/R/uwot.rdb' is corrupt In addition: Warning messages: 1: In RunUMAP.default(object = data.use, reduction.model = reduction.model, : restarting interrupted promise evaluation 2: In RunUMAP.default(object = data.use, reduction.model = reduction.model, : internal error -3 in R_decompress1](url) Expected behavior Creation of the report with corresponding plots.



## System

R version 4.2.3 (2023-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS
vd4mmind commented 9 months ago

The above is solved but I am having the below issue with the UMAP plots. Seems like very redundant and a problem with ggplot2. Not a clear solution found yet. Any specific package that I should remove?

plot_reduced_dim(sce, feature_dim = "diagnosis", 
                 reduced_dim = "UMAP_Liger", alpha = 1, size = 1)

Error Error in as.unit(e1) : object is not coercible to a unit