Introduction

In Lescarbeu et al. (2014), a phosphoproteomic dataset in prostate cancer cell lines is provided. This notebook recopilates the proteins considered, measured and perturbed in that work and tries to recover a prior-knowledge network supported by literature using pypath.

In [1]:
# Show all the plots inside the notebook
%matplotlib inline
In [2]:
# load packages
import pypath
import igraph  # import igraph to use the plot function

import numpy as np
import pandas as pd
import seaborn as sns
In [3]:
# Load the ipython display and image module
from IPython.display import Image
from IPython.display import display

display(Image(url="https://static-content.springer.com/image/art%3A10.1186%2F1471-2407-14-325/MediaObjects/12885_2013_Article_4524_Fig1_HTML.jpg"))

Figure 1 An overview of the measured signaling pathways and responses to treatment. A) A diagrammatic overview illustrating the cell signaling between the phosphoproteins measured (blue lettering), the treatments used (green lettering), and the inhibitors which were used on the LNCaP cells (red lines). B) Heatmap with hierarchical clustering illustrating the mean centered and variance scaled (z-score) changes in phosphoprotein values in response to varying treatments (see Methods), as well as survival values of LNCaP, PC3, or MDA-PCa-2b cells as measured via a MTT assay. 

In Figure 1 of Lescarbeau et al. (2014) we can see an squema of the studied signaling network. We will translate the names in the diagram to gene IDs and try to recover a network using pypath.

In [4]:
# load file and keep only the second column
seed_list_table = pd.read_csv("../../Data/Lescarbeau_et_al_2014/model_nodes.txt", sep='\t', header=0)
seed_list = seed_list_table.iloc[:,1]
print(seed_list_table)
   Phosphoprotein      Gene  Measured  Stimulated
0            Erk1     MAPK3         1           0
1            Erk2     MAPK1         1           0
2            Akt1      AKT1         1           0
3            Akt2      AKT2         1           0
4            Akt3      AKT3         1           0
5            RPS6      RPS6         1           0
6           GSK3a     GSK3A         1           0
7           GSk3b     GSK3B         1           0
8            p38d    MAPK13         1          -1
9            JNK1     MAPK8         1           0
10           JNK2     MAPK9         1           0
11           JNK3    MAPK10         1           0
12          HSP27     HSPB1         1           0
13          Stat3     STAT3         1           0
14          IGF-1      IGF1         0           1
15            IL6       IL6         0           1
16            EGF       EGF         0           1
17           TNFa       TNF         0           1
18      Docetaxel         -         0           1
19            DHT         -         0           1
20           PI3K    PIK3CA         0          -1
21           mTOR      MTOR         0          -1
22            MEK    MAP2K1         0          -1
23           IKKa      CHUK         0          -1
24           IKKb     IKBKB         0          -1
25      b-Tubulin      TUBB         0           0
26             AR        AR         0           0
27         IGF1-R     IGF1R         0           0
28      b-Catenin    CTNNB1         0           0
29           IL6R      IL6R         0           0
30            Jak      JAK1         0           0
31           EGFR      EGFR         0           0
32            RAS      KRAS         0           0
33         Stress         -         0           0
34            Rac      RAC1         0           0
35           TNFR  TNFRSF1A         0           0
36          NF-kB     NFKB1         0           0
In [5]:
pa = pypath.main.PyPath()

	=== d i s c l a i m e r ===

	All data coming with this module
	either as redistributed copy or downloaded using the
	programmatic interfaces included in the present module
	are available under public domain, are free to use at
	least for academic research or education purposes.
	Please be aware of the licences of all the datasets
	you use in your analysis, and please give appropriate
	credits for the original sources when you publish your
	results. To find out more about data sources please
	look at `pypath.descriptions` and
	`pypath.data_formats.urls`.

	» New session started,
	session ID: 'b17rj'
	logfile:'./log/b17rj.log'.
