pyNetConv - Network Conversion Tool


2005-08-30 (v0.12)
2005-08-22 (v0.11.2)
2005-08-16 (v0.11)
2005-07-21 (v0.10.2)
2005-07-21 (v0.10.1)
2005-07-13 (v0.10)
Now using distutils. See installation instructions.

2005-07-08 (v0.9)
Functions to import/export network as a list added. With this, it is possible to use some other tools to graph manipulation such as the great NetworkX. See this section for more details.

2005-05-20 (v0.8.1)
See changelog for changes

2005-04-25 (v0.8)
Support for expression data added.

2005-04-19 (v0.7)
GUI added! See screenshots

2005-04-13 (v0.6)
Files uploaded to the project page

What is pyNetConv?

pyNetConv is a Python library created to help the conversion of some network file formats.

Since version 0.6, pyNetConv is capable to read/write (and convert from/to) the following file formats:

And from version 0.8 it is able to import tab-separated values exported by Affymetrix Micro Array Suite 5.0 (MAS5) and export this data as Cytoscape node attributes or expression data (.pval file).

pyNetConv is a library to create a software that is able to read/write networks in the formats supported by pyNetConv. If all you want is convert the files without the need create a program, then the Graphical user interface is for you. See the screenshots session to see how the GUI looks like.


The motivation for creating this tool was that there are many good graph visualization/layout tools available (each one with strengths in some areas) but sometimes they have incompatible file formats (this is true for Pajek and Cytoscape). Some tools can read/write GML files, while other not.

So with pyNetConv we plan to fill this gap allowing the user to exchange files between this tools and use the best features of each tool to generate the final graph.

How it works

pyNetConv is developed as a library, so one can write his own code and use pyNetConv to import/export the network in the formats supported.


  n = Network()
  importPajek(n, '')
  importPajekClu(n, 'network.clu')
  exportCyAttributes(n, 'network.cluster')
  exportGML(n, 'network.gml') # network + cluster information

Using NX

If you want to import a GML, Pajek or SIF file to use with NetworkX, you can do the following:

  import netconv
  import networkx as NX
  n = netconv.Network()
  netconv.importPajek(n, '')
  G = NX.Graph()
  # from here, work with G


Documentation is on plans. For now you can take a look at the pyNetConv API for some documentation.


Future plans



Only Python is required to run pyNetConv. You can get it from the Python web site.

Install from source

Download the files from the project page.

After unpacking the file, execute:

  python install

in the package new created folder to install it.

To use the graphical interface run the file

Win32 installation

For Windows, you can download the Win32 installer (with extension .exe). If you want the documentation of the API, you should also download the source code (it is not included in the Win32 installer).


Moved to a separate file


What is the multiplier in the GML export function?

Pejek stores the nodes coordinates using a number between 0 and 1, representing the position on the graph as a percent value.

GML files store this information as absolute values representing the position on the graph.

To convert from GML to Pajek, pyNetConv divides all the positions by the biggest value, generating values between 0 and 1, but for Pajek to GML, there is no easy way to guess the value to convert (it depends on many factors, as the number of nodes, their positions, etc), so the user should inform a value to multiply all the coordinates in Pajek to put them in the GML file. The user should find out the one that fits best to his/her network. A good start is 1000.

I am using Windows. Where is installed?

In the Python scripts folder. For example, for Python 2.4 it should be:



Author: Márcio Rosa da Silva
<mrs (a) gbf de> Logo