Teichlab / bbknn

Batch balanced KNN
MIT License
150 stars 25 forks source link

umap error after package updates #28

Closed PaulingLiu closed 4 years ago

PaulingLiu commented 4 years ago

I updated scanpy (1.5.1), umap-learn (0.4.6) and BBKNN. But I found the following error when running the umap function:

Error in py_call_impl(callable, dots$args, dots$keywords) : 
ValueError: Unknown metric angular. Valid metrics are ['euclidean', 'l2', 'l1', 'manhattan', 'cityblock', 'braycurtis', 'canberra',
 'chebyshev', 'correlation', 'cosine', 'dice', 'hamming', 'jaccard', 'kulsinski', 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto',
 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule', 'wminkowski', 'nan_euclidean', 'haversine'], or
 'precomputed', or a callable

Here is my codes:

pca <- sce@reductions$pca@cell.embeddings
anndata = import("anndata", convert=FALSE)
sc = import("scanpy",convert=FALSE)
np = import("numpy",convert=FALSE)
bbknn = import("bbknn", convert=FALSE)
adata = anndata$AnnData(X=pca, obs=sce$patient)
sc$tl$pca(adata)

adata$obsm$X_pca = pca
bbknn$bbknn(adata, batch_key=0)
sc$tl$umap(adata)

I could run it with no problem before I update these packages. Could you help me figure this out?

ktpolanski commented 4 years ago

Does the fact you closed this imply you figured it out?

I tried to run BBKNN into SCANPY's UMAP with the specified package versions, in python as I don't have an R immediately handy, and it seemed to work just fine.