In [6]:
pa.init_network()
	:: Loading data from cache previously downloaded from www.uniprot.org
	:: Ready. Resulted `plain text` of type file object. 
	:: Local file at `/Users/admin/Documents/ltobalina/COMBINE/Projects/PrECISE/Code/Omnipath/cache/ec920965677ac83b8805d72853c79d45-`.
	:: Loading data from cache previously downloaded from www.uniprot.org
	:: Ready. Resulted `plain text` of type file object. 
	:: Local file at `/Users/admin/Documents/ltobalina/COMBINE/Projects/PrECISE/Code/Omnipath/cache/ec920965677ac83b8805d72853c79d45-`.
	:: Loading data from cache previously downloaded from ftp.uniprot.org
	:: Ready. Resulted `gz extracted data` of type file object. 
	:: Local file at `/Users/admin/Documents/ltobalina/COMBINE/Projects/PrECISE/Code/Omnipath/cache/079410d8e3f429e7699c167b9d4ef3b7-HUMAN_9606_idmapping.dat.gz`.
	:: Processing ID conversion list: finished, 100.0%
 » NetPath
	:: Reading from cache: cache/netpath.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » DOMINO
	:: Reading from cache: cache/domino.edges.pickle
	:: Loading 'genesymbol' to 'uniprot' mapping table
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » AlzPathway
	:: Reading from cache: cache/alzpathway.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » CancerCellMap
	:: Reading from cache: cache/cancercellmap.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » ARN
	:: Reading from cache: cache/arn.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » DeathDomain
	:: Reading from cache: cache/deathdomain.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » ELM
	:: Reading from cache: cache/elm.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » CA1
	:: Reading from cache: cache/ca1.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » DEPOD
	:: Reading from cache: cache/depod.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » TRIP
	:: Reading from cache: cache/trip.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » HPRD
	:: Reading from cache: cache/hprd.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `hprd_mechanism` has multiple types of values: str, list
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » SPIKE
	:: Reading from cache: cache/spike.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » LMPID
	:: Reading from cache: cache/lmpid.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » dbPTM
	:: Reading from cache: cache/dbptm.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
 » SignaLink3
	:: Reading from cache: cache/signalink3.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_is_direct` has multiple types of values: str, list
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, str, list
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_mechanism` has multiple types of values: str, list
 » MatrixDB
	:: Reading from cache: cache/matrixdb.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » InnateDB
	:: Reading from cache: cache/innatedb.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » MPPI
	:: Reading from cache: cache/mppi.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » NRF2ome
	:: Reading from cache: cache/nrf2ome.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » Signor
	:: Reading from cache: cache/signor.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » Macrophage
	:: Reading from cache: cache/macrophage.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » PDZBase
	:: Reading from cache: cache/pdzbase.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » PhosphoSite
	:: Reading from cache: cache/phosphosite.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » BioGRID
	:: Reading from cache: cache/biogrid.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » Guide2Pharma
	:: Reading from cache: cache/guide2pharma.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » DIP
	:: Reading from cache: cache/dip.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 » phosphoELM
	:: Reading from cache: cache/phosphoelm.edges.pickle
	:: Processing nodes: finished, 100.0%
	:: Processing edges: finished, 100.0%
	:: Processing attributes: finished, 100.0%
WARNING:pypath.logn:### WARNING ###### Vertex attribute `name` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `label` has multiple types of values: str, unicode
WARNING:pypath.logn:### WARNING ###### Vertex attribute `exp` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `negative_refs` has only None values
WARNING:pypath.logn:### WARNING ###### Edge attribute `netbiol_effect` has multiple types of values: unicode, list
 :: Comparing with reference lists... done.

 » 29949 interactions between 7476 nodes
 from 27 resources have been loaded,
 for details see the log: ./log/b17rj.log
In [7]:
# remove links reported in papers with more than 50 interactions (by default)
pa.remove_htp()
	:: Interactions from only high-throughput resources have been removed.
	   4009 interactions removed.
	   Number of edges decreased from 29949 to 25940, number of vertices from 7476 to 6820.
In [8]:
prot = [(igene, pa.genesymbol(igene)['name']) for igene in list(seed_list.as_matrix()) if pa.genesymbol(igene) is not None]

We can see first how the neighbourhood of the nodes listed looks like.

In [9]:
neighbour_set = set()
for igene, iprot in prot:
    neighbour_set.update(pa.gs_neighborhood(igene))
In [10]:
neighbour_network = pa.graph.induced_subgraph(neighbour_set)
In [11]:
layout = neighbour_network.layout_fruchterman_reingold(repulserad = neighbour_network.vcount() ** 2.8, 
    maxiter = 1000, area = neighbour_network.vcount() ** 2.3)
plot2 = igraph.plot(neighbour_network, layout = layout, vertex_size = 0.5,
    vertex_border_width = 0, edge_width = 0.2, edge_color = '#33333377', vertex_label_size = 9)
plot2.save('Lescarbeu_et_al_2014_neighbourhood.png')
display(Image('Lescarbeu_et_al_2014_neighbourhood.png'))
In [12]:
print('Number of edges: {}'.format(neighbour_network.ecount()))
print('Number of nodes: {}'.format(neighbour_network.vcount()))
Number of edges: 10682
Number of nodes: 1573

The neighbours of the queried nodes span quite a big network. We will try to get a network only involving the nodes queried.

In [13]:
query_set = set()
for igene, iprot in prot:
    query_set.add(pa.gs(igene))
In [14]:
query_set_network = pa.graph.induced_subgraph(query_set)
In [15]:
layout = query_set_network.layout_fruchterman_reingold(repulserad = query_set_network.vcount() ** 2.8, 
    maxiter = 1000, area = query_set_network.vcount() ** 2.3)
plot2 = igraph.plot(query_set_network, layout = layout, vertex_size = 0.5,
    vertex_border_width = 0, edge_width = 0.2, edge_color = '#33333377', vertex_label_size = 9)
plot2.save('Lescarbeu_et_al_2014_set.png')
display(Image('Lescarbeu_et_al_2014_set.png'))
In [16]:
print('Number of edges: {}'.format(query_set_network.ecount()))
print('Number of nodes: {}'.format(query_set_network.vcount()))
Number of edges: 91
Number of nodes: 34

This network looks much more manageable. There is one big connected component and only 3 nodes that lack a direct connection to the rest.

In [17]:
# extract connected components using igraph's clusters() function
query_set_clusters = query_set_network.clusters()
n_clusters = len(query_set_clusters)
print('Number of connected components: {}'.format(n_clusters))
for i in xrange(n_clusters):
    print('\tComponent {} size: {}'.format(i, len(query_set_clusters[i])))
Number of connected components: 4
	Component 0 size: 31
	Component 1 size: 1
	Component 2 size: 1
	Component 3 size: 1

We can see what the members of those isolated nodes are and search to which nodes can be connected with the least number of intermediary nodes.

In [18]:
for i in range(1, n_clusters):
    print('Genes in component {}:'.format(i))
    print(query_set_network.vs[query_set_clusters[i]]['label'])
Genes in component 1:
['TUBB']
Genes in component 2:
['MAPK10']
Genes in component 3:
['MAPK13']
In [19]:
# look for shortest path between all pair of nodes
node_list = set()
query_nodes = [i[0] for i in prot]
distance = pd.DataFrame(np.nan, index=query_nodes, columns=query_nodes)
for igene1, iprot1 in prot:
    for igene2, iprot2 in prot:
        if igene1 == igene2:
            distance.loc[igene1, igene2] = 0
        else:
            path = pa.graph.get_shortest_paths(pa.genesymbol(igene1)['name'], to=pa.genesymbol(igene2)['name'])[0]
            #node_list = node_list.union(set(path))
            node_list.update(path)
            distance.loc[igene1, igene2] = len(path)-1 if len(path)>0 else np.nan
In [20]:
n_allowed_steps = 2
for i in range(1, n_clusters):
    for j in query_set_network.vs[query_set_clusters[i]]['label']:
        print('{} can be connected in {} steps to:'.format(j, n_allowed_steps))
        print('\t'+'\n\t'.join([k for k in distance.loc[j, distance.loc[j,:]==n_allowed_steps].index]))
TUBB can be connected in 2 steps to:
	MAPK3
	MAPK1
	AKT1
	RPS6
	GSK3B
	MAPK13
	MAPK8
	MAPK9
	MAPK10
	STAT3
	PIK3CA
	MTOR
	CHUK
	AR
	IGF1R
	CTNNB1
	EGFR
	KRAS
	RAC1
MAPK10 can be connected in 2 steps to:
	MAPK3
	MAPK1
	AKT1
	AKT2
	GSK3A
	GSK3B
	MAPK13
	MAPK8
	MAPK9
	STAT3
	MTOR
	MAP2K1
	CHUK
	IKBKB
	TUBB
	AR
	IGF1R
	CTNNB1
	EGFR
	KRAS
	NFKB1
