felipealbrecht
10/14/2015 - 1:51 PM

Identification of H3k27ac peaks that overlap with promoters in all BLUEPRINT datasets and subsequent identification of transcription factor

Identification of H3k27ac peaks that overlap with promoters in all BLUEPRINT datasets and subsequent identification of transcription factor peaks that overlap with these promoters, on all ENCODE datasets

import xmlrpclib
import time

url = "http://deepblue.mpi-inf.mpg.de/xmlrpc"
user_key = "anonymous_key"

server = xmlrpclib.Server(url, allow_none=True)

(status, exps) = server.select_regions("", "GRCh38", "H3k27ac", "", "", 
                                       "BLUEPRINT Epigenome", "chr1", None,
                                        None, user_key)
(status, exps_peaks) = server.query_experiment_type(exps, "peaks", user_key)


(status, promoters) = server.select_annotations("promoters", "GRCh38","chr1", 
                                                None, None, user_key)

(status, exps_promoters) = server.intersection(exps_peaks, promoters, user_key)

(status, tf) = server.select_regions("","hg19", ["SP1"], "", 
                                     "", "ENCODE", "chr1", None, None, user_key)
(status, ts_signals) = server.query_experiment_type(tf, "signal", user_key)

(status, final) = server.intersection(tf, exps_promoters, user_key)

(status, request) = server.get_regions(final, 
                      "CHROMOSOME,START,END,@NAME,@EPIGENETIC_MARK,@BIOSOURCE",
                      user_key)

# Wait the processing
(status, info) = server.info(request, user_key)
while info[0]["state"] != "done" and info[0]["state"] != "error":
    time.sleep(5)
    print info
    (status, info) = server.info(request, user_key)

(status, regions) = server.get_request_data(request, user_key)
print regions