abelson-lab / scATOMIC

Pan-Cancer Single Cell Classifier
MIT License
57 stars 5 forks source link

Error of run_scATOMIC(lung_cancer_demo_data) #2

Closed cjzhuo closed 1 year ago

cjzhuo commented 1 year ago

sorry,when I running run_scATOMIC(lung_cancer_demo_data), the program is kill, can you tell what's wrong with it??

cell_predictions <- run_scATOMIC(lung_cancer_demo_data) [1] "Starting Layer 1" /home/zhuo/miniconda3/envs/r-reticulate/lib/python3.10/site-packages/magic/magic.py:425: UserWarning: Input matrix contains unexpressed genes. Please remove them prior to running MAGIC. warnings.warn(

caught segfault address 0x7f72a9991000, cause 'memory not mapped'

Traceback: 1: py_call_impl(callable, dots$args, dots$keywords) 2: operator$fit_transform(data, genes = genes, t_max = t.max) 3: magic.default(filtered_counts, verbose = F) 4: Rmagic::magic(filtered_counts, verbose = F) 5: scATOMIC::classify_cells_RNA_no_scale(rna_counts = rna_counts, imputation = imputation, genes_in_model = genes_in_model, model = model, cells_to_use = cells_to_use, ref_based = ref_based, normalized_counts = normalized_counts) 6: scATOMIC::classify_layer(rna_counts = rna_counts, cells_to_use = colnames(rna_counts), layer = "layer_1", imputation = imputation, genes_in_model = top_genes_unlisted_layer_1, model = model_layer_1, ref_based = ref_based, mc.cores = mc.cores, unimodal_nsd = unimodal_nsd, bimodal_nsd = bimodal_nsd, normalized_counts = normalized_counts) 7: run_scATOMIC(lung_cancer_demo_data)

Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection:

inofechm commented 1 year ago

Hello thank you for bringing up this issue. It looks like you are having an issue with memory given the "memory not mapped" error. Try restarting R and trying again with all high memory tasks stoppred on your machine (close any programs using a lot of memory) Are you working on a local computer or a high performance cluster? Which OS are you on? Please ensure you are allocating enough memory for the job, although it shouldn't require anything exceeding a couple GB of memory. It could also be an issue with installing the Rmagic package, please confirm the python dependency is installed via Rmagic::pymagic_is_available()

Finally, it may be an issue with parallel processing on your machine, try running run_scATOMIC(lung_cancer_demo_data, mc.cores = 1)

Please let me know if this resolves the issue, thanks again!

inofechm commented 1 year ago

additionally, this issue on stack overflow could be explaining it https://stackoverflow.com/questions/49190251/caught-segfault-memory-not-mapped-error-in-r if you want to check whether it is relevant to your set up

It could be an error with incompatible pre-installed packages, so it could be worth uninstalling all the dependencies and re-installing them.

cjzhuo commented 1 year ago

Hello thank you for bringing up this issue. It looks like you are having an issue with memory given the "memory not mapped" error. Try restarting R and trying again with all high memory tasks stoppred on your machine (close any programs using a lot of memory) Are you working on a local computer or a high performance cluster? Which OS are you on? Please ensure you are allocating enough memory for the job, although it shouldn't require anything exceeding a couple GB of memory. It could also be an issue with installing the Rmagic package, please confirm the python dependency is installed via Rmagic::pymagic_is_available()

Finally, it may be an issue with parallel processing on your machine, try running run_scATOMIC(lung_cancer_demo_data, mc.cores = 1)

Please let me know if this resolves the issue, thanks again!

I use the high performance cluster, the system is Ubuntu 20.10 and the memory is 256G, so I think the memory is enough. But I can run the program in my computer. I'll try it as you suggest. Thank you.

inofechm commented 1 year ago

Upon further looking into the error it seems like there is an issue with other packages or software installed on the HPC that you are using. We have tested scATOMIC on our own Ubuntu 18.04.6 HPC. It looks to be an error where some of the dependencies installed are an old version that may have not been updated when a ubuntu update occured and need to be removed and reinstalled as they are broken. You can check which packages are broken by running R CMD check as described in the top answer of this thread: https://stackoverflow.com/questions/49190251/caught-segfault-memory-not-mapped-error-in-r

Thanks again for trying the package!