/rcdk/inst/unitTests/runit.atoms.R
http://github.com/rajarshi/cdkr · R · 33 lines · 28 code · 5 blank · 0 comment · 1 complexity · 5d1789dc0f3424cb569ed67eb695aa58 MD5 · raw file
- test.is.aromatic <- function()
- {
- m <- parse.smiles('c1ccccc1CC')[[1]]
- x <- unlist(lapply(get.atoms(m), is.aromatic))
- checkEquals(6, length(which(x)))
- do.typing(m)
- do.aromaticity(m)
- x <- unlist(lapply(get.atoms(m), is.aromatic))
- checkEquals(6, length(which(x)))
- }
- test.get.hcount <- function() {
- m <- parse.smiles('c1ccccc1')[[1]]
- x <- unlist(lapply(get.atoms(m), get.hydrogen.count))
- checkEquals(1, unique(x))
- }
- test.charges <- function() {
- m <- parse.smiles("CCC")[[1]]
- a <- get.atoms(m)
- for (atom in a) {
- checkTrue(is.null(get.charge(atom)))
- }
- m <- parse.smiles("[O-]CC")[[1]]
- a <- get.atoms(m)
- checkTrue(is.null(get.charge(a[[1]])))
- checkEquals(-1, get.formal.charge(a[[1]]))
- checkEquals(0, get.formal.charge(a[[2]]))
- checkEquals(0, get.formal.charge(a[[3]]))
- }