welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
392 stars 78 forks source link

Error in ImputeKNN #313

Open kangjiajinlong opened 5 months ago

kangjiajinlong commented 5 months ago

Dear rliger team,

I am using rliger and following this tutorial https://welch-lab.github.io/liger/articles/Integrating_scRNA_and_scATAC_data.html. I followed the example code and ran imputeKNN as shown in section 10 of the tutorial. However, I received this error:

ℹ Imputing 1 query dataset: "rna" ℹ from reference dataset: "atac" caught segfault address 0xffffffffdaf002e0, cause 'memory not mapped'

Traceback: 1: referenceRawData %% weights 2: referenceRawData %% weights 3: imputeKNN(obj.liger, reference = "atac", queries = "rna") An irrecoverable exception occurred. R is aborting now ...

The code I am using is as follows:

obj.liger <- normalizePeak(obj.liger) rawPeakList <- lapply(datasets(obj.liger)["atac"], slot, "rawPeak") peakliger <- createLiger(rawPeakList) rm(rawPeakList) gc() peakliger <- normalize(peakliger)

Transfer the cluster labels from the original object to the new temporary object for marker calling

peakliger$cluster <- cellMeta(obj.liger, "leiden_cluster", useDatasets = "atac") defaultCluster(peakliger) <- "cluster" peak.pseudobulk <- runMarkerDEG(peakliger,conditionBy="cluster",method="pseudoBulk") rm(peakliger) gc()

Retain only peaks showing differential accessibility across our set of joint clusters

peak.pseudobulk.sig <- peak.pseudobulk %>% filter(padj < 0.05, logFC > 2) peaks.sel <- unique(peak.pseudobulk.sig$feature) rawPeak(obj.liger, "atac") <- rawPeak(obj.liger, "atac")[peaks.sel,] obj.liger <- normalizePeak(obj.liger) obj.liger <- imputeKNN(obj.liger, reference = "atac", queries = "rna")

I am running these commands on a computing cluster with 32 cores and 1.2T memory. Could you kindly help resolve this issue? Thank you for your help.