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):
for e in ei:
ea = cg.getEdgeAttr(*e)
path = ea['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=max(min(math.ceil(math.log10(g)),4)*64-1,0)
color="#00%02X%02X" % (g,255-g)
else:
color="#0000FF"
graphics = ea.get('graphics',{})
graphics['arrow']='last'
graphics['fill']=color
ea['graphics']=graphics
ea['ingene']=g
ea['genepos']=ep
if ea['class']=="sequence":
path = ea['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=max(min(math.ceil(math.log10(g)),4)*64-1,0)
color="#00%02X%02X" % (g,255-g)
else:
color="#0000FF"
graphics = ea.get('graphics',{})
graphics['arrow']='last'
graphics['fill']=color
ea['graphics']=graphics
ea['ingene']=g
ea['genepos']=ep
......
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