ShobiStassen / VIA

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

Arrow size meaning #4

Closed GabyBG closed 2 years ago

GabyBG commented 2 years ago

Hello,

I have found VIA to be useful for my analysis since I am currently working on python(scanpy). I have used it in one of my datasets, but the size of the arrows is too big. Is there a way to control for that? Or maybe I am doing something totally wrong.

Here is what it looks like for the Pseudotime graph image

Thank you for your help!

ShobiStassen commented 2 years ago

Hi, Thanks for your question! I haven't yet released a version with some easier ways to tune the visualisation, but perhaps for the time being I can suggest you change the source code for the function draw_pie_graph() so you can change the arrow_head_w to a smaller number. The function is in the core.py file. I'm currently traveling so it will be a couple of weeks before I can make a new release on pypip. But hopefully I can help you so you can get things working for your own use for the time being.

GabyBG commented 2 years ago

Appreciate your help while you are out of the office. I will try to change the core.py file and I will keep you posted.

ShobiStassen commented 2 years ago

Hi, just wanted to let you know that I've added in a bit more control for the visualization in the current version of VIA. for instance you can access the cluster-graph figure parameters like arrow head size through the wrapper or directly in the VIA class.

via_wrapper(adata, true_label, embedding, knn=15, ncomps=20, jac_std_global=0.15, root=[42], dataset='',
                    random_seed=1,
                    v0_toobig=0.3, v1_toobig=0.1, marker_genes=marker_genes, draw_all_curves=False, piegraph_edgeweight_scalingfactor=1.0, piegraph_arrow_head_width=0.2)

You can also control various plotting features, e.g. arrow width, dot size etc in the single cell trajectory plot

draw_trajectory_gams(embedding, super_clus_ds_PCA_loc, v1.labels, v0.labels, v0.edgelist_maxout,
                         v1.x_lazy, v1.alpha_teleport, v1.single_cell_pt_markov, true_label, knn=v0.knn,
                         final_super_terminal=v1.revised_super_terminal_clusters,
                         sub_terminal_clusters=v1.terminal_clusters,
                         title_str='Pseudotime', ncomp=ncomps, draw_all_curves=draw_all_curves, scatter_alpha=0.5, scatter_size = 50, arrow_width_scale_factor=15, linewidth=5)

You can also manualy finetune the number of edges that are visualized in the clustergraph with the class parameter visual_outgoing_edges and visual_cluster_graph_pruning