コード例 #1
0
ファイル: PhyloXMLIO.py プロジェクト: gitly110/python_exc
 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'))
コード例 #2
0
ファイル: PhyloXMLIO.py プロジェクト: yuanzhw/biopython
 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'))
コード例 #3
0
ファイル: PhyloXMLIO.py プロジェクト: zyha/biopython
 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"))
コード例 #4
0
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")