Snippets

Dénes Türei How to translate network from one taxon to other by orthology with pypath

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

import pypath
import itertools

pa = pypath.PyPath()

# uncomment either (A) or (B)

# (A) Load only causal resources:

# pa.init_network(pypath.data_formats.pathway)
# pa.load_resources(pypath.data_formats.ptm)
# pa.third_source_directions()
# pa.remove_htp(threshold = 1, keep_directed = True)
# pa.remove_undirected(min_refs = 2)
# pa.clean_graph()

# (B) or load the full OmniPath:

# pa.load_omnipath()

# enzyme-substrate interactions can not be translated
# need to be removed and loaded again:

if 'ptm' in pa.graph.es.attributes():
    del pa.graph.es['ptm']

# translate to mouse (10090)

pa.orthology_translation(10090)

# load mouse enzyme-substrate interaction data:

pa.load_ptms()

# Ready.

Comments (0)

HTTPS SSH

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