drugbank icon indicating copy to clipboard operation
drugbank copied to clipboard

DrugBank to UniChem mapping: cannot decode json

Open PARODBE opened this issue 2 years ago • 6 comments

Hi!

Thank you for so useful repository. I have one question, when I am following your code for obtaing the mapping codes, I am getting the next error:

image

Could you help me, please??

Thanks Pablo

PARODBE avatar Jun 10 '22 09:06 PARODBE

Taking a look at some of the log output we committed from the past, I see the same message:

https://github.com/dhimmel/drugbank/blob/6b9ae386d6ba4a0eca2d66d4b0337a6e90fe81f4/data/mapping-log.txt#L1913-L1915

I think these are cases where the UniChem mapping fails, see cell 37 of unichem-map.ipynb. So you can probably proceed with these failures, as they're cases perhaps where the chemical structure is not in UniChem?

How many drugbank IDs are you trying to map and how many have the failure?

dhimmel avatar Jun 10 '22 12:06 dhimmel

Thank you for your response, I am trying to map around 14.000 IDs and I have stopped the cell because for the first 800 ID I am obtaining the same error...any idea?

PARODBE avatar Jun 10 '22 12:06 PARODBE

That error message occurs anytime the UniChem response doesn't return valid JSON, but it's probably that the API is returning an error.

This website works: https://www.ebi.ac.uk/unichem/search/connectivity?type=sourceID&compound=DB00006&sourceID=2

Looks like the UniChem API might have had an update. See the current docs at https://www.ebi.ac.uk/unichem/api/docs

dhimmel avatar Jun 10 '22 22:06 dhimmel

Ok if I replace key_search by inchi, I can see this: image

I think that it is correct, but in cpd_search in my opinion the information can be extracted from inchi, no? Because, I can see the: 'src_id', 'src_compound_id', but I not sure as I can do this.

Thanks

PARODBE avatar Jun 11 '22 06:06 PARODBE

I imagine it's okay to search only by inchikey, although I must have seen some benefit to first trying the identifier search. I imagine the identifier search is still possible, we just have to figure out the right API call for it.

dhimmel avatar Jun 11 '22 11:06 dhimmel

Yes! I agree, It must have some benefit to first trying the identifier. How can I extract the information only using the inchikey? Could you put the code with this option? It would be great...

PARODBE avatar Jun 11 '22 12:06 PARODBE