BEAST2-Dev / BEASTLabs

A package for BEAST 2 implementing generally useful stuff
6 stars 4 forks source link

TreeAnnotation to add meta data #6

Closed walterxie closed 6 years ago

walterxie commented 6 years ago

@tgvaughan @gavryushkina I think this may be interesting to you. I created TreeAnnotation when I tried to colour SA trees by a meta data instead of labels. I also updated Sasha's ConvertZBTreeToSATree to use the meta data mapping file.

TreeAnnotation annotates nodes of a tree according to an annotation map, which is imported from a tab delimited file with header (1 trait only at the moment). The 1st column is tip labels, and the 2nd is trait values.

The annotation map uses tip labels as key, and trait value as value. The trait name is given by the constructor. It can be null, in that case, then the 2nd column name from header is assigned to the trait name.

Usage: TreeAnnotation treeFile mapFilePath