diff 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
line wrap: on
line diff
--- a/ete_genetree_splitter.py	Wed Oct 10 05:24:04 2018 -0400
+++ b/ete_genetree_splitter.py	Thu Oct 11 11:52:28 2018 -0400
@@ -19,8 +19,14 @@
     if options.genetree is None:
         parser.error("--genetree option must be specified, GeneTree in nhx format")
 
+    with open(options.genetree, 'r') as f:
+        contents = f.read()
+
+    # Remove empty NHX features that can be produced by TreeBest but break ete3
+    contents = contents.replace('[&&NHX]', '')
+
     # reads single gene tree
-    genetree = PhyloTree(options.genetree)
+    genetree = PhyloTree(contents)
 
     # sets species naming function
     if options.gene_node == 0: