Site icon R-bloggers

Plotting molecular properties for (sub)sets

[This article was first published on chem-bla-ics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
For a toxicology paper we are writing up, I need to create a few plots showing how the toxic and non-toxic molecules differ (or not) with respect to a few molecular properties, such as logP or the molecular weight. The rcdk package provides all, of course, except for a nice convenience method (or does it?) to make a plot. That is, I just want to do something like:
plot.propdist(
  mols,
  selections=list(all, actives, inactives),
  descriptor=
    "org.openscience.cdk.qsar.descriptors.molecular.WeightDescriptor",
  main="", xlab="Weight"
)
And now I can. The result looks something like:


Not much difference in this plot. The colors can be changed, if you like, overwriting the rainbow defaults.

The source code of my method (licensed MIT):

To leave a comment for the author, please follow the link and comment on their blog: chem-bla-ics.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.