Last active
April 12, 2016 15:02
-
-
Save felipealbrecht/6b503fb93612cab9f47d to your computer and use it in GitHub Desktop.
Selecting data from one experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmlrpclib | |
import time | |
url = "http://deepblue.mpi-inf.mpg.de/xmlrpc" | |
user_key = "anonymous_key" | |
server = xmlrpclib.Server(url, allow_none=True) | |
# Selecting the data from 2 experiments: BL-2_c01.ERX297416.H3K27ac.bwa.GRCh38.20150527.bed and S008SGH1.ERX406923.H3K27ac.bwa.GRCh38.20150728.bed | |
# As we already know the experiments names, we keep all others fields empty. | |
(status, query_id) = server.select_experiments (["BL-2_c01.ERX297416.H3K27ac.bwa.GRCh38.20150527.bed", "S008SGH1.ERX406923.H3K27ac.bwa.GRCh38.20150728.bed"], None, None, None, user_key ) | |
# Count how many regions were selected | |
(status, request_id) = server.count_regions(query_id, user_key) | |
# Wait for the server processing | |
(status, info) = server.info(request_id, user_key) | |
request_status = info[0]["state"] | |
while request_status != "done" and request_status != "failed": | |
time.sleep(1) | |
(status, info) = server.info(request_id, user_key) | |
request_status = info[0]["state"] | |
(status, count) = server.get_request_data(request_id, user_key) | |
print "The two experiments have", count["count"], "regions" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment