#create and initialize a new SQLite database
conn = initDb("test1.db")
data(sdfsample)
#load data and compute 3 features: molecular weight, with the MW function,
# and counts for RINGS and AROMATIC, as computed by rings, which returns a data frame itself.
ids=loadSdf(conn,sdfsample,
function(sdfset)
data.frame(MW = MW(sdfset), rings(sdfset,type="count",upper=6, arom=TRUE))
)
#search for compounds with molecular weight less than 200
lightIds = findCompounds(conn,"MW",c("MW < 200"))
MW(getCompounds(conn,lightIds)) # should find one compound with weight 140
unlink("test1.db")
Run the code above in your browser using DataLab