LouisFaure / scFates

a scalable python suite for tree inference and advanced pseudotime analysis from scRNAseq data.
https://scfates.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
49 stars 1 forks source link

get a weird figure following the notebook named Bone marrow fates #32

Open huili469r opened 4 months ago

huili469r commented 4 months ago

Hi!. I try to show the differentiation trajectory of HSC followed the tutorial. After PCA, diffusion, palantir, I got a unexpected figure.

image

The branch tip cells looks like a string. I try to add the components of PCA as the input of diffusion. I also try to reduce the number of progenitor cells. But Both don't work. Can you give me some advices? Thanks a lot. pca_projections =pd.DataFrame(adata.obsm["X_pca"],index=adata.obs_names) dm_res = palantir.utils.run_diffusion_maps(pca_projections, n_components=40, knn=30) ms_data = palantir.utils.determine_multiscale_space(dm_res, #n_eigs=4 adata.obsm["X_palantir"]=ms_data.values sc.pp.neighbors(adata,n_neighbors=25,use_rep="X_palantir") adata.obsm["X_pca2d"]=adata.obsm["X_pca"][:,:2] sc.tl.draw_graph(adata,init_pos='X_pca2d') sc.pl.draw_graph(adata,color="celltype")

LouisFaure commented 4 months ago

Are you using ForceAtlas2 algorithm? I think that sc.tl.draw_graph uses another one if it is not installed which can lead to such overlapping branches. FA2 seems to be not well maintained these days unfortunately, I would recommend to try out instead openTSNE package, and use a high exaggeration parameter (around 2 to 4).

Some dataset also do not requires diffusion maps as intermediate step and can produce well connected embeddings with clear branch separation with FA2/openTSNE applied directly on PC space.