Stepwise connection: a focus on the INE algorithm

This notebook provides the steps to build a network starting from a list of genes, and using the Iterative Neighbor Expansion (INE) algorithm.

[4]:
%%time
from neko.core.network import Network
from neko._visual.visualize_network import NetworkVisualizer
from neko.inputs import Universe, signor
from neko._annotations.gene_ontology import Ontology
import omnipath as op
import pandas as pd
CPU times: user 15 µs, sys: 4 µs, total: 19 µs
Wall time: 21 µs

1. Define the list of genes of interest

[5]:
genes = ["PIK3CA","MAP2K1","GSK3B","MAPK14","CTNNB1","AKT1","MAP3K7"]
[6]:
output_nodes_prosurvival = ['CCND1','MYC','TCF7L2']

2. Specify SIGNOR resource

[7]:
resources = Universe()
resources = signor("../neko/_data/signor_db.tsv")  # this function accept only tab separated values
resources.build()

3. Create a network using as input the gene set.

3A. Import genes as network nodes

[8]:
new_net = Network(initial_nodes = genes, resources=resources.interactions)

3B. Connect nodes

The INE algorith connects the input nodes by looking and introducing all their immediate neighbors into the network. If the nodes remain unconnected, the immediate neighbors of the newly introduced nodes are added into the network. The process ends either when a complete network is reached or until the user-specified threshold of expansion steps (i.e., max_len) is specified.

The algorithm also allows the definition of outputs, which are nodes that should be connected to the network with only incoming edges. For instance, these nodes might represent phenotypic markers (e.g., proliferation) of interest.

At the end of the algorithm, any nodes that do not have a source in the edge dataframe and are not in the output node are removed..

[9]:
%%time
new_net.connect_as_atopo(max_len=1, strategy="radial",outputs=output_nodes_prosurvival)
CPU times: user 7.83 s, sys: 2.45 ms, total: 7.83 s
Wall time: 7.84 s
[10]:
new_net.edges
[10]:
source target Type Effect References
0 P31749 P49840 None inhibition 11035810
1 P31749 P46937 None inhibition 12535517
2 P31749 P42345 None stimulation 15829723
3 P31749 P04150 None inhibition 24291004
4 P31749 Q01860 None stimulation 23041284
... ... ... ... ... ...
190 SIGNOR-PF4 P01106 None stimulation 32482868
213 Q16539 P24385 None inhibition 8702807
229 P28482 P01106 None stimulation 8386367
241 P49841 P24385 None inhibition 16504004; 9832503; 23552696
242 P49841 P01106 None inhibition 11018017; 16023596; 14563837

150 rows × 5 columns

[11]:
visualizer = NetworkVisualizer(new_net, color_by='effect', noi=True)
visualizer.render()
../_images/notebooks_3_stepwise_connection_13_0.svg
[12]:
visualizer = NetworkVisualizer(new_net, color_by='effect', noi=True, predefined_node="CCND1")
visualizer.render()
../_images/notebooks_3_stepwise_connection_14_0.svg
[13]:
visualizer = NetworkVisualizer(new_net, color_by='effect', noi=True, predefined_node="MYC")
visualizer.render()
../_images/notebooks_3_stepwise_connection_15_0.svg
[14]:
visualizer = NetworkVisualizer(new_net, color_by='effect', noi=True, predefined_node="TCF7L2")
visualizer.render()
../_images/notebooks_3_stepwise_connection_16_0.svg
[ ]: