selcukorkmaz / PubChemR

1 stars 0 forks source link

API URL is incorrect for searchtype='cid' from request() function. #1

Closed dncR closed 8 months ago

dncR commented 8 months ago

Source file: request.R

Arguments

Code: request(c(2244, 3627), namespace = 'cid', domain = 'compound', operation = NULL, output = 'JSON', searchtype = "cid") Output: https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/cid/2244,3627/JSON

Side-effects: There is a duplicated "cid" component in the returned URL. The correct form should be https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244,3627/JSON

Lines raising this problem https://github.com/selcukorkmaz/PubChemR/blob/a54b12c1256a56f5238b198b60dafe5d730234cc/R/request.R#L58

The components namespace and searchtype are set as cid in the above code line, which are leading to malformed API URL.

selcukorkmaz commented 8 months ago

since namespace = "cid", searchtype cannot be set as "cid".