"...psot.repository.git" did not exist on "8c34e9046fd5b359aebf3f0d333e1873c0421686"
Select Git revision
nextflow.py
dbxref.py 926 B
def dbxrefs_from_documents(documents):
refs = set()
for key in documents:
refs.update(dbxrefs_from_document(documents[key]))
return refs
def dbxrefs_from_document(document):
'''finds all dbxrefs in the document and returns a list of ids'''
refs = []
for c in document['computations']:
for r in c['results']:
if 'target'in r and 'dbxref' in r['target']:
refs.append(r['target']['dbxref'])
return set(refs)
def combine_with_documents(documents, informations):
for k in documents:
combine_with_document(documents[k], informations)
def combine_with_document(document, informations):
'''adds an information tag for each result that references a dbxref'''
for c in document['computations']:
for r in c['results']:
if 'target' in r and 'dbxref' in r['target']:
r['informations'] = next(entry for entry in informations if entry['id'] == r['target']['dbxref'])