ShobiStassen / VIA

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

3d plots #5

Open j-bac opened 2 years ago

j-bac commented 2 years ago

Thanks for the nice work and package ! Is there any way to predict 3d edge positions ? Or the only way is to predict for dimension (0,1) and then (0,2) to assemble a guess ?

ShobiStassen commented 2 years ago

Hi! sorry for the late reply (I have been travelling) and thanks for writing. Do you mean you would want to plot the VIA cluster graph model in 3D? currently the coordinates are only computed for a 2D representation using igraphs layout_fruchterman_reingold() function. iGraph can also generate a 3D set of coordinates but I have not tested this yet (have now added it to my TODO list in the coming months).

If it is something you wanted to experiment with sooner than later, you can try to modify line 2555 in core.py (in your python3.7/site-packages/pyVIA/core.py file) which currently reads as

  layout = locallytrimmed_g.layout_fruchterman_reingold(weights='weight')

to

locallytrimmed_g.layout_fruchterman_reingold_3d(weights = 'weight')

you can look at different ways to view the plotted graph here: https://igraph.org/python/doc/tutorial/visualisation.html

Will let you know when I get around to working on it but maybe this will help in the mean time. Shobi