Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrugBank to UniChem mapping: cannot decode json #7

Open
PARODBE opened this issue Jun 10, 2022 · 6 comments
Open

DrugBank to UniChem mapping: cannot decode json #7

PARODBE opened this issue Jun 10, 2022 · 6 comments

Comments

@PARODBE
Copy link

PARODBE commented Jun 10, 2022

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

@dhimmel
Copy link
Owner

dhimmel commented Jun 10, 2022

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

drugbank/data/mapping-log.txt

Lines 1913 to 1915 in 6b9ae38

DB02147 Cyclo-Tetrametavanadate
cannot decode json: https://www.ebi.ac.uk/unichem/rest/cpd_search/DB02147/2/0/0/4/0/0/0/0/1
cannot decode json: https://www.ebi.ac.uk/unichem/rest/key_search/ACTPEXQBEHJTBO-UHFFFAOYSA-N/0/0/4/0/0/0/0/1

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 dhimmel changed the title Mapping DrugBank to UniChem mapping: cannot decode json Jun 10, 2022
@PARODBE
Copy link
Author

PARODBE commented Jun 10, 2022

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?

@dhimmel
Copy link
Owner

dhimmel commented Jun 10, 2022

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

@PARODBE
Copy link
Author

PARODBE commented Jun 11, 2022

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

@dhimmel
Copy link
Owner

dhimmel commented Jun 11, 2022

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.

@PARODBE
Copy link
Author

PARODBE commented Jun 11, 2022

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants