kBET...
/home/jamesb/anaconda3/envs/scIB-python/lib/python3.7/site-packages/umap/umap_.py:349: NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function "fuzzy_simplicial_set" failed type inference due to: Untyped global name 'nearest_neighbors': cannot determine Numba type of <class 'function'>
File "../../../../../../../../../../../home/jamesb/anaconda3/envs/scIB-python/lib/python3.7/site-packages/umap/umap_.py", line 467:
def fuzzy_simplicial_set(
<source elided>
if knn_indices is None or knn_dists is None:
knn_indices, knn_dists, _ = nearest_neighbors(
^
@numba.jit()
/home/jamesb/anaconda3/envs/scIB-python/lib/python3.7/site-packages/numba/compiler.py:742: NumbaWarning: Function "fuzzy_simplicial_set" was compiled in object mode without forceobj=True.
File "../../../../../../../../../../../home/jamesb/anaconda3/envs/scIB-python/lib/python3.7/site-packages/umap/umap_.py", line 350:
@numba.jit()
def fuzzy_simplicial_set(
^
self.func_ir.loc))
/home/jamesb/anaconda3/envs/scIB-python/lib/python3.7/site-packages/numba/compiler.py:751: NumbaDeprecationWarning:
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.
For more information visit http://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit
File "../../../../../../../../../../../home/jamesb/anaconda3/envs/scIB-python/lib/python3.7/site-packages/umap/umap_.py", line 350:
@numba.jit()
def fuzzy_simplicial_set(
^
warnings.warn(errors.NumbaDeprecationWarning(msg, self.func_ir.loc))
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-13-f54eb36b4479> in <module>
20 lisi_graph_=False, # bug .cat
21
---> 22 verbose=False
23 )
/media/jamesb/OS/Users/jb2094/OneDrive - University Of Cambridge/PhD/Cambridge stem cell institute/phd/projects/_shared/pkg/scib-master/scIB/metrics.py in metrics(adata, adata_int, batch_key, label_key, hvg_score_, cluster_nmi, nmi_, ari_, nmi_method, nmi_dir, silhouette_, embed, si_metric, pcr_, cell_cycle_, organism, verbose, isolated_labels_, n_isolated, graph_conn_, kBET_, kBET_sub, lisi_graph_, trajectory_, type_)
1848 kbet_score = 1-np.nanmean(kBET(adata_int, batch_key=batch_key, label_key=label_key, type_=type_,
1849 embed = embed, subsample=kBET_sub,
-> 1850 heuristic=True, verbose=verbose)['kBET'])
1851 else:
1852 kbet_score = np.nan
/media/jamesb/OS/Users/jb2094/OneDrive - University Of Cambridge/PhD/Cambridge stem cell institute/phd/projects/_shared/pkg/scib-master/scIB/metrics.py in kBET(adata, batch_key, label_key, embed, type_, hvg, subsample, heuristic, verbose)
1592 #check if neighborhood size too small or only one batch in subset
1593 if np.logical_or(adata_sub.n_obs < 10,
-> 1594 len(adata_sub.obs[batch_key].cat.categories)==1):
1595 print(f"{clus} consists of a single batch or is too small. Skip.")
1596 score = np.nan
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/pandas/core/generic.py in __getattr__(self, name)
5174 or name in self._accessors
5175 ):
-> 5176 return object.__getattribute__(self, name)
5177 else:
5178 if self._info_axis._can_hold_identifiers_and_holds_name(name):
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/pandas/core/accessor.py in __get__(self, obj, cls)
173 # we're accessing the attribute of the class, i.e., Dataset.geo
174 return self._accessor
--> 175 accessor_obj = self._accessor(obj)
176 # Replace the property with the accessor object. Inspired by:
177 # http://www.pydanny.com/cached-property.html
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/pandas/core/arrays/categorical.py in __init__(self, data)
2591
2592 def __init__(self, data):
-> 2593 self._validate(data)
2594 self._parent = data.values
2595 self._index = data.index
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/pandas/core/arrays/categorical.py in _validate(data)
2601 if not is_categorical_dtype(data.dtype):
2602 raise AttributeError(
-> 2603 "Can only use .cat accessor with a " "'category' dtype"
2604 )
2605
AttributeError: Can only use .cat accessor with a 'category' dtype
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-14-f5d298b6424b> in <module>
20 lisi_graph_=False, # bug .cat
21
---> 22 verbose=False
23 )
/media/jamesb/OS/Users/jb2094/OneDrive - University Of Cambridge/PhD/Cambridge stem cell institute/phd/projects/_shared/pkg/scib-master/scIB/metrics.py in metrics(adata, adata_int, batch_key, label_key, hvg_score_, cluster_nmi, nmi_, ari_, nmi_method, nmi_dir, silhouette_, embed, si_metric, pcr_, cell_cycle_, organism, verbose, isolated_labels_, n_isolated, graph_conn_, kBET_, kBET_sub, lisi_graph_, trajectory_, type_)
1875
1876 if hvg_score_:
-> 1877 hvg_score = hvg_overlap(adata, adata_int, batch_key)
1878 else:
1879 hvg_score = np.nan
/media/jamesb/OS/Users/jb2094/OneDrive - University Of Cambridge/PhD/Cambridge stem cell institute/phd/projects/_shared/pkg/scib-master/scIB/metrics.py in hvg_overlap(adata_pre, adata_post, batch, n_hvg)
421
422 else:
--> 423 hvg_pre_list = precompute_hvg_batch(adata_pre, batch, hvg_post)
424
425
/media/jamesb/OS/Users/jb2094/OneDrive - University Of Cambridge/PhD/Cambridge stem cell institute/phd/projects/_shared/pkg/scib-master/scIB/metrics.py in precompute_hvg_batch(adata, batch, features, n_hvg, save_hvg)
399 print(i.obs[batch][0]+' has less than the specified number of genes')
400 print('Number of genes: '+str(i.n_vars))
--> 401 hvg = sc.pp.highly_variable_genes(i, flavor='cell_ranger', n_top_genes=n_hvg_tmp, inplace=False)
402 hvg_dir[i.obs[batch][0]] = i.var.index[hvg['highly_variable']]
403 adata_list=None
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/scanpy/preprocessing/_highly_variable_genes.py in highly_variable_genes(adata, min_disp, max_disp, min_mean, max_mean, n_top_genes, n_bins, flavor, subset, inplace, batch_key)
258 n_top_genes=n_top_genes,
259 n_bins=n_bins,
--> 260 flavor=flavor,
261 )
262 else:
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/scanpy/preprocessing/_highly_variable_genes.py in _highly_variable_genes_single_batch(adata, min_disp, max_disp, min_mean, max_mean, n_top_genes, n_bins, flavor)
124 -np.inf,
125 np.percentile(df['means'], np.arange(10, 105, 5)),
--> 126 np.inf
127 ])
128 disp_grouped = df.groupby('mean_bin')['dispersions']
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/pandas/core/reshape/tile.py in cut(x, bins, right, labels, retbins, precision, include_lowest, duplicates)
268 include_lowest=include_lowest,
269 dtype=dtype,
--> 270 duplicates=duplicates,
271 )
272
~/anaconda3/envs/scIB-python/lib/python3.7/site-packages/pandas/core/reshape/tile.py in _bins_to_cuts(x, bins, right, labels, precision, include_lowest, dtype, duplicates)
385 "Bin edges must be unique: {bins!r}.\nYou "
386 "can drop duplicate edges by setting "
--> 387 "the 'duplicates' kwarg".format(bins=bins)
388 )
389 else:
ValueError: Bin edges must be unique: array([ -inf, 6.89655170e-03, 1.03448275e-02, 1.03448275e-02,
1.37931034e-02, 1.72413792e-02, 2.06896551e-02, 2.41379309e-02,
2.75862068e-02, 3.10344826e-02, 3.44827585e-02, 4.13793102e-02,
5.51724136e-02, 7.24137947e-02, 9.31034461e-02, 1.31034479e-01,
1.93103448e-01, 2.96551734e-01, 5.82758605e-01, 3.50999985e+01,
inf]).
You can drop duplicate edges by setting the 'duplicates' kwarg
I can't quite figure out what's going on. Any help appreciated!