Skip to content

Instantly share code, notes, and snippets.

@felipealbrecht
Last active July 22, 2017 02:05
Show Gist options
  • Save felipealbrecht/620d77ed574fb2a90390 to your computer and use it in GitHub Desktop.
Save felipealbrecht/620d77ed574fb2a90390 to your computer and use it in GitHub Desktop.
Using full text search for searching for experiments
import xmlrpclib
url = "http://deepblue.mpi-inf.mpg.de/xmlrpc"
user_key = "anonymous_key"
server = xmlrpclib.Server(url, allow_none=True)
# We are selecting the experiments with terms 'H3k27AC', 'blood', and 'peak' in the metadata.
(status, experiments_found) = server.search("'H3k27AC' 'blood' 'peak'", "experiments", user_key)
for experiment in experiments_found:
experiment_id = experiment[0]
(status, info) = server.info(experiment_id, user_key)
print info[0]["name"], info[0]["description"], info[0]["sample_info"]["biosource_name"], info[0]["sample_id"], info[0]["epigenetic_mark"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment