Commit 41e7ce4e by Eric Coissac

Fix a color bug for gaps in GML output

parent 679a0ec4
...@@ -293,22 +293,23 @@ def genesincontig(cg,index,matches): ...@@ -293,22 +293,23 @@ def genesincontig(cg,index,matches):
for e in ei: for e in ei:
ea = cg.getEdgeAttr(*e) ea = cg.getEdgeAttr(*e)
path = ea['path'] if ea['class']=="sequence":
eg = [vread(i) for i in path] path = ea['path']
ep = [genes.get(abs(i),()) for i in path] eg = [vread(i) for i in path]
ep = [genes.get(abs(i),()) for i in path]
g = sum(i for i in eg if i > 0)
if g > 0: g = sum(i for i in eg if i > 0)
g=max(min(math.ceil(math.log10(g)),4)*64-1,0) if g > 0:
color="#00%02X%02X" % (g,255-g) g=max(min(math.ceil(math.log10(g)),4)*64-1,0)
else: color="#00%02X%02X" % (g,255-g)
color="#0000FF" else:
graphics = ea.get('graphics',{}) color="#0000FF"
graphics['arrow']='last' graphics = ea.get('graphics',{})
graphics['fill']=color graphics['arrow']='last'
ea['graphics']=graphics graphics['fill']=color
ea['ingene']=g ea['graphics']=graphics
ea['genepos']=ep ea['ingene']=g
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment