Beispiel #1
0
import os
import xml.etree.cElementTree as element_tree

import networkx as nx
from bioservices import KEGG

import magine.networks.utils as utils
from magine.data.storage import network_data_dir

try:
    import cPickle as pickle
except:
    import pickle

kegg = KEGG()
kegg.TIMEOUT = 100


def pathway_id_to_network(pathway_id, species='hsa'):
    """
    Creates a network from a KEGG pathway id

    Parameters
    ----------
    pathway_id : str
        KEGG id
    species : str

    Returns
    -------
    nx.DiGraph