Closed Yansr3 closed 5 months ago
Of course! You might find the docstring of the function helpful:
plot_palantir_results(
data: Union[anndata._core.anndata.AnnData, pandas.core.frame.DataFrame],
pr_res: Optional[palantir.presults.PResults] = None,
embedding_basis: str = 'X_umap',
pseudo_time_key: str = 'palantir_pseudotime',
entropy_key: str = 'palantir_entropy',
fate_prob_key: str = 'palantir_fate_probabilities', **kwargs
)
Plot Palantir results on t-SNE or UMAP plots.
Parameters
----------
data : Union[sc.AnnData, pd.DataFrame]
Either a Scanpy AnnData object or a DataFrame of tSNE or UMAP results.
pr_res : Optional[PResults]
Optional PResults object containing Palantir results. If None, results are expected to be found in the provided AnnData object.
embedding_basis : str, optional
The key to retrieve UMAP results from the AnnData object. Defaults to 'X_umap'.
pseudo_time_key : str, optional
Key to access the pseudotime from obs of the AnnData object. Default is 'palantir_pseudotime'.
entropy_key : str, optional
Key to access the entropy from obs of the AnnData object. Default is 'palantir_entropy'.
fate_prob_key : str, optional
Key to access the fate probabilities from obsm of the AnnData object. Default is 'palantir_fate_probabilities'.
**kwargs
Additional keyword arguments passed to `ax.scatter`.
Returns
-------
matplotlib.pyplot.Figure
A matplotlib Figure object representing the plot of the Palantir results.
It seems you might only have to flip the order of arguments to
palantir.plot.plot_palantir_results(tsne, pr_res)
Please let me know if this resolved the issue.
Thank you very much, the issue is resolved.
You are very welcome!
Hello,
I was trying to run palantir on my dataset. When try to visualize the result, I got this error.
I checked pr_res.branch_probs and it looks fine.
May I ask if there is any advice for plotting the result?
Thank you!