dpeerlab / Palantir

Single cell trajectory detection
https://palantir.readthedocs.io
GNU General Public License v2.0
203 stars 45 forks source link

error on Run diffusion maps (KeyError: 'distances') #33

Closed zmokhtari closed 4 years ago

zmokhtari commented 4 years ago

Hi, I am trying to use Palantir for mass cytometry data. I started first to reproduce the example data that you provided, however, I faced this error message: dm_res = palantir.utils.run_diffusion_maps(pca_projections, n_components=5)

KeyError Traceback (most recent call last)

in 1 # Run diffusion maps ----> 2 dm_res = palantir.utils.run_diffusion_maps(pca_projections, n_components=5 ,knn=30, n_jobs=-1, alpha=0) ~/.local/lib/python3.7/site-packages/palantir/utils.py in run_diffusion_maps(data_df, n_components, knn, n_jobs, alpha) 41 temp = sc.AnnData(data_df.values) 42 sc.pp.neighbors(temp, n_pcs=0, n_neighbors=knn) ---> 43 kNN = temp.uns['neighbors']['distances'] 44 45 # Adaptive k KeyError: 'distances' could you please help me to figure out what is going wrong? Thanks in advance, Zeinab
awnimo commented 4 years ago

Thank you @zmokhtari for using our package. Please, upgrade to the latest release here