CDK-R / cdkr

Integrating R and the CDK
https://cdk-r.github.io/cdkr/
42 stars 27 forks source link

problem with load.molecules in rcdk 3.2.7 #24

Closed zhilongjia closed 6 years ago

zhilongjia commented 10 years ago

load.molecules(molfiles="http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=6442441&disopt=SaveSDF")

Error in as.character.default(X[[1L]], ...) : no method for coercing this S4 class to a vector

Same Error for the local file of this chemical.

however in version 3.2.3.2 This error will be https://www.biostars.org/p/100384/ (in my comments)

for CID: 6442441, http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=6442441&disopt=SaveSDF

descriptors: "org.openscience.cdk.qsar.descriptors.molecular.RuleOfFiveDescriptor"; "org.openscience.cdk.qsar.descriptors.molecular.XLogPDescriptor"

! /usr/bin/Rscript

require(rcdk) drug.mols <- load.molecules(molfiles="./CID_6442441.sdf") drug.descs <- eval.desc(drug.mols, "org.openscience.cdk.qsar.descriptors.molecular.RuleOfFiveDescriptor", verbose=T)

drug.descs <- eval.desc(drug.mols, "org.openscience.cdk.qsar.descriptors.molecular.XLogPDescriptor", verbose=T)

Error in .jcall(b, "Lorg/openscience/cdk/qsar/DescriptorValue;", "calculate", : java.lang.NullPointerException

Thank you. the rcdk is will helpful to me.

rajarshi commented 6 years ago

The download issue is caused by the fact that your original URL needs Javscript to work. Thus it works in your browser but won't work from the command line using wget or curl. Instead you need to use PUG - https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/6442441/SDF.

Using this URL works with load.molecules. Also the descriptors now compute properly with the latest Github version of rcdk