MPIIComputationalEpigenetics / DeepBlue

DeepBlue Epigenomic Data Server
Other
2 stars 0 forks source link

Usability: expose DeepBlue _ids in XML-RPC queries #105

Closed ghost closed 8 years ago

ghost commented 8 years ago

The following should not fail; for getting specific info about single experiments, it is necessary to know exactly what ID the sample is referring to (e.g., to match controls to experiments based on the sample):

s,r = proxy.search('ENCFF000OSD', 'experiments', uk)
print(r)
expid = r[0][0]
s,r = proxy.info(expid, uk)
print(r)
smpid = r[0]['sample_info']['_id']
felipealbrecht commented 8 years ago

Short answer:

import xmlrpclib

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

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

s,r = proxy.search('ENCFF000OSD', 'experiments', uk) print(r) expid = r[0][0] s,r = proxy.info(expid, uk)

from pprint import pprint as pp smpid = r[0]['sample_id']

Long answer: The 'sample_info' contains exactly the metadata imported from the sample, we do not include any other information, for this reason, the internal sample id is stored in another place.

Bonus:

Do not use the search command for obtaining experiment info, use the list_experiments, passing the experiment name as 1st argument.

On Thu, Feb 25, 2016 at 3:53 PM Peter Ebert notifications@github.com wrote:

The following should not fail; for getting specific info about single experiments, it is necessary to know exactly what ID the sample is referring to (e.g., to match controls to experiments based on the sample):

s,r = proxy.search('ENCFF000OSD', 'experiments', uk)print(r) expid = r[0][0] s,r = proxy.info(expid, uk)print(r) smpid = r[0]['sample_info']['_id']

— Reply to this email directly or view it on GitHub https://github.com/MPIIComputationalEpigenetics/DeepBlue/issues/105.

felipealbrecht commented 8 years ago

Sorry, I said shit before. It is not possible anymore to obtain the experiment ID by list_experiments.