Jrbald
Jrbald

Reputation: 15

R timeout with readLines

I'm using a package called chemminR to look for molecules that are similar to each other in structure. I have been able to run this code with success for some of the values I am inputting, but for others it fails.

When I run

pubchemSmilesSearch("CN1CCC[C@H]1c1cccnc1")

I get:

Error in readLines(suppressWarnings(url(url))) : 
  cannot open the connection to 'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastsimilarity_2d/smiles/CN1CCC[C@H]1c1cccnc1/SDF'
In addition: Warning message:
In readLines(suppressWarnings(url(url))) :
  cannot open URL 'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastsimilarity_2d/smiles/CN1CCC[C@H]1c1cccnc1/SDF': HTTP status was '504 Gateway Timeout' 

When I run

m <- pubchemSmilesSearch("CC[C@H]1C[C@H]2CN3Cn4c(c(COC)c5ccc(OC)cc54)[C@](C(=O)OC)(C2)[C@H]13")

sdfid(m)

I get the correct output from the website of:

"118711168" "146165483"

Does anyone know what is wrong with readLines in this case?

Upvotes: 0

Views: 43

Answers (0)

Related Questions