Skip to content
Snippets Groups Projects
Commit fefc07d6 authored by cramakri's avatar cramakri
Browse files

Have the ipad read service return the extra metadata

SVN: 27086
parent 32016742
No related branches found
No related tags found
No related merge requests found
......@@ -29,18 +29,19 @@ def add_row(builder, entry):
def material_to_dict(material):
material_dict = {}
material_dict['SUMMARY_HEADER'] = material.getCode()
material_dict['SUMMARY'] = material.getPropertyValue("DESC")
material_dict['IDENTIFIER'] = material.getMaterialIdentifier()
material_dict['PERM_ID'] = material.getMaterialIdentifier()
material_dict['ENTITY_KIND'] = 'MATERIAL'
material_dict['ENTITY_TYPE'] = material.getMaterialType()
if material.getMaterialType() == '5HT_COMPOUND':
chemblId = material.getCode()
material_dict['SUMMARY'] = material.getPropertyValue("FORMULA")
material_dict['IMAGE_URL'] = 'https://www.ebi.ac.uk/chemblws/compounds/%s/image' % chemblId
else:
material_dict['SUMMARY'] = material.getPropertyValue("DESC")
material_dict['IMAGE_URL'] = ""
prop_names = ["NAME", "PROT_NAME", "GENE_NAME", "LENGTH", "CHEMBL", "DESC"]
prop_names = ["NAME", "PROT_NAME", "GENE_NAME", "LENGTH", "CHEMBL", "DESC", "FORUMLA", "WEIGHT", "SMILES"]
properties = dict((name, material.getPropertyValue(name)) for name in prop_names if material.getPropertyValue(name) is not None)
material_dict['PROPERTIES'] = ObjectMapper().writeValueAsString(properties)
return material_dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment