-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hello, I run your code
When I used my own processed single cell RNA-seq data, I got the following error,
TypeError Traceback (most recent call last)
Cell In[90], line 1
----> 1 sclkme.tl.kernel_mean_embedding(data, partition_key="louvain", X_anchor=X_anchor.todense())
File ~/anaconda3/envs/pencil_test/lib/python3.9/site-packages/sclkme/tools/_kme.py:154, in kernel_mean_embedding(adata, partition_key, X_anchor, n_pcs, use_rep, random_state, method, kernel, kernel_kwds, n_jobs, key_added, copy)
151 kme_dict["params"]["n_pcs"] = n_pcs
153 # check the input anchor matrix
--> 154 X_anchor = check_array(
155 X_anchor, dtype=np.float32, ensure_2d=True, accept_sparse=False
156 )
157 if X_anchor.shape[1] != X.shape[1]:
158 raise ValueError(
159 f"the shape: {X_anchor.shape} of input anchor matrix
160 cannot match the data representation shape in adata."
161 )
File ~/anaconda3/envs/pencil_test/lib/python3.9/site-packages/sklearn/utils/validation.py:885, in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_writeable, force_all_finite, ensure_all_finite, ensure_non_negative, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator, input_name)
882 ensure_all_finite = _deprecate_force_all_finite(force_all_finite, ensure_all_finite)
884 if isinstance(array, np.matrix):
--> 885 raise TypeError(
886 "np.matrix is not supported. Please convert to a numpy array with "
887 "np.asarray. For more information see: "
888 "https://numpy.org/doc/stable/reference/generated/numpy.matrix.html"
889 )
891 xp, is_array_api_compliant = get_namespace(array)
893 # store reference to original array to check if copy is needed when
894 # function returns
TypeError: np.matrix is not supported. Please convert to a numpy array with np.asarray. For more information see: https://numpy.org/doc/stable/reference/generated/numpy.matrix.html