Snippets

Dénes Türei Access expression data with pypath

Created by Dénes Türei last modified
#!/usr/bin/env python

# Dénes Türei EMBL 2017
# turei.denes@gmail.com

import pypath
from pypath import data_formats as df

# initializing a PyPath object and loading a sample network
pa = pypath.PyPath()
pa.load_resources({'signor': df.pathway['signor']})

# here we download data from one tissue (BTO:0000661)
# ProteomicsDB is huge, downloading all tissues would
# take maybe one hour
# to access ProteomicsDB data, you need to register on
# their webpage and write an email requesting access
# to the API; once they grant access you can use your
# user and password here:
pa.get_proteomicsdb(user = 'myusername',
                    passwd = 'mypassword',
                    tissues = ['BTO:0000661'])
# here we can see all available tissues and samples
# in ProteomicsDB:
pa.proteomicsdb.samples
# loading the expression values (FPKMs) into a vertex attribute:
pa.prdb_tissue_expr(tissue = 'BTO:0000661')
# filter the network by deleting all proteins not detected in Jurkat cells:
jurkat_cell_network = pa.tissue_network('BTO:0000661')

# loading all data from Human Protein Atlas
pa.load_hpa()
# attributes with tissue names have been created:
pa.graph.vs.attribute_names()
# filter the network by simply deleting all proteins
# having 0 value for urothelial cells:
urothelium_network = pa.tissue_network('urinary bladder:urothelial cells')

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.