ksumngs / yavsap

Yet Another Viral Subspecies Analysis Pipeline
https://ksumngs.github.io/yavsap
MIT License
1 stars 1 forks source link

[Feature]: Add reroot capability to phylogenetic tree in visualizer #12

Closed MillironX closed 2 years ago

MillironX commented 2 years ago

Summary

Add a button that reroots the phylogenetic tree on the selected node in the tree viewer in the visualizer.

Added Features

AdditionalModified visualizer section

In the phylogenetic tree viewer, add a button to the top toolbar that will reroot the phylogenetic tree on the selected node. Might have to disable it and/or add an "undo" button along side it to prevent wild trees from being generated.

More Info

Context

RAxML-NG doesn't root trees by default, and sometimes even when an outgroup is added, it does not place the outgroup as a top-level clade. For JEV, this outgroup is very important to genotyping the virus, so we need an easy way to provide it visually.

Alternatives

We could try to make a parameter or a genotype sheet label for the outgroup to have RAxML-NG perform the outgrouping for us, but I think having the ability to reroot the tree in the visualizer would be helpful anyway.

Possible implementation

Phylotree.js does provide a reroot functionality (see https://github.com/veg/phylotree.js/blob/master/API.md#rerootnode-if--phylotree). We would just need to provide a button to harness that function.