I would like to visualize this interaction list. Is there an online/web based way to do it? Is there a way to analyze the data?

Assuming I have exported the list into lines such as:

2 A2M 348 APOE

  • 2
    $\begingroup$ What tools have you found (To avoid suggesting tools you already tried) ? What do you want to analyze from it (what is your biological question)? $\endgroup$
    – llrs
    Jun 12, 2017 at 8:32

4 Answers 4


since I am not yet allowed to comment, I will have to pots this as an answer.

I guess Cytoscape (http://cytoscape.org/) would be a nice way to analyse such interaction lists/networks (still depends a bit on what you plan to do).

However, for this you will have to preprocess the downloadable excel sheet a bit.

  1. save as tab-separated file (tsv)
  2. run the below python3 script to format into an easily importable format for cytoscape. You can run the script as python3 script.py <path-to-tsv-file> <delimeter for cytoscape> . The new format is written to std out on the console, therefore maybe you need to write the output to a new file. A sample call could look like python3 testbench.py human_interactome_2017-06-12.tsv.csv ";". Make sure to add the delimeter in quotes.
  3. you can then import the new file into cytoscape (import network as table) where the first column is your source, the third column your target and the middle column your interaction type.
  4. Within cytoscape you can then adapt your edge style to vary the line type in a discrete mapping depending on the value of the interaction.

Screenshot from cytoscape: Cytoscape screenshot

Code below:

import sys

HIIIidx = 4
HII5idx = 5
venkatesanidx = 6
yuidx = 7
Litidx = 8


if len(sys.argv) <= 1:
    print("Usage: script.py file delimeter")

delim = ';'
inFile = sys.argv[1]

if len(sys.argv) > 2:
    delim = sys.argv[2]

def printInteraction(syma, symb, inter):
    print(syma + delim + inter + delim + symb)

with open( inFile , 'r') as file:


    for line in file:

        aline = line.strip('\n').split('\t')

        if aline[HIIIidx] == '1':
            printInteraction(aline[1], aline[3], 'HIII')

        if aline[HII5idx] == '1':
            printInteraction(aline[1], aline[3], 'HII5')

        if aline[venkatesanidx] == '1':
            printInteraction(aline[1], aline[3], 'VEN')

        if aline[yuidx] == '1':
            printInteraction(aline[1], aline[3], 'YU')

        if aline[Litidx] == '1':
            printInteraction(aline[1], aline[3], 'LIT')
  • 1
    $\begingroup$ Instead of the lineCount counter, if you want to skip the first line you can do: with open(inFile, "r") as my_file: my_file.readline(); for line in my_file:. The readline will advance to the file to its next line. It is considered best practice to open a file inside a with context manager. $\endgroup$
    – bli
    Jun 12, 2017 at 11:30
  • $\begingroup$ Also, you can do directly aline = line.strip("\n").split("\t"), since you don't re-use the modified line (and I would call this variable fields rather than aline). $\endgroup$
    – bli
    Jun 12, 2017 at 11:35
  • $\begingroup$ Indeed the code was written down quite fast, however, I added your comments to the solution. $\endgroup$
    – mjoppich
    Jun 12, 2017 at 12:59

Your list has two identifiers for the same node per line. In order to use it, you will need to change that. If you want to use the gene name (2nd and 4th fields, in your example), just run:

awk 'print $2,$4' netw.txt > netw.gr

If you want to use the Entrez geneIDs instead, run:

awk 'print $1,$3' netw.txt > netw.gr

Then, as others already mentioned, install Cytoscape, launch it and import your gene list:

  1. In the welcome screen, select "From Network File...":

    Cytoscape welcome screen

  2. Then, select your network file (netw.gr in the example above) and choose "Advanced Options":

    Advanced options

  3. Set the delimiter to SPACE and uncheck "Use first line as column names":

    select the delimiter

  4. Finally, click on the header of each column and set the first to "source node" and the second to "target node":

    source node

    target node

Now, click "OK" and you will have successfully imported your network into Cytoscape.


Usually interactions are represented in a graph, with edges representing the interactions (colors, thickness or values on the edges represent different properties of those edges).

As far as I know, there aren't on line programs to represent this kind of information. For an off line representation, you can use the igraph package in R, or Cytoscape program.


Several have mentioned the excellent Cytoscape desktop package for visualising interactions as a graph. If you want to build your own web-based visualisations (rather than using a pre-built website to visualise them) then the Cytoscape javascript library might fulfil your needs.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.