options(repos="https://ftp.yz.yamagata-u.ac.jp/pub/cran/")
if(!require("BiocManager",quietly=T)){install.packages("BiocManager")}
x <- c("ChemmineR","ChemmineOB");for(i in x){
  if(!require(i,character.only=T)){
    BiocManager::install(i);library(i,character.only=T)}};rm(x,i)
ifname <- "DataChemicalStructure.sdf"
sdfset <- read.SDFset(ifname)
apset<-sdf2ap(sdfset)
#[1]------------------------
cmp.search(db=apset[2:10],query=apset[1],type=3,cutoff=0.2,quiet=TRUE)
#[2]------------------------
blockMatrix <- datablock2ma(datablocklist=datablock(sdfset))
cid(apset)<-blockMatrix[,"Name"]
dbset1<-c("Myosmine","Nicotinic acid")
cmp.search(db=apset[dbset1],query=apset["Nicotine"],type=3,cutoff=0.0,quiet=TRUE)
#[3]-----------------------
cid(apset)<-blockMatrix[,"Name"]
dbset2<-(blockMatrix[,"Name"]!="Nicotine")
cmp.search(db=apset[dbset2],query=apset["Nicotine"],type=3,cutoff=0.5,quiet=TRUE)