aertslab / pycisTopic

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

run_umap error #181

Closed sugiYag closed 1 month ago

sugiYag commented 1 month ago

I'm following the tutorial and analyzing it. And I installed scenicplus and didn't update anything. But I'm trying to use the run_map function, but the following error occurs


TypingError Traceback (most recent call last) Cell In[56], line 1 ----> 1 run_umap( 2 cistopic_obj, 3 target = 'cell', scale=True)

File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pycisTopic/clust_vis.py:243, in run_umap(cistopic_obj, target, scale, reduction_name, random_state, selected_topics, selected_features, harmony, rna_components, rna_weight, kwargs) 241 if rna_components is None: 242 reducer = umap.UMAP(random_state=random_state, kwargs) --> 243 embedding = reducer.fit_transform(data_mat) 244 else: 245 atac_topics, rna_components, data_names = input_check(data_mat, rna_components)

File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/umap/umap_.py:2887, in UMAP.fit_transform(self, X, y, force_all_finite) 2851 def fit_transform(self, X, y=None, force_all_finite=True): 2852 """Fit X into an embedded space and return that transformed 2853 output. 2854 (...) 2885 Local radii of data points in the embedding (log-transformed). 2886 """ -> 2887 self.fit(X, y, force_all_finite) 2888 if self.transform_mode == "embedding": 2889 if self.output_dens:

File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/umap/umap_.py:2608, in UMAP.fit(self, X, y, force_all_finite) 2602 nn_metric = self._input_distance_func 2603 if self.knn_dists is None: 2604 ( 2605 self._knn_indices, 2606 self._knn_dists, 2607 self._knn_search_index, -> 2608 ) = nearest_neighbors( 2609 X[index], 2610 self._n_neighbors, 2611 nn_metric, 2612 self._metric_kwds, 2613 self.angular_rp_forest, 2614 random_state, 2615 self.low_memory, 2616 use_pynndescent=True, 2617 n_jobs=self.n_jobs, 2618 verbose=self.verbose, 2619 ) 2620 else: 2621 self._knn_indices = self.knn_indices

File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/umap/umap_.py:329, in nearest_neighbors(X, n_neighbors, metric, metric_kwds, angular, random_state, low_memory, use_pynndescent, n_jobs, verbose) 326 n_trees = min(64, 5 + int(round((X.shape[0]) ** 0.5 / 20.0))) 327 n_iters = max(5, int(round(np.log2(X.shape[0])))) --> 329 knn_search_index = NNDescent( 330 X, 331 n_neighbors=n_neighbors, 332 metric=metric, 333 metric_kwds=metric_kwds, 334 random_state=random_state, 335 n_trees=n_trees, 336 n_iters=n_iters, 337 max_candidates=60, 338 low_memory=low_memory, 339 n_jobs=n_jobs, 340 verbose=verbose, 341 compressed=False, 342 ) 343 knn_indices, knn_dists = knn_search_index.neighbor_graph 345 if verbose:

File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pynndescent/pynndescent_.py:931, in NNDescent.init(self, data, metric, metric_kwds, n_neighbors, n_trees, leaf_size, pruning_degree_multiplier, diversify_prob, n_search_trees, tree_init, init_graph, init_dist, random_state, low_memory, max_candidates, max_rptree_depth, n_iters, delta, n_jobs, compressed, parallel_batch_queries, verbose) 928 if verbose: 929 print(ts(), "NN descent for", str(n_iters), "iterations") --> 931 self._neighbor_graph = nn_descent( 932 self._raw_data, 933 self.n_neighbors, 934 self.rng_state, 935 effective_max_candidates, 936 self._distance_func, 937 self.n_iters, 938 self.delta, 939 low_memory=self.low_memory, 940 rp_tree_init=True, 941 init_graph=_init_graph, 942 leaf_array=leaf_array, 943 verbose=verbose, 944 ) 946 if np.any(self._neighbor_graph[0] < 0): 947 warn( 948 "Failed to correctly find n_neighbors for some samples." 949 " Results may be less than ideal. Try re-running with" 950 " different parameters." 951 )

File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/numba/core/dispatcher.py:468, in _DispatcherBase._compile_for_args(self, *args, **kws) 464 msg = (f"{str(e).rstrip()} \n\nThis error may have been caused " 465 f"by the following argument(s):\n{args_str}\n") 466 e.patch_message(msg) --> 468 error_rewrite(e, 'typing') 469 except errors.UnsupportedError as e: 470 # Something unsupported is present in the user code, add help info 471 error_rewrite(e, 'unsupported_error')

File ~/anaconda3/envs/scenicplus/lib/python3.11/site-packages/numba/core/dispatcher.py:409, in _DispatcherBase._compile_for_args..error_rewrite(e, issue_type) 407 raise e 408 else: --> 409 raise e.with_traceback(None)

TypingError: Failed in nopython mode pipeline (step: nopython frontend) Failed in nopython mode pipeline (step: nopython frontend) Untyped global name 'print': Cannot determine Numba type of <class 'function'>

File "../../../../home/node06/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pynndescent/pynndescent_.py", line 252: def nn_descent_internal_low_memory_parallel(

    if verbose:
        print("\t", n + 1, " / ", n_iters)
        ^

During: resolving callee type: type(CPUDispatcher(<function nn_descent_internal_low_memoryparallel at 0x7ff181737e20>)) During: typing of call at /home/node06/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pynndescent/pynndescent.py (358)

During: resolving callee type: type(CPUDispatcher(<function nn_descent_internal_low_memoryparallel at 0x7ff181737e20>)) During: typing of call at /home/node06/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pynndescent/pynndescent.py (358)

File "../../../../home/node06/anaconda3/envs/scenicplus/lib/python3.11/site-packages/pynndescent/pynndescent_.py", line 358: def nn_descent(

if low_memory:
    nn_descent_internal_low_memory_parallel(
    ^