ShobiStassen / VIA

trajectory inference
https://pyvia.readthedocs.io/en/latest/
MIT License
76 stars 20 forks source link

Cluster composition graph and influential genes in pseudo-time analysis #36

Open nilesh-iiita opened 1 year ago

nilesh-iiita commented 1 year ago

Hi,

Is there any way I extract the pie composition from the cluster composition graph and information regarding the contribution of genes toward pseudo-time branching from the fine-grained pseudo-time analysis?

Thanks

Starlitnightly commented 1 year ago

Hi,

You can use this code to solve:

type(v0)#via_object of pyVIA
cluster_i_loc=np.where(np.asarray(v0.labels) == 1)[0]
dict(adata.obs.iloc[cluster_i_loc].value_counts('label'))

cluster_i_loc give the position of the composition of pie chart you interested in adata.obs. If you think this is difficult, you can also try the Pyomic package I developed, which integrates pyVIA, and you can get the composition of a given pie directly via Pyomic.single.pyVIA.get_piechart_dict(label=0, cluster='cell_type'). Let me know if you have any questions or feedback. Thanks!"