Introduction

This notebook shows how to load the Negatome database (http://mips.helmholtz-muenchen.de/proj/ppi/negatome/), which contains information on experimentally supported non-interacting protein pairs.

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: '5e2m0'
	logfile:'./log/5e2m0.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/5e2m0.log
In [5]:
print('Number of nodes: {}'.format(pa.graph.vcount()))
print('Number of edges: {}'.format(pa.graph.ecount()))
Number of nodes: 7476
Number of edges: 29949

We can load the Negatome resource as follows:

In [6]:
pa.load_resources(lst=pypath.data_formats.negative)
	:: 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-`.
 » Negatome
	:: Loading data from cache previously downloaded from mips.helmholtz-muenchen.de
	:: Ready. Resulted `plain text` of type file object. 
	:: Local file at `/Users/admin/Documents/ltobalina/COMBINE/Projects/PrECISE/Code/Omnipath/cache/8db2664651347109a3f8e161f02ced2a-manual.txt`.
	:: Loading 'uniprot-sec' to 'uniprot-pri' mapping table
	:: Loading 'genesymbol' to 'trembl' mapping table
	:: Loading 'genesymbol' to 'swissprot' mapping table
	:: Loading 'genesymbol-syn' to 'swissprot' mapping table
	:: 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.

 » 31158 interactions between 7609 nodes
 from 28 resources have been loaded,
 for details see the log: ./log/5e2m0.log
In [7]:
print('Number of nodes: {}'.format(pa.graph.vcount()))
print('Number of edges: {}'.format(pa.graph.ecount()))
Number of nodes: 7609
Number of edges: 31158

Note that the number of nodes and edges has increased after loading the Negatome database. Now the edges in the graph consist of both, interactions supported by the literature and non-existent interactions according to Negatome.

We can get a list of the edges that are part of the Negatome as follows:

In [8]:
negatome_edge_list = pa.graph.es.select(lambda edge: 'Negatome' in edge['sources'])

If we explore the first edge in the list, we can see that, as could be expected, many of its attributes are empty.

In [9]:
i_negatome_edge_source = pa.graph.vs[negatome_edge_list[0].source]['label']
i_negatome_edge_target = pa.graph.vs[negatome_edge_list[0].target]['label']
print('Negatome edge:')
print('\t{} == {}'.format(i_negatome_edge_source, i_negatome_edge_target))
print('\tmethod: {}'.format(*negatome_edge_list[0]['negatome_methods']))

negatome_edge_list[0].attributes()
Negatome edge:
	AKT1 == YWHAB
	method: coimmunoprecipitation
Out[9]:
{'ca1_effect': u'',
 'ca1_type': u'',
 'dd_methods': [],
 'dip_methods': [],
 'dip_type': [],
 'dirs': <pypath.main.Direction at 0x12ce13c90>,
 'domino_methods': [],
 'hprd_mechanism': [],
 'is_direct': u'',
 'is_directed': u'',
 'macrophage_location': [],
 'macrophage_type': [],
 'matrixdb_methods': [],
 'mppi_evidences': [],
 'negative': None,
 'negative_refs': None,
 'negatome_methods': ['coimmunoprecipitation'],
 'netbiol_effect': [],
 'netbiol_is_direct': [],
 'netbiol_is_directed': '',
 'netbiol_mechanism': [],
 'netpath_methods': [],
 'netpath_pathways': [],
 'netpath_type': [],
 'psite_evidences': [],
 'references': ['12177059'],
 'refs_by_dir': {'undirected': []},
 'refs_by_source': {'Negatome': []},
 'refs_by_type': {'PPI': []},
 'signor_mechanism': [],
 'sources': ['Negatome'],
 'sources_by_type': {'PPI': ['Negatome']},
 'spike_effect': u'',
 'spike_mechanism': u'',
 'trip_methods': [],
 'type': ['PPI']}

However, we may wonder if there are edges with contradictory evidence, i.e. with support in the literature and also listed in Negatome.

In [10]:
n_sources = np.array([len(i) for i in negatome_edge_list['sources']])
print('Number of edges with contradictory evidence: {}'.format(np.sum(n_sources>1)))
Number of edges with contradictory evidence: 127
In [11]:
hist_data = sns.plt.hist(n_sources, 100)
sns.plt.xlabel('Number of sources')
sns.plt.ylabel('Number of edges')
Out[11]:
<matplotlib.text.Text at 0x12dafafd0>
In [12]:
contradictory_edges = negatome_edge_list.select(lambda edge: len(edge['sources'])>1)

We can have a look at one of these contradictory edges:

In [13]:
i_contradictory_edge = contradictory_edges[0]
i_source_label = pa.graph.vs[i_contradictory_edge.source]['label']
i_target_label = pa.graph.vs[i_contradictory_edge.target]['label']
print(' == '.join([i_source_label, i_target_label]))
print('Sources: ' + ', '.join(i_contradictory_edge['sources']))
AKT1 == TSC1
Sources: Negatome, SPIKE

We can see what are the references supporting this interaction in SPIKE.

In [14]:
i_contradictory_edge['refs_by_source']['SPIKE']
Out[14]:
[<pypath.main.Reference at 0x121cf8e10>]
In [15]:
contradictory_ref = i_contradictory_edge['refs_by_source']['SPIKE'][0]
contradictory_ref_info = contradictory_ref.info()[contradictory_ref.pmid]
# contradictory_ref.open()  # opens reference in pubmed
	:: Retrieving data from NCBI e-utils: working on it, 1/1 	:: Loading data from cache previously downloaded from eutils.ncbi.nlm.nih.gov
	:: Ready. Resulted `plain text` of type file object. 
	:: Local file at `/Users/admin/Documents/ltobalina/COMBINE/Projects/PrECISE/Code/Omnipath/cache/fafba5fa5b03b801db02cb0a674fd64b-esummary.fcgi`.
	:: Retrieving data from NCBI e-utils: finished, 1/1
In [16]:
def citation_from_ref(ref_dict):
    author_str = ', '.join([i['name'] for i in ref_dict['authors']])
    title_str = ref_dict['title']
    year_str = ref_dict['sortpubdate'][0:4]
    journal_str = ref_dict['fulljournalname']
    citation_str = author_str + ' ({}) '.format(year_str) + title_str + ' ' + journal_str
    return citation_str
In [17]:
print(citation_from_ref(contradictory_ref_info))
Altomare DA, Testa JR (2005) Perturbations of the AKT signaling pathway in human cancer. Oncogene

We can review the reference and decide if the interaction can actually take place according to the literature.

In [ ]: