More information about JNets

The following different sections explain the JNets network visualization software in more detail. It is recommended that these sections are read in order to fully understand JNets.

Motivation behind building JNets

JNets main features in detail

Creating an input file for JNets

Creating a config file for JNets

Step-by-step guide to deploying a JNets from a website


Motivation behind building JNets

To create a simple yet powerful tool that can produce interactive ("clickable") visualizations of networks. This tool must be easy to set up and use, capable of some useful network analysis and be platform independent. InterView, written by John Pinney was used as a base for JNets and analysis capabilities (and other functions) were added. JNets was designed with biological networks in mind but is sufficiently generic that any type of network data can be used.

JNets was not designed to replace heavier applications like Cytoscape, rather JNets is designed to provide some middle ground between the simple and the complex.

Back to top

JNets main features in detail

Clickable nodes and edges

Nodes can be dragged and moved at the mouse point. Right-clicking on nodes or edges brings up a popup menu with several options (see the readme for full details), among these options is information about that node or edge, such as it's name and any accompanying annotation that JNets knows.

Dynamic node and edge groups

Nodes and edges in a JNets network are always assigned to a group. Initially these groupings come from the input file. However, the user can create new groupings by selecting elements based on their annotation. For example, a group of proteins (nodes) may be split in to groups based on the organism that they come from. However, the user could regroup the proteins according to whether they are essential or not. These groups are created using an SQL-like query system, using the annotation as variables. Using this, queries can be built e.g. you could look for essential proteins that are from Human and Chimpanzee but not present in Mouse.

Moreover, JNets allows edge groups to be created based on node annotation and vice versa; as JNets knows what nodes and edges are in contact with one another. For example, a group of protein interactions (edges) could be created by selecting all those interactions that involve an essential protein.

Edit node and edge groups

One of the reasons for having different node and edge groups, is so that you can edit them seperately. Much of this editing in JNets changes the way they look or behave; you can hide them, delete them, isolate them, change their color, change their size, turn their labels on and off, stick them down to prevent their movement, unstick them and more.

Investigate node and edge annotation

The main JNets data mining feature in JNets is the capability to cross examine groups of nodes or edges to explore their annotation. This can be done in a qualitative way; by vizualizing the network, or quantatatively; by using an in-built JNets feature, whereby annotation can be queried and even tested for over and under representation using statistical measures like the Fisher's Exact test.

Configure the user interface and preset network views

Because JNets has been designed to allow networks to be deployed from a website, it's best that the web-master can configure the interface and include some preset views for the user to look at. So When the JNets applet loads, it looks for a confuration file. The menubar menus can be enabled or disabled as can the separate right click options. The grouping menu can be disabled to prevent users from making new groups and the edit menu can be customised. Any number of predetermined node and edge groups can be given in the configuration files; these subgroupings are shown in custom menus and on selection, alter the view of the network. Please click the "Launch JNets" button to see this in action. In addition, the zoom and rotation of the main graph can be set so that it can be viewed as best as possible.

Back to top

Creating an input file for JNets

The easiest and most reliable way of creating an input file for JNets is by using the tab-delim converter function that is found in the File menu of the JNets application. This reads in a tab-delimited data file and outputs a JNets compatible XGMML file. In the tab delim file, nodes should come first, then edges, then annotation. One node per line, one edge per line, one annotation value per line. Nodes should be in the format:

id name group x-coord y-coord

Edges in the format:

id name group sourceNodeId targetNodeId edgeType

Annotations in the format:

annotId name valueType forElementType multipleAnnotationBoolean elementId value

If elements can have more than one incidence of a particular annotation, this is classed as a multiple annotation, and must be entered slightly differently.

For a detailed explanation see the readme file found in the JNets package, that you can download by clicking here.

Back to top

Creating a config file for JNets

JNets config files are short, simple XML files. The best way to build your own config file is to download the JNets package by clicking here. In this package is a file called configTemplate.config. This file, as the name suggests is a template config file to customize. This file has plenty of comments to explain each part.

Much of this customization will involve setting the enable attributes in tags to enable JNets features. In addition to this, a custom menu (drop down menu) template is given; details of each custom menu and the items shown in the custom menu, must be given in the config file. The custom menu items contain filters, to filter nodes and edges from the main graph. An autofilter example and a manualfilter example are given. To use these you will have to fill in the filter details. Any number of these filters, custom menu items and custom menus may be configured. For a detailed explanation please see the readme file in the JNets download package.

