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

<p>I guess Cytoscape (<a href="http://cytoscape.org/" rel="nofollow noreferrer">http://cytoscape.org/</a>) would be a nice way to analyse such interaction lists/networks (still depends a bit on what you plan to do).</p>

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

<ol>
<li>save as tab-separated file (tsv)</li>
<li>run the below python3 script to format into an easily importable format for cytoscape. You can run the script as <code>python3 script.py &lt;path-to-tsv-file&gt; &lt;delimeter for cytoscape&gt;</code> . 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 <code>python3 testbench.py human_interactome_2017-06-12.tsv.csv ";"</code>. Make sure to add the delimeter in quotes.</li>
<li>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.</li>
<li>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.</li>
</ol>

<p>Screenshot from cytoscape:
<a href="https://i.sstatic.net/FlSN5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FlSN5.png" alt="Cytoscape screenshot"></a></p>

<p>Code below:</p>

<pre><code>import sys

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

print(sys.argv)

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

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

if len(sys.argv) &gt; 2:
    delim = sys.argv[2]


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


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

    file.readline()

    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')
</code></pre>

CC BY-SA 3.0
2017-06-12T11:30:58.437Z
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.
bli
CC BY-SA 3.0
2017-06-12T11:35:33.500Z
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`).
bli
CC BY-SA 3.0
2017-06-12T12:59:56.527Z
Indeed the code was written down quite fast, however, I added your comments to the solution.
mjoppich
CC BY-SA 3.0
2017-06-12T08:34:12.630Z
2017-06-12T12:59:17.563Z
2017-06-12T12:59:17.563Z
mjoppich
<p>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:</p>

<pre><code>awk 'print $2,$4' netw.txt &gt; netw.gr
</code></pre>

<p>If you want to use the Entrez geneIDs instead, run:</p>

<pre><code>awk 'print $1,$3' netw.txt &gt; netw.gr
</code></pre>

<p>Then, as others already mentioned, install <a href="http://cytoscape.org/" rel="nofollow noreferrer"><code>Cytoscape</code></a>, launch it and import your gene list:</p>

<ol>
<li><p>In the welcome screen, select "From Network File...":</p>

<p><a href="https://i.sstatic.net/EeYPU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/EeYPU.png" alt="Cytoscape welcome screen"></a></p></li>
<li><p>Then, select your network file (<code>netw.gr</code> in the example above) and choose "Advanced Options":</p>

<p><a href="https://i.sstatic.net/nDM2t.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nDM2t.png" alt="Advanced options"></a></p></li>
<li><p>Set the delimiter to SPACE and uncheck "Use first line as column names":</p>

<p><a href="https://i.sstatic.net/YOnzG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YOnzG.png" alt="select the delimiter"></a></p></li>
<li><p>Finally, click on the header of each column and set the first to "source node" and the second to "target node":</p>

<p><a href="https://i.sstatic.net/pUBYI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pUBYI.png" alt="source node"></a>  </p>

<p><a href="https://i.sstatic.net/LbSm3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LbSm3.png" alt="target node"></a></p></li>
</ol>

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

CC BY-SA 3.0
2017-06-13T10:32:44.133Z
2017-06-13T10:32:44.133Z
terdon
<p>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 <a href="https://js.cytoscape.org/" rel="nofollow noreferrer">Cytoscape javascript library</a> might fulfil your needs.</p>

CC BY-SA 4.0
2019-11-14T13:57:17.357Z
2019-11-14T13:57:17.357Z
Jay Moore
<p>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).</p>

<p>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 <a href="https://cran.r-project.org/package=igraph" rel="nofollow noreferrer">igraph</a> package in R, or <a href="http://www.cytoscape.org/" rel="nofollow noreferrer">Cytoscape</a> program. </p>

CC BY-SA 3.0
2017-06-12T09:26:50.953Z
2017-06-12T09:26:50.953Z
llrs
<p>I would like to visualize <a href="http://interactome.dfci.harvard.edu/H_sapiens/index.php?page=shownetwork" rel="nofollow noreferrer">this</a> interaction list.  Is there an online/web based way to do it? Is there a way to analyze the data?</p>

<p>Assuming I have exported the list into lines such as:</p>

<p><code>2  A2M 348 APOE</code></p>

CC BY-SA 3.0
2017-06-12T08:32:49.120Z
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)?
llrs
<gene><proteins><interactions>
What are the standard ways to visualize protein-protein or gene-gene interactions?
# What are the standard ways to visualize protein-protein or gene-gene interactions?

(Asked by: username_0 on 2017-06-12)

I would like to visualize [this](http://interactome.dfci.harvard.edu/H_sapiens/index.php?page=shownetwork) 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`

**Tags:** gene, proteins, interactions
> **Comments:**
> **username_1**: 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)?  

---

## 4 answers

### Answer by username_2 on 2017-06-12. Score: 2

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.

save as tab-separated file (tsv)
run the below python3 script to format into an easily importable format for cytoscape. You can run the script as python3 script.py   . 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.
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.
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:

Code below:
import sys

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

print(sys.argv)

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:

    file.readline()

    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')

> **Comments:**
> **username_3**: 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.  
> **username_3**: 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`).  
> **username_2**: Indeed the code was written down quite fast, however, I added your comments to the solution.  

---

### Answer by username_4 on 2017-06-13. Score: 2

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:

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

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

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

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


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


---

### Answer by username_5 on 2019-11-14. Score: 1

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](https://js.cytoscape.org/) might fulfil your needs.


---

### Answer by username_1 on 2017-06-12. Score: 1

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](https://cran.r-project.org/package=igraph) package in R, or [Cytoscape](http://www.cytoscape.org/) program.


---

