| write.SDFsplit | R Documentation |
Splits SD Files into any number of smaller SD Files
write.SDFsplit(x, filetag, nmol)
x |
object of class |
filetag |
string to prepend to file names |
nmol |
integer specifying number of molecules in split SD files |
To split an SD File into smaller ones, one can read the source file into R with read.SDFstr
and write out smaller ones with write.SDFsplit. Note: when importing big SD Files, read.SDFstr
will be much faster than read.SDFset, and there is no need to go through an SDFset object instance
in this case.
Thomas Girke
SDF format definition: http://www.symyx.com/downloads/public/ctfile/ctfile.jsp
Import/export functions: read.SDFset, read.SDFstr, read.SDFstr, read.SDFset
## Load sample data
library(ChemmineR)
data(sdfsample)
## Not run: ## Create sample SD File with 100 molecules
write.SDF(sdfsample, "test.sdf")
## Read in sample SD File
sdfstr <- read.SDFstr("test.sdf")
## Run export on SDFstr object
write.SDFsplit(x=sdfstr, filetag="myfile", nmol=10)
## Run export on SDFset object
write.SDFsplit(x=sdfsample, filetag="myfile", nmol=10)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.