MAPK13 can be connected in 2 steps to:
	MAPK3
	MAPK1
	AKT1
	GSK3A
	GSK3B
	MAPK8
	MAPK9
	MAPK10
	HSPB1
	TNF
	IKBKB
	TUBB
	AR
	CTNNB1
	EGFR
	KRAS
	TNFRSF1A
	NFKB1

We can see that allowing only one intermediary node we can reach many nodes in the big connected component. Before continuing, we will repeat the process but with a directed version of the network.

In [21]:
pa.get_directed()
	:: Setting directions: finished, 100.0%
In [22]:
query_set_d = set()
for igene, iprot in prot:
    query_set_d.add(pa.dgs(igene))
In [23]:
query_set_dnetwork = pa.dgraph.induced_subgraph(query_set_d)
In [24]:
layout = query_set_dnetwork.layout_fruchterman_reingold(repulserad = query_set_dnetwork.vcount() ** 2.8, 
    maxiter = 1000, area = query_set_dnetwork.vcount() ** 2.3)
plot2 = igraph.plot(query_set_dnetwork, layout = layout, vertex_size = 0.5,
    vertex_border_width = 0, edge_width = 0.2, edge_color = '#33333377', vertex_label_size = 9)
plot2.save('Lescarbeu_et_al_2014_set_dnetwork.png')
display(Image('Lescarbeu_et_al_2014_set_dnetwork.png'))
In [25]:
print('Number of edges: {}'.format(query_set_dnetwork.ecount()))
print('Number of nodes: {}'.format(query_set_dnetwork.vcount()))
Number of edges: 104
Number of nodes: 34

The network is still manageable, but we can observe that now IL-6 and IL6R are disconnected from the rest of the network.

In [26]:
# extract connected components using igraph's clusters() function
# here mode='weak' instead of the default value 'strong'
query_set_dclusters = query_set_dnetwork.clusters(mode='weak')
n_dclusters = len(query_set_dclusters)
print('Number of connected components: {}'.format(n_dclusters))
for i in xrange(n_dclusters):
    print('\tComponent {} size: {}'.format(i, len(query_set_dclusters[i])))
Number of connected components: 5
	Component 0 size: 29
	Component 1 size: 2
	Component 2 size: 1
	Component 3 size: 1
	Component 4 size: 1
In [27]:
for i in range(1, n_dclusters):
    print('Genes in component {}:'.format(i))
    print(query_set_dnetwork.vs[query_set_dclusters[i]]['label'])
Genes in component 1:
['IL6R', 'IL6']
Genes in component 2:
['TUBB']
Genes in component 3:
['MAPK10']
Genes in component 4:
['MAPK13']

IL6R was connected to JAK1 in the undirected network. The reason for not being connected in the directed network is that when getting a directed network, by default, only edges with an explicit reference to its directionality are kept.

We can add this link manually to our network, as we are trying to get a single network that connects all the nodes and we have a reference for it (although without explicit directionality).

In [28]:
# add directed edge from IL6R to JAK1
label_source = 'IL6R'
label_target = 'JAK1'

iprot_source = query_set_dnetwork.vs.find(label=label_source).index
iprot_target = query_set_dnetwork.vs.find(label=label_target).index
query_set_dnetwork.add_edge(iprot_source, iprot_target)

# copy attribute values present in the undirected network
original_attributes = pa.graph.es(pa.get_edge([pa.gs(label_source), pa.gs(label_target)]))[0].attributes()

new_edge_id = query_set_dnetwork.get_eid(iprot_source, iprot_target)
new_edge_pointer = query_set_dnetwork.es(new_edge_id)[0]

for (ikey, ivalue) in original_attributes.iteritems():
    new_edge_pointer[ikey] = ivalue

We can check again the number of connected components:

In [29]:
# extract connected components using igraph's clusters() function
# here mode='weak' instead of the default value 'strong'
query_set_dclusters = query_set_dnetwork.clusters(mode='weak')
n_dclusters = len(query_set_dclusters)
print('Number of connected components: {}'.format(n_dclusters))
for i in xrange(n_dclusters):
    print('\tComponent {} size: {}'.format(i, len(query_set_dclusters[i])))
Number of connected components: 4
	Component 0 size: 31
	Component 1 size: 1
	Component 2 size: 1
	Component 3 size: 1

