Introduction

This notebook shows how to extract canonical pathways in pypath using annotated pathway information.

Analysis

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]:
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: 'dutul'
	logfile:'./log/dutul.log'.
In [4]:
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/dutul.log
In [5]:
pa.load_all_pathways()
	:: Processing KEGG Pathways: working on it, 1/180 	:: Loading 'uniprot-sec' to 'uniprot-pri' mapping table
	:: Loading 'genesymbol' to 'trembl' mapping table
	:: Loading 'genesymbol-syn' to 'uniprot' mapping table
	:: Processing KEGG Pathways: finished, 180/180
	:: Downloading data from Signor: finished, 28/28
In [6]:
kegg_pathways_proteins, kegg_pathways_interactions = pa.get_pathways('kegg')
	:: Processing KEGG Pathways: finished, 180/180
In [7]:
print('Name\tNumber of proteins')
print('----\t------------------')
for i in kegg_pathways_proteins.keys():
    print('{}: {}'.format(i, len(kegg_pathways_proteins[i])))
Name	Number of proteins
----	------------------
Ras signaling pathway: 78
Toxoplasmosis: 49
Chemical carcinogenesis: 15
Antigen processing and presentation: 46
Sphingolipid signaling pathway: 60
Long-term potentiation: 36
Shigellosis: 27
Vibrio cholerae infection: 17
Salmonella infection: 33
Huntington's disease: 13
Type I diabetes mellitus: 6
Proteoglycans in cancer: 130
Apoptosis: 61
Rap1 signaling pathway: 79
ECM-receptor interaction: 15
Leukocyte transendothelial migration: 41
Cell cycle: 50
Morphine addiction: 21
Insulin signaling pathway: 81
Thyroid cancer: 16
Intestinal immune network for IgA production: 31
Hedgehog signaling pathway: 18
AMPK signaling pathway: 60
Insulin resistance: 53
Hippo signaling pathway: 47
Bacterial invasion of epithelial cells: 33
Circadian entrainment: 40
Renin secretion: 33
Wnt signaling pathway: 75
Graft-versus-host disease: 28
Prolactin signaling pathway: 47
Choline metabolism in cancer: 40
Regulation of lipolysis in adipocytes: 29
Hypertrophic cardiomyopathy (HCM): 18
Inflammatory bowel disease (IBD): 47
Complement and coagulation cascades: 63
Epstein-Barr virus infection: 78
Cell adhesion molecules (CAMs): 103
Thyroid hormone signaling pathway: 55
Synaptic vesicle cycle: 8
Proximal tubule bicarbonate reclamation: 6
Cytokine-cytokine receptor interaction: 191
Ovarian steroidogenesis: 24
Influenza A: 67
Phototransduction: 15
NF-kappa B signaling pathway: 56
Fc epsilon RI signaling pathway: 38
Osteoclast differentiation: 71
Alcoholism: 35
Alzheimer's disease: 32
B cell receptor signaling pathway: 49
African trypanosomiasis: 21
Autoimmune thyroid disease: 10
Basal cell carcinoma: 16
Vascular smooth muscle contraction: 42
Neurotrophin signaling pathway: 87
Insulin secretion: 35
Tuberculosis: 88
Renin-angiotensin system: 2
Gastric acid secretion: 24
Endometrial cancer: 28
Dopaminergic synapse: 37
T cell receptor signaling pathway: 69
Adipocytokine signaling pathway: 43
Longevity regulating pathway - multiple species: 32
PI3K-Akt signaling pathway: 79
TNF signaling pathway: 58
Aldosterone synthesis and secretion: 27
Chemokine signaling pathway: 57
mTOR signaling pathway: 37
Fc gamma R-mediated phagocytosis: 50
Colorectal cancer: 27
RIG-I-like receptor signaling pathway: 41
Gap junction: 50
Cardiac muscle contraction: 8
Renal cell carcinoma: 37
Regulation of actin cytoskeleton: 67
Non-small cell lung cancer: 36
Thyroid hormone synthesis: 23
Olfactory transduction: 12
Cytosolic DNA-sensing pathway: 22
VEGF signaling pathway: 36
Inflammatory mediator regulation of TRP channels: 45
HTLV-I infection: 86
Melanoma: 26
Hepatitis B: 93
Bladder cancer: 22
Phosphatidylinositol signaling system: 26
Hepatitis C: 53
Toll-like receptor signaling pathway: 84
Endocrine and other factor-regulated calcium reabsorption: 26
Epithelial cell signaling in Helicobacter pylori infection: 34
Glucagon signaling pathway: 37
HIF-1 signaling pathway: 34
Chronic myeloid leukemia: 40
Neuroactive ligand-receptor interaction: 16
Carbohydrate digestion and absorption: 6
GABAergic synapse: 17
Circadian rhythm: 13
Rheumatoid arthritis: 16
Measles: 58
Allograft rejection: 9
Natural killer cell mediated cytotoxicity: 145
Legionellosis: 40
Type II diabetes mellitus: 30
Transcriptional misregulation in cancer: 16
Dilated cardiomyopathy (DCM): 31
Signaling pathways regulating pluripotency of stem cells: 48
Bile secretion: 22
p53 signaling pathway: 68
Glutamatergic synapse: 41
Serotonergic synapse: 31
Glioma: 38
Vasopressin-regulated water reabsorption: 14
Jak-STAT signaling pathway: 25
Leishmaniasis: 33
Pathways in cancer: 164
Arrhythmogenic right ventricular cardiomyopathy (ARVC): 12
Pertussis: 27
Non-alcoholic fatty liver disease (NAFLD): 63
Longevity regulating pathway - mammal: 48
Estrogen signaling pathway: 42
Cocaine addiction: 22
MAPK signaling pathway: 155
Adrenergic signaling in cardiomyocytes: 55
Viral myocarditis: 24
Phospholipase D signaling pathway: 63
Viral carcinogenesis: 6
Adherens junction: 62
Staphylococcus aureus infection: 22
Systemic lupus erythematosus: 6
Pancreatic secretion: 14
Asthma: 3
Cholinergic synapse: 31
Aldosterone-regulated sodium reabsorption: 18
Acute myeloid leukemia: 38
Axon guidance: 74
Calcium signaling pathway: 32
cGMP-PKG signaling pathway: 58
Focal adhesion: 77
Retrograde endocannabinoid signaling: 12
Melanogenesis: 47
NOD-like receptor signaling pathway: 39
Amyotrophic lateral sclerosis (ALS): 32
Small cell lung cancer: 25
cAMP signaling pathway: 86
Oxytocin signaling pathway: 63
Platelet activation: 66
Prion diseases: 24
Herpes simplex infection: 68
Long-term depression: 30
Amphetamine addiction: 31
Fat digestion and absorption: 6
TGF-beta signaling pathway: 46
Pancreatic cancer: 47
Salivary secretion: 21
Chagas disease (American trypanosomiasis): 44
Notch signaling pathway: 21
FoxO signaling pathway: 89
Prostate cancer: 42
Malaria: 10
Maturity onset diabetes of the young: 31
Pathogenic Escherichia coli infection: 16
GnRH signaling pathway: 50
AGE-RAGE signaling pathway in diabetic complications: 72
Taste transduction: 15
Amoebiasis: 17
ErbB signaling pathway: 57
Mineral absorption: 10
Parkinson's disease: 15
Tight junction: 47
In [8]:
kegg_pathways_proteins['Prostate cancer']
Out[8]:
{'O15111',
 'O15530',
 'O43889',
 'P00533',
 'P01111',
 'P01112',
 'P01133',
 'P04637',
 'P06400',
 'P06493',
 'P10398',
 'P10415',
 'P10745',
 'P14210',
 'P15976',
 'P19838',
 'P24385',
 'P25963',
 'P28482',
 'P29323',
 'P35222',
 'P38936',
 'P42345',
 'P46527',
 'P49841',
 'P55211',
 'P62993',
 'Q00987',
 'Q01094',
 'Q02750',
 'Q07889',
 'Q12778',
 'Q15118',
 'Q6A1A2',
 'Q8WYR1',
 'Q92793',
 'Q92934',
 'Q99801',
 'Q9BXP2',
 'Q9NWQ8',
 'Q9UJU2',
 'Q9Y243'}
