Closed xdomingoal closed 3 months ago
Hi, here is an example.
# devtools::install_github("CDK-R/depict")
library(rcdk)
library(depict)
mol <- depict::parse_smiles("C1CCCCC1")
depiction() %>%
depict(mol) %>%
get_image() %>%
grid::grid.raster()
# use rJava `as.list` method to view the Java iterator as a list
list_of_atoms <- as.list(mol$atoms())
# delete the atom of interest
mol$removeAtom(list_of_atoms[[1]])
depiction() %>%
depict(mol) %>%
get_image() %>%
grid::grid.raster()
How can you remove a specific atom from a molecule (IAtomContainer) using CDK in R?