As before, we will seek how to connect the isolated nodes to the rest of the network (but using only directed edges).

In [30]:
# look for shortest path between all pair of nodes
dnode_list = set()
query_nodes = [i[0] for i in prot]
ddistance = pd.DataFrame(np.nan, index=query_nodes, columns=query_nodes)
for igene1, iprot1 in prot:
    for igene2, iprot2 in prot:
        if igene1 == igene2:
            ddistance.loc[igene1, igene2] = 0
        else:
            path = pa.dgraph.get_shortest_paths(pa.genesymbol(igene1)['name'], to=pa.genesymbol(igene2)['name'])[0]
            #node_list = node_list.union(set(path))
            dnode_list.update(path)
            ddistance.loc[igene1, igene2] = len(path)-1 if len(path)>0 else np.nan
/Applications/anaconda/envs/py27/lib/python2.7/site-packages/ipykernel/__main__.py:10: RuntimeWarning: Couldn't reach some vertices at structural_properties.c:740
In [31]:
n_allowed_steps = 2
for i in range(1, n_dclusters):
    for j in query_set_dnetwork.vs[query_set_dclusters[i]]['label']:
        print('{} can be connected in {} steps to:'.format(j, n_allowed_steps))
        print('\t'+'\n\t'.join([k for k in distance.loc[j, distance.loc[j,:]==n_allowed_steps].index]))
        print('{} can be connected in {} steps from:'.format(j, n_allowed_steps))
        print('\t'+'\n\t'.join([k for k in distance.loc[distance.loc[:,j]==n_allowed_steps,j].index]))
        print('---')
TUBB can be connected in 2 steps to:
	MAPK3
	MAPK1
	AKT1
	RPS6
	GSK3B
	MAPK13
	MAPK8
	MAPK9
	MAPK10
	STAT3
	PIK3CA
	MTOR
	CHUK
	AR
	IGF1R
	CTNNB1
	EGFR
	KRAS
	RAC1
TUBB can be connected in 2 steps from:
	MAPK3
	MAPK1
	AKT1
	RPS6
	GSK3B
	MAPK13
	MAPK8
	MAPK9
	MAPK10
	STAT3
	PIK3CA
	MTOR
	CHUK
	AR
	IGF1R
	CTNNB1
	EGFR
	KRAS
	RAC1
---
MAPK10 can be connected in 2 steps to:
	MAPK3
	MAPK1
	AKT1
	AKT2
	GSK3A
	GSK3B
	MAPK13
	MAPK8
	MAPK9
	STAT3
	MTOR
	MAP2K1
	CHUK
	IKBKB
	TUBB
	AR
	IGF1R
	CTNNB1
	EGFR
	KRAS
	NFKB1
MAPK10 can be connected in 2 steps from:
	MAPK3
	MAPK1
	AKT1
	AKT2
	GSK3A
	GSK3B
	MAPK13
	MAPK8
	MAPK9
	STAT3
	MTOR
	MAP2K1
	CHUK
	IKBKB
	TUBB
	AR
	IGF1R
	CTNNB1
	EGFR
	KRAS
	NFKB1
---
MAPK13 can be connected in 2 steps to:
	MAPK3
	MAPK1
	AKT1
	GSK3A
	GSK3B
	MAPK8
	MAPK9
	MAPK10
	HSPB1
	TNF
	IKBKB
	TUBB
	AR
	CTNNB1
	EGFR
	KRAS
	TNFRSF1A
	NFKB1
MAPK13 can be connected in 2 steps from:
	MAPK3
	MAPK1
	AKT1
	GSK3A
	GSK3B
	MAPK8
	MAPK9
	MAPK10
	HSPB1
	TNF
	IKBKB
	TUBB
	AR
	CTNNB1
	EGFR
	KRAS
	TNFRSF1A
	NFKB1
---

As we can see, the isolated nodes can be connected to many other nodes in the connected components using one additional intermediary node not present in the queried list of nodes.

We can decide to include all this possible edges or only some of them based on the diagram of Figure 1. For example, $\beta$-Tubulin (TUBB) is not connected to other nodes in the diagram. Also, JNK3 (MAPK10) may already be considered to be represented by JNK1 and JNK2 (MAPK8 and MAPK9 respectively). On the other hand, p38 (MAPK13) is connected to Rac (RAC1) and HSP27 (HSPB1) in that diagram.

