def property(self, elem): return PX.Property(elem.text.strip(), elem.get('ref'), elem.get('applies_to'), elem.get('datatype'), unit=elem.get('unit'), id_ref=elem.get('id_ref'))
def property(self, elem): """Create properties from external resources.""" return PX.Property(elem.text.strip(), elem.get('ref'), elem.get('applies_to'), elem.get('datatype'), unit=elem.get('unit'), id_ref=elem.get('id_ref'))
def property(self, elem): """Create properties from external resources.""" return PX.Property(elem.text.strip(), elem.get("ref"), elem.get("applies_to"), elem.get("datatype"), unit=elem.get("unit"), id_ref=elem.get("id_ref"))
def output_xml(coloured_trees, path, colour_branches): # adding font as a property of each tip clade, to show colour coloured_trees = [ PhyloXML.Phylogeny.from_tree(tree) for tree in coloured_trees ]# convert to PhyloNexus for tree in coloured_trees: for clade in tree.get_terminals(): value = BranchColor.to_hex(clade.color) # value of the property (ie the colour) clade.properties = [PhyloXML.Property(value, "style:font_color", "node", "xsd:token")] if not colour_branches: for clade in tree.get_nonterminals() + tree.get_terminals(): clade.color = None Phylo.write(coloured_trees, path, "phyloxml")