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

update APIs #10

Open
korseby opened this issue Nov 6, 2020 · 3 comments
Open

update APIs #10

korseby opened this issue Nov 6, 2020 · 3 comments

Comments

@korseby
Copy link
Member

korseby commented Nov 6, 2020

There are several APIs that needs to be updated. They perform queries to online web services and were outdated. I fixed a bunch 3 months ago. These were the cs_inchikey_inchi-like function calls of the package webchem. They are now aggregated in one large function called cs_convert. It took me a while to discover that as the calls have been deprecated in the package without mentioning... An example is here in the latest commit:

https://github.com/korseby/RMassBank_mFam/blob/d29742edfd676dd1452aae774eb05d68cf9eb94c/galaxy/msp2massbank.r#L127

I suggest to take the version from one year ago as a reference as this is the version that has been known to work underlying the Docker image on dockerhub.

https://github.com/korseby/RMassBank_mFam/blob/93580571e7958175b955adf7efe13d7f0acb0c9b/galaxy/msp2massbank.r

https://hub.docker.com/r/korseby/msp2massbank

If you have questions, please mention me directly at github so I can help.

@sneumann
Copy link
Member

Minimum version of webchem needed has to be newer than 04.08.2020,
an issue was closed in ropensci/webchem#275.
And the R code in this repo needs to be newer than bab7818

@sneumann
Copy link
Member

Currently this fails with

Fetching structures and PubChem CIDs...pre...to inchi...Error in cs_check_key() : 
  no API key stored for ChemSpider.  See ?cs_check_key() for details
Calls: preprocessContributorToMassBankWorkflow ... tryCatchOne -> doTryCatch -> <Anonymous> -> cs_check_key

since a ChemSpider token needs to be provided. The above is used in
inchiKeyToInchi and smilesToInchi in

inchiKeyToInchi <- sapply(X = inchiKeys, FUN = function(inchiKey){ tryCatch({webchem::cs_convert(inchiKey, from="inchiKey", to="inchi", verbose = FALSE)}, warning = function(w) {ifelse(test = w$message=="inchikey not found... Returning NA.", yes = NA, no = warning(w))}) })

=> I suggest to use a non-web service to convert that.
Yours,
Steffen

@korseby
Copy link
Member Author

korseby commented Nov 20, 2020

I tested the cs_convert function and it now works when defining a chemspider token in the R environment. I think, convert functions can be found in rcdk.

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