We can check one of the shortest paths that connects RAC1 to MAPK13 and another that connects MAPK13 to HSPB1.

In [32]:
i_label_source = 'RAC1'
i_label_target = 'MAPK13'
path = pa.dgraph.get_shortest_paths(pa.dgenesymbol(i_label_source)['name'], to=pa.dgenesymbol(i_label_target)['name'])[0]
print('\t' + ' --> '.join(pa.dgraph.vs[i]['label'] for i in path))
	RAC1 --> PAK1 --> MAP2K3 --> MAPK13
In [33]:
i_label_source = 'MAPK13'
i_label_target = 'HSPB1'
path = pa.dgraph.get_shortest_paths(pa.dgenesymbol(i_label_source)['name'], to=pa.dgenesymbol(i_label_target)['name'])[0]
print('\t' + ' --> '.join(pa.dgraph.vs[i]['label'] for i in path))
	MAPK13 --> PRKD1 --> HSPB1

As we can see, to go from RAC1 to MAPK13 we need at least 3 steps in the directed network. We may decide, however, to add this connection nonetheless. In other words, we can decide to complete the network with the diagram in Figure 1 in mind. If the small network obtained this way does not explain the observations we can go back and consider other alternative wiring. We will leave TUBB and MAPK10 isolated for the moment too.

In [34]:
pkn_network = query_set_dnetwork.copy()

# add edge between RAC1 and MAPK13
label_source = 'RAC1'
label_target = 'MAPK13'
iprot_source = pkn_network.vs.find(label=label_source).index
iprot_target = pkn_network.vs.find(label=label_target).index
pkn_network.add_edge(iprot_source, iprot_target)

# add edge between MAPK13 and HSPB1
label_source = 'MAPK13'
label_target = 'HSPB1'
iprot_source = pkn_network.vs.find(label=label_source).index
iprot_target = pkn_network.vs.find(label=label_target).index
pkn_network.add_edge(iprot_source, iprot_target)
In [35]:
# extract connected components using igraph's clusters() function
# here mode='weak' instead of the default value 'strong'
pkn_network_clusters = pkn_network.clusters(mode='weak')
n_pkn_network_clusters = len(pkn_network_clusters)
print('Number of connected components: {}'.format(n_pkn_network_clusters))
for i in xrange(n_pkn_network_clusters):
    print('\tComponent {} size: {}'.format(i, len(pkn_network_clusters[i])))
Number of connected components: 3
	Component 0 size: 32
	Component 1 size: 1
	Component 2 size: 1

The edges of the network may also contain information on wether the interaction is of inhibition or not. We can color the edges red for those that are documented as inhibition.

In [36]:
layout = pkn_network.layout_fruchterman_reingold(repulserad = pkn_network.vcount() ** 2.8, 
    maxiter = 1000, area = pkn_network.vcount() ** 2.3)
edge_color = ['#FF333377' if ((e['dirs'] is not None) and e['dirs'].is_inhibition()) else '#33333377' for e in pkn_network.es]
plot2 = igraph.plot(pkn_network, layout = layout, vertex_size = 0.5,
    vertex_border_width = 0, edge_width = 0.2, edge_color = edge_color, vertex_label_size = 9)
plot2.save('Lescarbeau_et_al_2014_pkn.png')
display(Image('Lescarbeau_et_al_2014_pkn.png'))
In [37]:
print('Number of edges: {}'.format(pkn_network.ecount()))
print('Number of nodes: {}'.format(pkn_network.vcount()))
Number of edges: 107
Number of nodes: 34

Note however, that some of these edges with references pointing them to being inhibitory interactions may also have other references pointing to the contrary.

In [38]:
print('Interactions that have support for both, inhibition and stimulation:')
for i_edge in pkn_network.es:
    if (i_edge['dirs'] is not None) and i_edge['dirs'].is_inhibition() and i_edge['dirs'].is_stimulation():
        print('\t{} --> {}'.format(pkn_network.vs[i_edge.source]['label'], pkn_network.vs[i_edge.target]['label']))
Interactions that have support for both, inhibition and stimulation:
	AKT1 --> GSK3B
	AKT1 --> HSPB1
	MAP2K1 --> MAPK1
	CHUK --> NFKB1
	GSK3B --> AKT1
	MAPK1 --> MAP2K1
	MAPK1 --> GSK3B
	HSPB1 --> AKT1

