Closed zmokhtari closed 4 years ago
We are in the process of updating the documentation on Scanpy's wrapper for Palantir. In the meanwhile, use sce.tl.palantir(adata) that will generate outputs stored directly in adata. For visualization, I recommend using Palantir methods for plotting directly from Palantir. Stay tuned for the new updated wrapper into Scanpy to be PR'd soon.
Thank you for your fast feedback. Now, I face another issue about the number of components in which I can not set it to another number in "sce.tl.palantir(adata)" ValueError: n_components=300 must be between 1 and min(n_samples, n_features)=27 with svd_solver='randomized'
And the main reason that I moved to scanpy is the performance speed
I'm sorry for the inconvenience you're having. The new updated wrapper of Palantir in Scanpy will expose many parameters including n_components. Once I have a working wrapper I will share it with you promptly. This is in the making and should be ready very soon.
I appreciate it.
@zmokhtari
A new Scanpy wrapper was just PR'd.
To get you moving, you can clone the branch update_palantir_external, checkout to update_palantir_external
, and pip install .
, to have access to the new feature.
Please let us know should have any issues.
The DocString includes an example how to use the integrated method, that is all different from the old one.
Thanks for the improvement, is it possible to turn on and off Magic imputation? I faced memory error: MemoryError Traceback (most recent call last)
MAGIC imputation made optional, and can be turned off by setting impute_data=False
Thank you very much. May I ask what should be replaced instead of tsne.loc in the following command line: mapping['DC'] = tsne.loc[pr_res.branch_probs.columns, 'x'].idxmax()
First you have to build tsne on diffusion maps which is critical for visualizing Palntir results on tsne:
sc.tl.tsne(adata, n_pcs=2, use_rep='palantir_multiscale', perplexity=150)
you must use the parameter use_rep='palantir_multiscale'
.
Then, you can assign your tsne results:
import pandas as pd
tsne = pd.DataFrame(adata.obsm['X_tsne'], columns=['x', 'y'], index=adata.obs_names)
Many thanks for your help!
Hi, It's me again :) Thanks for providing an amazing tool for single-cell data analysis. I was trying to use palantir in scanpy and I just reran the example data. However, d = sce.tl.palantir(adata) always return None for any kind of data. Could you please comment on this? I am using scanpy 1.5 and have updated Palantir to 0.2.6 Thanks in advance, Zeinab