ShobiStassen / VIA

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

new release and beautify #22

Open wangjiawen2013 opened 1 year ago

wangjiawen2013 commented 1 year ago

Hi,

I am very interested in your excellent work!

I notice that there are only one release of VIA. Is VIA still under maintenance ? And, the plots in the jupytor tutorials are not beautiful, hope you to improve the visualization capacity of VIA. I am a scanpy user and usually process single cell data using python code. I think VIA maybe an suitable tools for trajectory inference.

ShobiStassen commented 1 year ago

Hi, You could consider using the streamplot functions and the streamplot animations (on the readthedocs page), it's also possible to plot the via clustergraphs in a few different ways (colored according to gene/feature intensity or pseudotime etc) and change the size/cmaps of the clusters and edgewidths. Increasing the cluster resolution (by changing too_big_factor and/or, jac_std_global, and/or resolution_parameter and/or knn) will also enable you to see more granular edges and clusters and you can tune the number of edges with cluster_graph_pruning_std and/or edgebundle_pruning parameter. You might then be able to better observe how the edgebundling allows you to see quite busy graphs

ShobiStassen commented 1 year ago

@wangjiawen2013 I should mention that we are also working on a Via2.0 but still testing

wangjiawen2013 commented 1 year ago

Good, looking forward to it. I used monocle, palantir, paga, RNA velocity, cellrank and never satisfied with them.

wangjiawen2013 commented 1 year ago

@ShobiStassen I tried VIA following the tutorials (multifurcating.ipynb), and the it showed: image I think TS7,8,9,and 10 are terminal states. what do the arrows between TS8 and TS9 ? Because both TS8 and TS9 are terminal nodes, so it's more reasonable that there is no relationship between TS8 and TS9. And, it's also the case between TS10 and TS7. There are similar results in the nature communications paper of VIA (Fig. 4f, arrow between beta-1 and beta-2. And Fig. 2a). Can you help me to explain the results ?

wangjiawen2013 commented 1 year ago

image

image The above are arrows between red circles in the paper.

wangjiawen2013 commented 1 year ago

Hi, another question: image what does pop41, pop85......mean on the above plot ?

ShobiStassen commented 1 year ago

hi, in real data adjacent "terminal states" may represent sub populations of a differentiated (i.e. late stage) cell type and because these cell types are related (phenotypically, in some way), some edges may be present between them

ShobiStassen commented 1 year ago

pop41 means that cluster has 41 cells in it :)

wangjiawen2013 commented 1 year ago

Thanks for your quickly reply! I am in Beijing so we are in the same time zone. Now I am still running the tutorials. Does scATAC-seq_HumanHematopoiesis.ipynb out of date ? In [320]: tsi_list = via.get_loc_terminal_states(v0,X_in)

AttributeError Traceback (most recent call last)

in ----> 1 tsi_list = via.get_loc_terminal_states(v0,X_in) AttributeError: module 'pyVIA.core' has no attribute 'get_loc_terminal_states' In [321]: tsi_list = via.get_loc_terminal_states(v0, X_in) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in ----> 1 tsi_list = via.get_loc_terminal_states(v0, X_in) AttributeError: module 'pyVIA.core' has no attribute 'get_loc_terminal_states'
wangjiawen2013 commented 1 year ago

And how to save the results of run_VIA ? Then we can load it again and plot the figures or do other things.

ShobiStassen commented 1 year ago

Hi, let me look tomorrow but it's prob out of date. Can you have a look at the other tutorials on the readthedocs page to show how to plot the different outputs, i think they will be more up to date and easier to call

wangjiawen2013 commented 1 year ago

Hi, I find another problems. The pseudotime colorbar on the right ranges from 0 to 10. It should 0 to 1, is it ? image

ShobiStassen commented 1 year ago

hi hi! in this case i have just scaled the pt for plotting purposes by a factor of 10 in terms of retrieving the results, you would have to save some of the attributes - see here like the branching probabilities/ pseudotime values in a list/dataframe column.

wangjiawen2013 commented 1 year ago

Hi, I think you mean this chunk of code of draw_piechart_graph() in plotting_via.py: if type_data == 'pt': pt = via0.scaled_hitting_times # these are the final MCMC refined pt then slightly scaled at cluster level title_ax1 = "Pseudotime"

However you use single_cell_pt_markov in the function draw_trajectory_gams() in plotting_via.py: sc_pt_markov = list(np.asarray(via_fine.single_cell_pt_markov[idx])) Are there any difference ? Can I just divide scaled_hitting_times by 10 in the draw_piechart_graph or replace it with single_cell_pt_markov ?

wangjiawen2013 commented 1 year ago

My email is wangjiawen2013@163.com, could you send your email to me ? I want to send you a ppt, where I revised the plotting code, both the code and the figures are in the ppt. The newly generated figures by VIA are beautiful and achieve publication quality now !

Starlitnightly commented 1 year ago

Hi @wangjiawen2013

I recently encountered the same issue with pyVIA's visual beautification. You can use the raw color to plot celltype with VIA in Pyomic. The tutorial of pyVIA can be found at here.

Example:

image