In [9]:
set([pa.up(iprot)['label'] for iprot in kegg_pathways_proteins['Prostate cancer'] if iprot in pa.nodDct])
Out[9]:
{'AKT3',
 'ARAF',
 'BAD',
 'BCL2',
 'CASP9',
 'CCND1',
 'CDK1',
 'CDKN1A',
 'CDKN1B',
 'CHUK',
 'CREB3',
 'CREBBP',
 'CTNNB1',
 'E2F1',
 'EGF',
 'EGFR',
 'EPHB2',
 'FOXO1',
 'GATA1',
 'GRB2',
 'GSK3B',
 'HGF',
 'HRAS',
 'LEF1',
 'MAP2K1',
 'MAPK1',
 'MDM2',
 'MTOR',
 'NFKB1',
 'NFKBIA',
 'NKX3-1',
 'NRAS',
 'PAG1',
 'PDK1',
 'PDPK1',
 'PDPK2P',
 'RB1',
 'SOS1',
 'TP53'}
In [10]:
# Load the ipython display and image module
from IPython.display import Image
from IPython.display import display

display(Image('http://www.genome.jp/kegg/pathway/hsa/hsa05215.png'))
In [11]:
pc_proteins = [i for i in kegg_pathways_proteins['Prostate cancer'] if i in pa.nodDct]
pc_subgraph = pa.graph.induced_subgraph(pc_proteins)
In [12]:
plot2 = igraph.plot(pc_subgraph, layout=pc_subgraph.layout_auto())
plot2.save('pc_subgraph.png')
display(Image('pc_subgraph.png'))
In [13]:
set(pc_subgraph.vs['label'])
Out[13]:
{'AKT3',
 'ARAF',
 'BAD',
 'BCL2',
 'CASP9',
 'CCND1',
 'CDK1',
 'CDKN1A',
 'CDKN1B',
 'CHUK',
 'CREB3',
 'CREBBP',
 'CTNNB1',
 'E2F1',
 'EGF',
 'EGFR',
 'EPHB2',
 'FOXO1',
 'GATA1',
 'GRB2',
 'GSK3B',
 'HGF',
 'HRAS',
 'LEF1',
 'MAP2K1',
 'MAPK1',
 'MDM2',
 'MTOR',
 'NFKB1',
 'NFKBIA',
 'NKX3-1',
 'NRAS',
 'PAG1',
 'PDK1',
 'PDPK1',
 'PDPK2P',
 'RB1',
 'SOS1',
 'TP53'}
