1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
test.is.aromatic <- function()
{
m <- parse.smiles('c1ccccc1CC')[[1]]
x <- unlist(lapply(get.atoms(m), is.aromatic))
checkEquals(6, length(which(x)))
set.atom.types(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]]))
}
|