You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of scanpy.
(optional) I have confirmed this bug exists on the master branch of scanpy.
What happened?
Running sc.external.tl.palantir(adata) raises TypeError: run_diffusion_maps() got an unexpected keyword argument 'data_df'. This seems to be a bug in scanpy/external/tl/_palantir.py which uses the keyword data_df which seems to have changed from data_df to data in the latest palantir version.
Minimal code sample
# from the documentation: https://scanpy.readthedocs.io/en/stable/generated/scanpy.external.tl.palantir.html#scanpy.external.tl.palantir# (the data comes with the palantir repo)importscanpy.externalassceimportscanpyasscadata=sc.read_csv(filename="Palantir/data/marrow_sample_scseq_counts.csv.gz")
sc.pp.filter_cells(adata, min_counts=1000)
sc.pp.filter_genes(adata, min_counts=10)
sc.pp.normalize_per_cell(adata)
sc.pp.log1p(adata)
sc.tl.pca(adata, n_comps=300)
sc.pp.neighbors(adata, knn=30)
sce.tl.palantir(adata, n_components=5, knn=30) # error occurs here
Error output
RuntimeError Traceback (most recent call last)
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_5717/3469234522.py in <cell line: 7>()
5 sc.tl.pca(adata, n_comps=300)
6 sc.pp.neighbors(adata, knn=30)
----> 7 sce.tl.palantir(adata, n_components=5, knn=30)
/p/project/hai_microbio/sb/miniconda3/envs/cellrank2/lib/python3.9/site-packages/scanpy/external/tl/_palantir.py in palantir(adata, n_components, knn, alpha, use_adjacency_matrix, distances_key, n_eigs, impute_data, n_steps, copy)
207208# Diffusion maps
--> 209 dm_res = run_diffusion_maps(
210 data_df=df,
211 n_components=n_components,
TypeError: run_diffusion_maps() got an unexpected keyword argument 'data_df'
After fixing the above error locally and continuing I ran into a similar error in the next step: sc.external.tl.palantir_results(...) internally callsrun_palantir(ms_data=ms_data, ...) with keyword ms_data which seems to have changed to just data in the recent version of palantir.
Palantir can now take anndata directly and the argument names have changed to a more general data. How is the status on this @soerenab? I would gladly provide a PR.
Please make sure these conditions are met
What happened?
Running
sc.external.tl.palantir(adata)
raisesTypeError: run_diffusion_maps() got an unexpected keyword argument 'data_df'
. This seems to be a bug inscanpy/external/tl/_palantir.py
which uses the keyword data_df which seems to have changed fromdata_df
todata
in the latest palantir version.Minimal code sample
Error output
Versions
The text was updated successfully, but these errors were encountered: