Skip to content

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

Description

@zmokhtari

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions