Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Associate data with internal nodes via IDs #1173

Open
rbouckaert opened this issue Nov 24, 2024 · 2 comments
Open

Associate data with internal nodes via IDs #1173

rbouckaert opened this issue Nov 24, 2024 · 2 comments

Comments

@rbouckaert
Copy link
Member

For fixed tree analysis or just for initialisation, it can be useful to have a starting tree where internal nodes are identiefied by a name instead of a number. Currently, only numbers are recognised, which makes it a bit cumbersome for example for a RealParameter associated with internal nodes to define its specific values.

Perhaps the easiest is to recognise the "id" metadata as special, and assign it to the node's ID, so a three node Newick tree becomes something like ((A:1.0,B:1.0)[id="D"]:1.0,C:2.0); and have a TreeTrait that define properties for A,B,C and D.

@walterxie
Copy link
Member

walterxie commented Nov 24, 2024

Perhaps it could be more useful to use the standard format ((A:1.0,B:1.0)D:1.0,C:2.0)E:0.0; ?

https://en.wikipedia.org/wiki/Newick_format

@rbouckaert
Copy link
Member Author

@walterxie TreeParser with named leafs requires a TaxonSet to associated labels with taxa, but have to treat internal nodes differently, since they are no taxa, that is, changing the TreeParser.

Right now, it is already possible to associate names with internal nodes via meta data, e.g. ((A:1.0,B:1.0)[name="D"]:1.0,C:2.0)[name="E"];, so perhaps this is just a matter of having a way to associate data with internal node names by having a StateNodeInitialiser being aware of both the tree with its internal node names and some data source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants