Skip to content

Commit

Permalink
fix a bug about the GEXF file export process
Browse files Browse the repository at this point in the history
  • Loading branch information
ggautreau committed Nov 16, 2023
1 parent faf2e50 commit 4f26d4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ppanggolin/formats/writeFlat.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def write_gexf_edges(gexf: TextIO, light: bool = True):
gexf.write(' <edges>\n')
edgeids = 0
index = pan.get_org_index()
shift = 14

for edge in pan.edges:
gexf.write(f' <edge id="{edgeids}" source="'
Expand All @@ -321,7 +322,7 @@ def write_gexf_edges(gexf: TextIO, light: bool = True):
if not light:
for org, genes_pairs in edge.get_organisms_dict().items():
gexf.write(
f' <attvalue for="{index[org] + len(index) + len(pan.metadata_sources("families")) + 2}" value="{len(genes_pairs)}" />\n')
f' <attvalue for="{index[org] + len(index) + len(pan.metadata_sources("families")) + shift}" value="{len(genes_pairs)}" />\n')
gexf.write(' </attvalues>\n')
gexf.write(' </edge>\n')
edgeids += 1
Expand Down

0 comments on commit 4f26d4d

Please sign in to comment.