comparison ete_genetree_splitter.py @ 7:6a5282f71f82 draft

planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/ete commit 55116304ad98416757ad689c9a885dd0967f120e
author earlhaminst
date Thu, 11 Oct 2018 11:52:28 -0400
parents 077021c45b96
children b29ee6a16524
comparison
equal deleted inserted replaced
6:f1eca1158f21 7:6a5282f71f82
17 options, args = parser.parse_args() 17 options, args = parser.parse_args()
18 18
19 if options.genetree is None: 19 if options.genetree is None:
20 parser.error("--genetree option must be specified, GeneTree in nhx format") 20 parser.error("--genetree option must be specified, GeneTree in nhx format")
21 21
22 with open(options.genetree, 'r') as f:
23 contents = f.read()
24
25 # Remove empty NHX features that can be produced by TreeBest but break ete3
26 contents = contents.replace('[&&NHX]', '')
27
22 # reads single gene tree 28 # reads single gene tree
23 genetree = PhyloTree(options.genetree) 29 genetree = PhyloTree(contents)
24 30
25 # sets species naming function 31 # sets species naming function
26 if options.gene_node == 0: 32 if options.gene_node == 0:
27 genetree.set_species_naming_function(parse_sp_name) 33 genetree.set_species_naming_function(parse_sp_name)
28 34