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.

[1]:
%%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 3.62 s, sys: 758 ms, total: 4.38 s
Wall time: 4.72 s

1. Define the list of genes of interest

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

2. Specify SIGNOR resource

[4]:
resources = signor()  # 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

[5]:
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..

[6]:
%%time
new_net.connect_as_atopo(max_len=1, strategy="radial",outputs=output_nodes_prosurvival)
CPU times: user 6.91 s, sys: 6.27 ms, total: 6.92 s
Wall time: 6.92 s
[7]:
new_net.edges
[7]:
source target Type Effect References Provenance
0 Q16539 SIGNOR-PF24 None bimodal 20626350; 12181443 None
1 Q16539 P04150 None stimulation 20660302; 15817653 None
2 Q16539 P11362 None inhibition 20626350 None
3 Q16539 Q15750 None inhibition 19393267; 14592977 None
4 Q16539 P49841 None inhibition 18451303; 17726008 None
... ... ... ... ... ... ...
261 P35222 P01106 None stimulation 16510874 None
263 P49840 P01106 None inhibition 16023596 None
266 Q16539 P24385 None inhibition 8702807 None
269 P01106 P24385 None stimulation 12835716 None
270 SIGNOR-PF1 P01106 None stimulation 11018017 None

178 rows × 6 columns

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