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)
blockMatrix <- datablock2ma(datablocklist=datablock(sdfset))
cid(apset)<-blockMatrix[,"Name"]
dbset<-(blockMatrix[,"Name"]!="Nicotine")
clusters <- cmp.cluster(apset,cutoff=0.5,quiet=TRUE)
cluster.visualize(apset,clusters,size.cutoff=0,quiet=FALSE,highlight.compounds=TRUE)