plotStruc {ChemmineR} | R Documentation |
Plots compound structure(s) for molecules stored in SDF and SDFset containers.
## Convenience plot method # plot(x, griddim, print_cid=cid(x), print=TRUE, ...) ## Less important for user plotStruc(sdf, atomcex = 1.2, atomnum = FALSE, no_print_atoms = c("C"), noHbonds = TRUE, bondspacer = 0.12, colbonds=NULL, bondcol="red", regenCoords=FALSE, ...)
sdf |
Object of class |
atomcex |
Font size for atom labels |
atomnum |
If |
no_print_atoms |
Excludes specified atoms from being plotted. |
noHbonds |
If |
bondspacer |
Numeric value specifying the plotting distance for double/triple bonds. |
colbonds |
Highlighting of subgraphs in main structure by providing a numeric vector of atom numbers, here position index in atom block.
The bonds of connected atoms will be plotted in the color provided under |
bondcol |
A character or numeric vector of length one to specify the color to use for substructure highlighting under |
regenCoords |
If ChemmineOB is installed and this option is TRUE, then Open
Babel will be used to re-generate the 2D coords for each
compound before plotting it. This often results in a nicer
layout. If you want to save the results of the coord
re-generation, call the |
... |
Arguments to be passed to/from other methods. |
The function plotStruc
depicts a single 2D compound structure based
on the XY-coordinates specified in the atom block of an SDF. The generic method
plot
can be used as a convenient shorthand to plot one or many
structures at once. Both functions depend on the availability of the
XY-coordinates in the source SD file and only 2D (not 3D) representations are plotted
correctly.
Additional arguments that can only be passed on to the plot
function when supplied with
an SDFset object:
griddim
: numeric vector of length two to define the dimensions for arranging several structures in one plot.
print_cid
: character vector for printing custom compound labels. Default is print_cid=cid(sdfset)
.
print
: if print=TRUE
, then a summary of the SDF content for each supplied compound is printed to the screen.
This behavior is turned off with print=TRUE
.
Prints summary of SDF/SDFset to screen and plots their structures to graphics device.
The compound depictions created by this function are not as pretty as the structure representations generated with the sdf.visualize
function. This will be improved in the future.
Thomas Girke
...
sdf.visualize
## Import SDFset sample set data(sdfsample) (sdfset <- sdfsample) ## Plot single compound structure plotStruc(sdfset[[1]]) ## Plot several compounds structures plot(sdfset[1:4]) ## Highlighting substructures (here all rings) myrings <- as.numeric(gsub(".*_", "", unique(unlist(rings(sdfset[1]))))) plot(sdfset[1], colbonds=myrings) ## Customize plot plot(sdfset[1:4], griddim=c(2,2), print_cid=letters[1:4], print=FALSE, noHbonds=FALSE)