aertslab / scenicplus

SCENIC+ is a python package to build gene regulatory networks (GRNs) using combined or separate single-cell gene expression (scRNA-seq) and single-cell chromatin accessibility (scATAC-seq) data.
Other
186 stars 29 forks source link

"enable_string_cache()" in export_pseudobulk using tutorial data #445

Closed gilgolan73 closed 3 months ago

gilgolan73 commented 3 months ago

Describe the bug Hello, I am trying to run the scenicplus pipeline on the tutorial data . I am using a linux centos 9 virtual machine, on a new conda environment. When trying to run export_pseudobulk() (inthe pycisTopic part on the tutorial), after few minutes I receive an error enable_string_cache() (see full error message below), and bigwig files/bed files are not generated. I would really appreciate any help on how to solve this issue. Thank you, Gil

To Reproduce All of the commands are the same as in the tutorial. The command causing trouble is: bw_paths, bed_paths = export_pseudobulk(input_data = cell_data,variable = "VSN_cell_type",sample_id_col = "VSN_sample_id",chromsizes = chromsizes,bed_path = os.path.join(out_dir, "consensus_peak_calling/pseudobulk_bed_files"),bigwig_path = os.path.join(out_dir, "consensus_peak_calling/pseudobulk_bw_files"),path_to_fragments = fragments_dict,n_cpu = 2,normalize_bigwig = True,temp_dir = "/tmp",split_pattern = "-")

Error output Error massage of the above command is: 2024-08-05 17:17:41,769 cisTopic INFO Splitting fragments by cell type. 2024-08-05 17:20:15,246 cisTopic INFO generating bigwig files joblib.externals.loky.process_executor._RemoteTraceback: """ Traceback (most recent call last): File "/home/gilgolan/.local/lib/python3.11/site-packages/joblib/externals/loky/process_executor.py", line 463, in _process_worker r = call_item() ^^^^^^^^^^^ File "/home/gilgolan/.local/lib/python3.11/site-packages/joblib/externals/loky/process_executor.py", line 291, in call return self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gilgolan/.local/lib/python3.11/site-packages/joblib/parallel.py", line 589, in call return [func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/gilgolan/.local/lib/python3.11/site-packages/joblib/parallel.py", line 589, in return [func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/gilgolan/.local/lib/python3.11/site-packages/pycisTopic/pseudobulk_peak_calling.py", line 32, in _generate_bigwig fragments_df = read_fragments_to_polars_df(path_to_fragments) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gilgolan/.local/lib/python3.11/site-packages/scatac_fragment_tools/library/bigwig/fragments_to_bigwig.py", line 223, in read_fragments_to_polars_df fragments_df_pl = read_bed_to_polars_df( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/gilgolan/.local/lib/python3.11/site-packages/scatac_fragment_tools/library/bigwig/fragments_to_bigwig.py", line 127, in read_bed_to_polars_df pl.enable_string_cache(True) TypeError: enable_string_cache() takes 0 positional arguments but 1 was given

Expected behavior I expected the command to generate pseudobulk bed and bigwig files for the tutorial data.

Screenshots

Version (please complete the following information):

Additional context I installed polars-lts-cpu as I received the following error message when trying to import export_pseudobulk command: "from pycisTopic.pseudobulk_peak_calling import export_pseudobulk /home/gilgolan/.local/lib/python3.11/site-packages/polars/_cpu_check.py:240: RuntimeWarning: Missing required CPU features. The following required CPU features were not detected: avx, avx2, fma Continuing to use this version of Polars on this processor will likely result in a crash. Install the polars-lts-cpu package instead of polars to run Polars with better compatibility. Hint: If you are on an Apple ARM machine (e.g. M1) this is likely due to running Python under Rosetta. It is recommended to install a native version of Python that does not run under Rosetta x86-64 emulation. If you believe this warning to be a false positive, you can set the POLARS_SKIP_CPU_CHECK environment variable to bypass this check. warnings.warn( Process finished with exit code 132 (interrupted by signal 4:SIGILL)"

gilgolan73 commented 3 months ago

Was able to solve the issue by downgrading polars-lts-cpu package to 0.20.13 (same as polars)