CDK-R / cdkr

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

Update cdk 2.0 to 2.1.1 jars #63

Closed allaway closed 6 years ago

allaway commented 6 years ago

Specifically updated cdk jars to enable chirality perception using circular fingerprints (in version 2.1.1 of cdk).

library(rcdk)
library(fingerprint)

getInputFingerprint <- function(input, type) {
  input.mol <- parse.smiles(as.character(input))
  lapply(input.mol, do.typing)
  lapply(input.mol, do.aromaticity)
  lapply(input.mol, do.isotopes)
  lapply(input.mol, get.fingerprint, type = type)
}

alanine <- c("N[C@@H](C)C(=O)O","N[C@H](C)C(=O)O")
alanine.fp <- getInputFingerprint(alanine, "circular")
distance(alanine.fp[[1]], alanine.fp[[2]])

Result: [1] 0.7333333

I'm unsure what the contribution standards are for rcdk, but I wanted to share that this was an easy fix and that it does work for stereochemistry detection.

rajarshi commented 6 years ago

Thanks - didn't realize this was on by default. Merged into master