Closed schymane closed 6 years ago
Try the latest version in Github (v 3.4.3). Example usage is
library(rcdk)
m <- parse.smiles('C1C=CCC1N(C)c1ccccc1')[[1]]
get.smiles(m)
get.smiles(m, smiles.flavor(c('Generic','UseAromaticSymbols', 'CxSMILES'))
See the smiles.flavor
for possible flavor values.
Do you have examples where you can test out the CxSmiles flavor?
I added one example in https://github.com/rajarshi/cdkr/pull/51 If I have CxSmiles input, it reinterprets and exports CxSmiles (see examples). If I start from a non-CxSmiles, this stays:
get.smiles(parse.smiles("c1ccccc1")[[1]]) [1] "C1=CC=CC=C1" get.smiles(parse.smiles("c1ccccc1")[[1]],flavor = smiles.flavors(c("CxSmiles"))) [1] "C1=CC=CC=C1"
Haven't yet figured out how to get the coords if I don't start with them, any ideas? I'll send more examples by mail; can take a closer look later.
If the molecule doesn't have coordinates, the CxSmiles flavor won't generate them when writing the SMILES. However, if coordinates are there, use the Cx2dCoordinates
flavor.
library(rcdk)
m <- parse.smiles('CCC')[[1]]
m <- generate.2d.coordinates(m)
get.smiles(m, smiles.flavors(c('CxSmiles')))
get.smiles(m, smiles.flavors(c('Cx2Coordinates')))
https://cdk.github.io/cdk/2.0/docs/api/index.html?org/openscience/cdk/smiles/SmiFlavor.html
https://cdk.github.io/cdk/2.0/docs/api/org/openscience/cdk/smiles/SmilesGenerator.html
I'll be very happy to test it out :-)