Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
DeepBlue Tutorial: listing data
import xmlrpclib
# Before going further, we must set up the client:
url = "http://deepblue.mpi-inf.mpg.de/xmlrpc"
server = xmlrpclib.Server(url, encoding='UTF-8', allow_none=True)
# You can use the anonymous key or your own user key
user_key = "anonymous_key"
# Listing all projects
server.list_projects(user_key)
# The result will be similar to ['okay', [['p1', 'ENCODE'], ['p2', 'BLUEPRINT Epigenome'], ['p5', 'Roadmap Epigenomics']]]
# Listing all registered epigenetic marks
server.list_epigenetic_marks(None, user_key)
# Part of the output will be ['okay', [['em1', 'DNA Methylation'], ['em10', 'Input'], ['em100', 'H3K9/14ac'], ['em101', 'H4K12ac'], ...
# We can list all experiments that are peaks (bed files), have H3k27ac as epigenetic mark and belongs to ENCODE or BLUEPRINT projects
(status, peaks_experiments) = server.list_experiments("", "peaks", "H3K27ac", "", "", "", ["ENCODE", "Blueprint Epigenome"], user_key)
# We expect more than 400 peaks experiments!
len(peaks_experiments)
# We can also list all experiments that are signal (wiggle and bedgraph files), have H3k27ac as epigenetic mark and belongs to ENCODE or BLUEPRINT projects
(status, signal_experiments) = server.list_experiments("", "signal", "H3K27ac", "", "", "", ["ENCODE", "Blueprint Epigenome"], user_key)
# We expect more than 300 peaks experiments!
len(signal_experiments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment