Skip to content

Commit

Permalink
Merge pull request #143 from labgem/fix_gexf_bug
Browse files Browse the repository at this point in the history
fix a bug about the GEXF file export process
  • Loading branch information
axbazin authored Nov 18, 2023
2 parents 8788c45 + 4f26d4d commit 83a3925
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 83a3925

Please sign in to comment.