I may have found a way to go, but I'd like to know what I was doing wrong 
before.
Now I don't create a new graph by union, but this (as vertex numbers and 
indexes are the same):

gu = gt.Graph(directed=False)
gu.add_vertex(g_atac.num_vertices())
layer = gu.new_edge_property('int')
for e in g_rna.edges():
    ne = gu.add_edge(e.source(), e.target())
    layer[ne] = -1
for e in g_atac.edges():
    ne = gu.add_edge(e.source(), e.target())
    layer[ne] = 1    
gu.ep['layer'] = layer

this works and the final graph has 2 layers and no extra zeros
_______________________________________________
graph-tool mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to