We can print the network in sif format. This format describes a tab delimited text file with a line for each directed interaction and three elements per line:

  • name of source node
  • -1 or 1 if the source node is inhibiting or activating the target node
  • name of target node
In [39]:
with open('Lescarbeu_et_al_2014_pkn.txt', 'wt') as f:
    for i_edge in pkn_network.es:
        label_source = pkn_network.vs[i_edge.source]['label']
        label_target = pkn_network.vs[i_edge.target]['label']
        if (i_edge['dirs'] is not None) and i_edge['dirs'].is_inhibition():
            f.write('{}\t{}\t{}\n'.format(label_source, -1, label_target))
            # check also if the edge is reported as activation
            if i_edge['dirs'].is_stimulation():
                f.write('{}\t{}\t{}\n'.format(label_source, 1, label_target))
        else:
            f.write('{}\t{}\t{}\n'.format(label_source, 1, label_target))

We can also count the number of references that support each interaction.

In [40]:
# count the number of references for each edge and store it in a new edge attribute
pkn_network.es['nrefs'] = [len(edge['references']) if edge['references'] is not None else 0 for edge in pkn_network.es ]

One of the possible uses of a prior knowledge network is the simulation of a signaling network using boolean modeling techniques. We can use CellNOpt (http://www.cellnopt.org) for this task. This software will allow us to find a network that best explains our data starting from a prior knowledge network. In the final model, only necessary edges will be included. However, we may need to start with a more refined initial network. Specifically, it is recommended that the indegree of the nodes is limited to help in the optimization process (this limit may vary depending on the application). We can always come back later and include alternative edges if the model we obtain does not fit the data appropriately.

In [41]:
# Add a new attribute to each vertex with its indegree
pkn_network.vs['indegree'] = [i for i in pkn_network.indegree()]
In [42]:
indegree_hist = sns.plt.hist(pkn_network.indegree(), 100)
sns.plt.title('Indegree distribution')
Out[42]:
<matplotlib.text.Text at 0x128668a10>

In this case, we would like to limit the maximum indegree to 5. For achieving this, we need to discard some edges for those nodes with an indegree higher than 5. To choose the edges to be discarded, one option is to check the number of references supporting each edge and discard those with the lowest support.

In [43]:
max_indegree = 5
ids_edges_to_remove = []
for i_vertex in pkn_network.vs:
    if i_vertex['indegree']>max_indegree:
        edges_in = pkn_network.es.select(_target=i_vertex.index)
        print(i_vertex['label'])
        print("nrefs: " + ", ".join([str(i) for i in edges_in['nrefs']]))
        #print("degree of source: " + ", ".join([str(pkn_network.vs[i.source].degree()) for i in edges_in]))
        
        # get the threshold of nrefs that leaves max_indegree edges or less
        nrefs_list = np.array([e['nrefs'] for e in edges_in])
        nrefs_list.sort()
        nrefs_threshold = nrefs_list[-(max_indegree+1)]
        # get indices of edges to be removed
        ids_edges_to_remove.extend([e.index for e in edges_in.select(nrefs_le=nrefs_threshold)])
        print("Suggested deletions: ")
        for i_edge_to_remove in edges_in.select(nrefs_le=nrefs_threshold):
            i_source_label = pkn_network.vs[i_edge_to_remove.source]['label']
            i_target_label = pkn_network.vs[i_edge_to_remove.target]['label']
            print('\t' + ' --> '.join([i_source_label, i_target_label])  + "\t({} refs)".format(i_edge_to_remove["nrefs"]))
        print('---')
        
AKT1
nrefs: 8, 22, 1, 26, 11, 2, 4
Suggested deletions: 
	TNF --> AKT1	(1 refs)
	HSPB1 --> AKT1	(2 refs)
---
CHUK
nrefs: 8, 5, 7, 1, 2, 32, 2, 1, 1
Suggested deletions: 
	TNF --> CHUK	(1 refs)
	AKT2 --> CHUK	(2 refs)
	MTOR --> CHUK	(2 refs)
	HSPB1 --> CHUK	(1 refs)
	AKT3 --> CHUK	(1 refs)
---
STAT3
nrefs: 21, 18, 1, 9, 18, 17, 4
Suggested deletions: 
	RAC1 --> STAT3	(1 refs)
	MTOR --> STAT3	(4 refs)
---
EGFR
nrefs: 2, 1, 15, 9, 15, 3
Suggested deletions: 
	JAK1 --> EGFR	(1 refs)
---
CTNNB1
nrefs: 2, 7, 8, 18, 1, 1, 1, 32, 2, 3
Suggested deletions: 
	AKT1 --> CTNNB1	(2 refs)
	NFKB1 --> CTNNB1	(1 refs)
	AKT2 --> CTNNB1	(1 refs)
	IKBKB --> CTNNB1	(1 refs)
	GSK3A --> CTNNB1	(2 refs)
---
NFKB1
nrefs: 8, 1, 4, 2, 1, 8
Suggested deletions: 
	CTNNB1 --> NFKB1	(1 refs)
	AKT2 --> NFKB1	(1 refs)
---

We should take into account that removing edges may have undesired consequences, such as disconnecting a node from the rest of the network. If this happens, we might decide not to delete some of these edges.

In [44]:
pkn_network_v2 = pkn_network.copy()
pkn_network_v2.delete_edges(ids_edges_to_remove)
In [45]:
# extract connected components using igraph's clusters() function
# here mode='weak' instead of the default value 'strong'
pkn_network_v2_clusters = pkn_network_v2.clusters(mode='weak')
n_pkn_network_v2_clusters = len(pkn_network_v2_clusters)
print('Number of connected components: {}'.format(n_pkn_network_v2_clusters))
for i in xrange(n_pkn_network_v2_clusters):
    print('\tComponent {} size: {}'.format(i, len(pkn_network_v2_clusters[i])))
Number of connected components: 3
	Component 0 size: 32
	Component 1 size: 1
	Component 2 size: 1

In this case, we have no new disconnected nodes.

In [46]:
layout = pkn_network.layout_fruchterman_reingold(repulserad = pkn_network.vcount() ** 2.8, 
    maxiter = 1000, area = pkn_network.vcount() ** 2.3)
edge_color = ['#FF333377' if ((e['dirs'] is not None) and e['dirs'].is_inhibition()) else '#33333377' for e in pkn_network.es]
plot2 = igraph.plot(pkn_network, layout = layout, vertex_size = 0.5,
    vertex_border_width = 0, edge_width = 0.2, edge_color = edge_color, vertex_label_size = 9)
plot2.save('Lescarbeau_et_al_2014_pkn_v2.png')
display(Image('Lescarbeau_et_al_2014_pkn_v2.png'))
In [47]:
print('Number of edges: {}'.format(pkn_network_v2.ecount()))
print('Number of nodes: {}'.format(pkn_network_v2.vcount()))
Number of edges: 90
Number of nodes: 34
In [48]:
with open('Lescarbeau_et_al_2014_pkn_v2.txt', 'wt') as f:
    for i_edge in pkn_network.es:
        label_source = pkn_network.vs[i_edge.source]['label']
        label_target = pkn_network.vs[i_edge.target]['label']
        if (i_edge['dirs'] is not None) and i_edge['dirs'].is_inhibition():
            f.write('{}\t{}\t{}\n'.format(label_source, -1, label_target))
            # check also if the edge is reported as activation
            if i_edge['dirs'].is_stimulation():
                f.write('{}\t{}\t{}\n'.format(label_source, 1, label_target))
        else:
            f.write('{}\t{}\t{}\n'.format(label_source, 1, label_target))

Lastly, we will add manually some links to the sif file related to the treatments that appear in Figure 1.

In [49]:
with open('Lescarbeau_et_al_2014_pkn_v2.txt', 'at') as f:
    f.write('{}\t{}\t{}\n'.format("DHT", 1, "AR"))
    f.write('{}\t{}\t{}\n'.format("DHT", 1, "AR"))
    f.write('{}\t{}\t{}\n'.format("Docetaxel", 1, "TUBB"))
    f.write('{}\t{}\t{}\n'.format("Docetaxel", 1, "TUBB"))
    f.write('{}\t{}\t{}\n'.format("Stress", 1, "RAC1"))
    f.write('{}\t{}\t{}\n'.format("Stress", 1, "RAC1"))
In [ ]: