Open felipealbrecht opened 7 years ago
import xmlrpclib url = "http://deepblue.mpi-inf.mpg.de/xmlrpc" deepblue = xmlrpclib.Server(url, allow_none=True)
USER_KEY = "anonymous_key"
genes = ["ADH1B", "ADH1A", "ADH1C", "ADH4", "ADH5", "ADH6", "ADH7", "GSTA1", "GSTA2", "GSTA3", "GSTA4"]
(status, q_genes) = server.select_genes(genes, None, "gencode v23", None, None, None, user_key)
(status, request_id) = server.get_regions(q_genes, "@GENE_NAME(gencode v22),CHROMOSOME,START,END,GTF_ATTRIBUTES", user_key)
def download_data(request_id): (status, info) = deepblue.info(request_id, user_key) request_status = info[0]["state"] while request_status != "done" and request_status != "failed": print request_status time.sleep(1) (status, info) = deepblue.info(request_id, user_key) request_status = info[0]["state"] (status, regions) = deepblue.get_request_data(request_id, user_key) return regions
genes_regions = download_data(request_id)
import xmlrpclib url = "http://deepblue.mpi-inf.mpg.de/xmlrpc" deepblue = xmlrpclib.Server(url, allow_none=True)
USER_KEY = "anonymous_key"
genes = ["ADH1B", "ADH1A", "ADH1C", "ADH4", "ADH5", "ADH6", "ADH7", "GSTA1", "GSTA2", "GSTA3", "GSTA4"]
(status, q_genes) = server.select_genes(genes, None, "gencode v23", None, None, None, user_key)
(status, request_id) = server.get_regions(q_genes, "@GENE_NAME(gencode v22),CHROMOSOME,START,END,GTF_ATTRIBUTES", user_key)
def download_data(request_id): (status, info) = deepblue.info(request_id, user_key) request_status = info[0]["state"] while request_status != "done" and request_status != "failed": print request_status time.sleep(1) (status, info) = deepblue.info(request_id, user_key) request_status = info[0]["state"] (status, regions) = deepblue.get_request_data(request_id, user_key) return regions
genes_regions = download_data(request_id)