In [14]:
# 5 most frequently mutated genes in prostate cancer.
query_nodes = set(['PTEN', 'FOXA1', 'TP53', 'SPOP', 'AR'])
In [15]:
for igene in query_nodes:
    print(igene)
    print(pa.gs(igene)['kegg_pathways'])
    print(pa.gs(igene)['signalink_pathways'])
    print(pa.gs(igene)['signor_pathways'])
    print(pa.gs(igene)['netpath_pathways'])
    print('---')
FOXA1
set([])
set([])
set([])
set([u'Androgen receptor (AR)'])
---
PTEN
set([u'Phosphatidylinositol signaling system', u'Sphingolipid signaling pathway', u'Focal adhesion', u'Tight junction', u'Hepatitis B', u'FoxO signaling pathway', u'p53 signaling pathway'])
set(['HH', 'TNF/Apoptosis', 'WNT', 'RTK', 'IIP'])
set([u'MTOR Signaling', u'Insulin Receptor'])
set([u'Androgen receptor (AR)'])
---
SPOP
set([])
set(['HH', 'JAK/STAT'])
set([])
set([])
---
AR
set([u'ErbB signaling pathway', u'Pathways in cancer', u'Hippo signaling pathway'])
set(['IIP', 'autophagy'])
set([])
set([u'Androgen receptor (AR)', u'Interleukin-6 (IL-6)', u' Transforming growth factor beta (TGF-beta) receptor ', u'Alpha6 Beta4 Integrin'])
---
TP53
set([u'HTLV-I infection', u'Melanoma', u'Bladder cancer', u'Sphingolipid signaling pathway', u'Chronic myeloid leukemia', u'Proteoglycans in cancer', u'Apoptosis', u'Neurotrophin signaling pathway', u'Cell cycle', u'p53 signaling pathway', u'Viral carcinogenesis', u'PI3K-Akt signaling pathway', u'Pathways in cancer', u'Hepatitis B', u'Hepatitis C', u'Longevity regulating pathway - mammal', u'Wnt signaling pathway', u'Prostate cancer', u'Thyroid hormone signaling pathway', u'Glioma', u'MAPK signaling pathway', u'Epstein-Barr virus infection', u'Measles'])
set(['Notch', 'TNF/Apoptosis', 'IIP', 'RTK', 'autophagy'])
set([u'Mitochondrial Control of Apoptosis', u'P38 Signaling', u'AcuteMyeloidLeukemia'])
set([u' Transforming growth factor beta (TGF-beta) receptor '])
---

