diff cpo_galaxy_tree.py @ 13:a14b12a71a53 draft

planemo upload
author jjjjia
date Sat, 25 Aug 2018 20:56:37 -0400
parents 4b2738bc81ed
children 596bf8a792de
line wrap: on
line diff
--- a/cpo_galaxy_tree.py	Fri Aug 24 19:10:42 2018 -0400
+++ b/cpo_galaxy_tree.py	Sat Aug 25 20:56:37 2018 -0400
@@ -263,7 +263,8 @@
             n.add_face(addFace(mData.CarbapenemResistanceGenes), index, "aligned")
             index = index + 1
             for i in range(len(distanceDict[list(distanceDict.keys())[0]])): #this loop adds distance matrix
-                n.add_face(addFace(list(distanceDict[n.name])[i]), index + i, "aligned")
+                if (n.name in distanceDict): #make sure the column is in the distance matrice
+                    n.add_face(addFace(list(distanceDict[n.name])[i]), index + i, "aligned")
                 
     t.render("./tree.pdf", w=5000,units="mm", tree_style=ts) #save it as a png. or an phyloxml