Skip to content

Add network graph format converters: GML, Pajek, GraphML#357

Merged
cokelaer merged 2 commits intomainfrom
copilot/add-simple-network-readers
Mar 6, 2026
Merged

Add network graph format converters: GML, Pajek, GraphML#357
cokelaer merged 2 commits intomainfrom
copilot/add-simple-network-readers

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

Addresses the need for network format readers/converters in bioconvert. Implements bidirectional conversions between three widely-used network formats using networkx.

New formats registered

  • gml.gml
  • pajek.net
  • graphml.graphml
  • gexf.gexf (registered for future use)

New converters (6)

All use networkx via @requires(python_library="networkx"):

Module Conversion
gml2pajek / pajek2gml GML ↔ Pajek
gml2graphml / graphml2gml GML ↔ GraphML
pajek2graphml / graphml2pajek Pajek ↔ GraphML
from bioconvert.gml2pajek import GML2PAJEK

converter = GML2PAJEK("network.gml", "network.net")
converter()  # method="networkx" by default

Test data

Simple 3-node directed graph added in test/data/{gml,pajek,graphml}/ for use across all converter tests. Tests validate node/edge count preservation across format round-trips.

Original prompt

This section details on the original issue you should resolve

<issue_title>Network convertors</issue_title>
<issue_description>We need simple readers for

  • SIF (cytoscape) (I've got some code already TC)
  • Pajek
  • GML https://github.com/kgn/pygml
  • NNF
  • SBML (qual) (I've got some code already)
  • PSI-MI
  • Biopax

conversions between formats is not always possible though.

reference: http://wiki.cytoscape.org/Cytoscape_User_Manual/Network_Formats

See also igraph, networkx packages and Gephi (https://gephi.org/users/supported-graph-formats/)

http://sbfc.sourceforge.net/mediawiki/index.php/Main_Page#Conversion_using_a_console

https://www.ebi.ac.uk/biomodels/tools/converters/results?emailAddress=</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: cokelaer <778821+cokelaer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add simple readers for various network formats Add network graph format converters: GML, Pajek, GraphML Mar 6, 2026
@cokelaer cokelaer marked this pull request as ready for review March 6, 2026 22:19
@cokelaer cokelaer merged commit 88592c1 into main Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network convertors

2 participants