Back to top

Using JNets to display your network from a website

To do this you need to do the following things:

  1. Download the JNets package from here. Unzip it and put the "JNets_applet" folder in the public place that will host the website.
  2. Create an input file (click here for more details on how to do this). Put this input file in the "JNets_applet/data_files" folder.
  3. If you want a customised configuration of JNets, create a config file (click here for details of this) and put this in the "JNets_applet/data_files" folder.
  4. Open the "JNets_applet/JNets_launch.html" file using a text editor and change the param attribute VALUE that has NAME=xgmml to correspond to the file name of your XGMML file. Then change the param attribute VALUE that has NAME=config to correspond to the file name of your configuration file. If you do not have a configuration file, just remove this line.
  5. Finally, in the HTML file that will launch the applet put the following line in the <head> section:

    <script src="./JNets_applet/launchApplet.js" type="text/javascript"></script>

    And a launch button wherever you like using code something like this:

    <input type="button" value = "Launch JNets" onclick='launchApplet("./JNets_applet/JNets_launch.html")'>

    Remember that the path to JNets_launch.html must be relative to the location of your webpage. Have a look at the source code on the launch page if you want to see an example.

Back to top


Q. Is JNets open source?

A. Yes, you can download the source code by clicking here.

Q. Can JNets perform graph theory-like calculations?

A. No, to do this you'd probably be best to use a specialist R package (e.g. the graph package), Cytoscape or similar. The data mining that JNets can undertake is all based around the annotation that accompany the graph. However, this annotation can be numerical, like graph theory data e.g. node degree.

Q. Will there be regular version updates of JNets?

A. As JNets has been produced as part of a PhD project, JNets will not be constantly redeveloped (no time!). In the event that you find a bug, or just want to make a comment about JNets functionality, please contact: Alternatively, as JNets is open source, you can download it from here and make changes yourself.

Q. Is there a JNets Java API?

A. No, JNets uses many classes from InterView and Touchgraph, that do not have APIs, so a JNets API would be incomplete. However, if you have any questions please contact:

Q. How large a graph can JNets render?

A. Run as an application, we have rendered the entire human proteome with all nodes and edges from the Human Protein Interaction Database; while this is possible, the graph takes a minute or so to load and the user interface is a bit slow. With a few thousand nodes and a few thousand edges, the software performs well and graphs load in a few seconds.

Q. Is there a manual?

A. There is a readme with the download, an some explanation on this page. If you have any questions that have not been covered, please contact

Q. How do I run the JNets application?

A. After you have downloaded the JNets package, open the JNets_application folder and double click on the jar file. This will only work if your system reads the manifest file properly. Alternatively, on the command line, navigate to the JNets_application folder and type:

java -Xmx512m -classpath JNets.jar:lib/iText-1.4.8.jar:lib/jdom.jar: JNets

Then press enter, JNets should then load. This little command-ditty can be found in the runjar.txt file in the same folder.

Q. Why when I load my input file do I get a "java.lang.OutOfMemoryError" error message?

A. This is probably occurring when you are loading in a large XML document (or maybe not). Either way, you have to allocate more memory to the Java Virtual Machine when you load JNets. This is done by putting the an extra argument that looks like this "-Xmx512M" in the command line statement you use to run the application. This particular argument assigns 512MB to the JVM.

Q. What type of input file does JNets require?

A. JNets needs the input of an XGMML file. However, you do not need to write one of these by hand, or make your own script to make one of these. JNets provides an XGMML builder that will build an input file from tab-delimited data (click here to find out more about this). See the Readme file in the download for full details.

Q. What layout algorithms does JNets employ?

A. JNets uses the spring-embedded and container layouts that come with InterView (the software on which JNets is based). Nodes can be assigned an X and a Y coordinate, to allow predetermined layouts to be loaded.

Q. What type of annotation can accompany a graph in JNets?

A. Any annotation that can be stored as a string, boolean, integer or double. Although JNets will not understand the what the annotation means, these four data types are treated appropriately.

Q. What Java version do I need to run JNets?

A. You will need to be running Java SE5 or above to use JNets (we're currently up to SE6, so you'll probably have this).

Q. Can JNets export networks as images?

A. Yes, using the JNets application, in either PNG or PDF formats.

Back to top