Taking a look at the list of pathways each node participates in, we can find a set that connect all of them. For example, 'Androgen receptor (AR)' of 'netpath', 'HH' of 'signalink' and 'Transforming growth factor beta (TGF-beta) receptor' of 'netpath'.

In [16]:
connector_pathways = {'signalink_pathways': set(['HH']), 
                      'netpath_pathways': set([u'Androgen receptor (AR)', 
                                               u' Transforming growth factor beta (TGF-beta) receptor '])}
In [17]:
filter_func = []
filter_func.append(lambda vertex: 'HH' in vertex['signalink_pathways'])
filter_func.append(lambda vertex: u'Androgen receptor (AR)' in vertex['netpath_pathways'])
filter_func.append(lambda vertex: u' Transforming growth factor beta (TGF-beta) receptor ' in vertex['netpath_pathways'])
In [18]:
connector_node_list = pa.graph.vs.select(lambda vertex: any(i(vertex) for i in filter_func))
In [19]:
connector_subgraph = pa.graph.induced_subgraph(connector_node_list)
print('Number of nodes: {}'.format(connector_subgraph.vcount()))
print('Number of edges: {}'.format(connector_subgraph.ecount()))
Number of nodes: 358
Number of edges: 1562
In [20]:
plot2 = igraph.plot(connector_subgraph, layout=connector_subgraph.layout_auto(), vertex_label=None)
plot2.save('pc_connector_subgraph.png')
display(Image('pc_connector_subgraph.png'))
In [21]:
sns.plt.hist(connector_subgraph.degree(), bins=100)
Out[21]:
(array([ 60.,  77.,  28.,  48.,  17.,  39.,   9.,  14.,   9.,  12.,   3.,
          9.,   1.,   6.,   1.,   2.,   0.,   1.,   4.,   3.,   0.,   0.,
          1.,   1.,   1.,   1.,   1.,   0.,   0.,   1.,   2.,   1.,   0.,
          0.,   0.,   3.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   1.,
          0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,
          0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   1.,   0.,   0.,
          0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,
          0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,
          0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,   0.,
          1.]),
 array([   0.  ,    1.53,    3.06,    4.59,    6.12,    7.65,    9.18,
          10.71,   12.24,   13.77,   15.3 ,   16.83,   18.36,   19.89,
          21.42,   22.95,   24.48,   26.01,   27.54,   29.07,   30.6 ,
          32.13,   33.66,   35.19,   36.72,   38.25,   39.78,   41.31,
          42.84,   44.37,   45.9 ,   47.43,   48.96,   50.49,   52.02,
          53.55,   55.08,   56.61,   58.14,   59.67,   61.2 ,   62.73,
          64.26,   65.79,   67.32,   68.85,   70.38,   71.91,   73.44,
          74.97,   76.5 ,   78.03,   79.56,   81.09,   82.62,   84.15,
          85.68,   87.21,   88.74,   90.27,   91.8 ,   93.33,   94.86,
          96.39,   97.92,   99.45,  100.98,  102.51,  104.04,  105.57,
         107.1 ,  108.63,  110.16,  111.69,  113.22,  114.75,  116.28,
         117.81,  119.34,  120.87,  122.4 ,  123.93,  125.46,  126.99,
         128.52,  130.05,  131.58,  133.11,  134.64,  136.17,  137.7 ,
         139.23,  140.76,  142.29,  143.82,  145.35,  146.88,  148.41,
         149.94,  151.47,  153.  ]),
 <a list of 100 Patch objects>)
In [ ]: