| write.SDF | R Documentation |
Writes one or many molecules stored in a SDFset, SDFstr or SDF object to SD file.
write.SDF(sdf, file, cid = FALSE, ...)
sdf |
object of class |
file |
name of SD file to write to |
cid |
if |
... |
the optional arguments of the |
If the write.SDF function is supplied with an SDFset object, then it uses internally the sdf2str function to allow customizing the resulting SD file. For this all optional arguments of the sdf2str function can be passed on to write.SDF.
Thomas Girke
SDF format definition: http://www.symyx.com/downloads/public/ctfile/ctfile.jsp
Import function: read.SDFset, read.SDFstr
## Instance of SDFset class
data(sdfsample); sdfset <- sdfsample
## Write objects of classes SDFset/SDFstr/SDF to file
# write.SDF(sdfset[1:4], file="sub.sdf")
## Example for writing customized SDFset to file containing
## ChemmineR signature, IDs from SDFset and no data block
# write.SDF(sdfset[1:4], file="sub.sdf", sig=TRUE, cid=TRUE, db=NULL)
## Example for injecting a custom matrix/data frame into the data block of an
## SDFset and then writing it to an SD file
props <- data.frame(MF=MF(sdfset), MW=MW(sdfset), atomcountMA(sdfset))
datablock(sdfset) <- props
view(sdfset[1:4])
# write.SDF(sdfset[1:4], file="sub.sdf", sig=TRUE, cid=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.