This is a test version of Biostars. For the public version, visit https://www.biostars.org.
in R package rcdk, to get the descriptor of some chemicals, eval.desc error when tackling some descriptor, such as BasicGroupCountDescriptor

I want to get the descriptor of some compounds, but the function eval.desc alwayls tell error.

data:

CID: 175540 (CID_175540.sdf can be get from PubChem)

code

#! /usr/bin/Rscript
require(rcdk)
drug.mols <- load.molecules(molfiles="./CID_175540.sdf")
descNames <- unique(unlist(sapply(get.desc.categories(), get.desc.names)))
drug.descs <- eval.desc(drug.mols, descNames, verbose=T)

But, Error:

Processing  BasicGroupCountDescriptor
Error in if (is.na(dval)) return(NA) : argument is of length zero
Calls: eval.desc -> lapply -> FUN
In addition: Warning message:
In is.na(dval) : is.na() applied to non-(list or vector) of type 'NULL'
Execution halted

AcidicGroupCountDescriptor is the same.

Thank you.

eval.desc rcdk

I can reproduce the issue. It seems to me to be a bug...

1 answer

Now fixed in Github. Using rcdk from Github requires that you use rcdklibs from Github. All will be pushed to CRAN in the near future

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

I do not know did you fix this two, so I just post it here. Maybe the same problem.

Log in to answer this question.