Open josephineyates opened 11 months ago
Hi again,
Just to give some more information, I can run find_diff_features
without any errors by directly copying the source code and removing the numba decorators.
Can you install numba >= 0.57.0
?
Hi Ghuls, Thank you for answering! So installing numba >=0.57.0 unfortunately breaks the UMAP implementation. I was running this on a Mac M1 and maybe this is related - I know there have been issues previously running UMAP on M1 chips. In any case, I've switched to running on the cluster where a fresh install of everything with latest versions worked. Leaving this here in case someone else runs into this issue. Thank you again for your time!
@josephineyates Does updating pynndescent
help? https://github.com/aertslab/pycisTopic/issues/92#issuecomment-1735438244
Hello @ghuls @SeppeDeWinter
I got the same following error by running:
from pycisTopic.diff_features import * imputed_acc_obj = impute_accessibility(cistopic_obj, selected_cells=None, selected_regions=None, scale_factor=106) normalized_imputed_acc_obj = normalize_scores(imputed_acc_obj, scale_factor=104) variable_regions = find_highly_variable_features(normalized_imputed_acc_obj, plot = False) markers_dict = find_diff_features(cistopic_obj, imputed_acc_obj, variable='celltype', var_features=variable_regions, split_pattern = '-')
Here is the error:
ConstantInferenceError Traceback (most recent call last) /Users/stur/Teaseq/Scenicplus/PB2/Scenicplus_PB2.ipynb Cell 67 line 1 ----> 1 markers_dict = find_diff_features(cistopic_obj, imputed_acc_obj, variable='celltype', var_features=variable_regions, split_pattern = '-')
File /opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/pycisTopic/diff_features.py:800, in find_diff_features(cistopic_obj, imputed_features_obj, variable, var_features, contrasts, adjpval_thr, log2fc_thr, split_pattern, n_cpu, **kwargs) 798 ray.shutdown() 799 else: --> 800 markers_list = [ 801 markers( 802 subset_imputed_features_obj, 803 barcode_groups[i], 804 contrasts_names[i], 805 adjpval_thr=adjpval_thr, 806 log2fc_thr=log2fc_thr, 807 n_cpu=1, 808 ) 809 for i in range(len(contrasts)) 810 ] 812 markers_dict = { 813 contrasts_name: marker 814 for contrasts_name, marker in zip(contrasts_names, markers_list) 815 } 817 return markers_dict
File /opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/pycisTopic/diff_features.py:801, in
File /opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/pycisTopic/diff_features.py:884, in markers(input_mat, barcode_group, contrast_name, adjpval_thr, log2fc_thr, n_cpu) 882 bg_mat = mat[:, bg_cells_index].toarray() 883 else: --> 884 fg_mat = subset_array_second_axis(arr=mat, col_indices=fg_cells_index) 885 bg_mat = subset_array_second_axis(arr=mat, col_indices=bg_cells_index) 887 log.info(f"Computing p-value for {contrast_name}")
File /opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/numba/core/dispatcher.py:480, in _DispatcherBase._compile_for_args(self, *args, **kws) 476 error_rewrite(e, 'interpreter') 477 except errors.ConstantInferenceError as e: 478 # this is from trying to infer something as constant when it isn't 479 # or isn't supported as a constant --> 480 error_rewrite(e, 'constant_inference') 481 except Exception as e: 482 if config.SHOW_HELP:
File /opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/numba/core/dispatcher.py:409, in _DispatcherBase._compile_for_args.
ConstantInferenceError: Failed in nopython mode pipeline (step: nopython rewrites) Constant inference not possible for: $102build_string.16 + $100format_value.14
File "../../../../opt/homebrew/Caskroom/miniconda/base/lib/python3.10/site-packages/pycisTopic/diff_features.py", line 1042: def subset_array_second_axis(arr, col_indices):
if np.min(col_indices) < -arr.shape[1]:
raise IndexError(f"index {np.min(col_indices)} is out of bounds for axis 1 with size {arr.shape[1]}")
^
Can you help me to troubleshoot this?
Best,
Steven
You need numba >= 0.57
.
First, I'd like thank you very much for the great work and package you created! I am trying to run the different steps in the Multiome tutorial (https://scenicplus.readthedocs.io/en/latest/pbmc_multiome_tutorial.html) and am getting stuck at the DAR step.
When I run:
I get the following error:
Any idea why this might be happening? I tried updating Numba to the latest version but this then breaks the UMAP visualization.
Here is the detail of the environment I am currently using.
Thank you for your help!