aertslab / pycisTopic

pycisTopic is a Python module to simultaneously identify cell states and cis-regulatory topics from single cell epigenomics data.
Other
56 stars 12 forks source link

find_diff_features Errors #95

Closed bitcometz closed 1 year ago

bitcometz commented 1 year ago

Describe the bug Log:

---------------------------------------------------------------------------
ConstantInferenceError                    Traceback (most recent call last)
[<ipython-input-129-cafc39e22e72>](https://localhost:8080/#) in <cell line: 1>()
----> 1 markers_dict= find_diff_features(cistopic_obj,
      2                       imputed_acc_obj,
      3                       variable='GEX_Seurat_cell_type',
      4                       var_features=variable_regions,
      5                       contrasts=None,

4 frames
[/usr/local/lib/python3.10/dist-packages/numba/core/dispatcher.py](https://localhost:8080/#) in error_rewrite(e, issue_type)
    407                 raise e
    408             else:
--> 409                 raise e.with_traceback(None)
    410 
    411         argtypes = []

ConstantInferenceError: Failed in nopython mode pipeline (step: nopython rewrites)
Constant inference not possible for: $102build_string.16 + $100format_value.14

File "drive/MyDrive/02.scenicplus/pycisTopic/pycisTopic/pycisTopic/diff_features.py", line 1042:
def subset_array_second_axis(arr, col_indices):
    <source elided>
    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]}")
        ^

To Reproduce From this toturial

markers_dict= find_diff_features(cistopic_obj,
                      imputed_acc_obj,
                      variable='GEX_Seurat_cell_type',
                      var_features=variable_regions,
                      contrasts=None,
                      adjpval_thr=0.05,
                      log2fc_thr=np.log2(1.5),
                      n_cpu=1,
                      _temp_dir=tmpDir + 'ray_spill',
                      split_pattern = '-')

Additional context I run the previous step successfully:

os.mkdir(outDir+'DARs')
variable_regions = find_highly_variable_features(normalized_imputed_acc_obj,
                                           min_disp = 0.05,
                                           min_mean = 0.0125,
                                           max_mean = 3,
                                           max_disp = np.inf,
                                           n_bins=20,
                                           n_top_features=None,
                                           plot=True,
                                           save= outDir + 'DARs/HVR_plot.pdf')

image

But I do not run this part:

because I cannot find this file: 9b. Co-clustering and dimensionality reduction using scRNA-seq

infile = projDir + 'output/rna/seurat/Seurat_obj_PCs.txt'

Could you please help with this problem ? Thanks !!!

ghuls commented 1 year ago

You need to install numba >= 0.57.0.

bitcometz commented 1 year ago

thanks !!! @ghuls