SDF-class {ChemmineR} | R Documentation

## Class "SDF"

### Description

Container for storing every element of a single molecule defined in an SD/MOL file without information loss in a list-like container. The import occurs via the `SDFstr` container class. The header block is stored as named character vector, the atom/bond blocks as matrices and the data block as named character vector.

### Objects from the Class

Objects can be created by calls of the form `new("SDF", ...)`.

### Slots

`header`:

  Object of class `"character"`

`atomblock`:

  Object of class `"matrix"`

`bondblock`:

  Object of class `"matrix"`

`datablock`:

  Object of class `"character"`

`obmolRef`:

  Object of class `"ExternalReferenceOrNULL"`

`version`:

  Object of class `"character"`

### Methods

[

  `signature(x = "SDF")`: subsetting of class with bracket operator

[[

  `signature(x = "SDF")`: returns one of the four object components

[[<-

  `signature(x = "SDF")`: replacement method for the four sub-components

[<-

  `signature(x = "SDF")`: replacement method for the four sub-components

atomblock

  `signature(x = "SDF")`: returns atom block as matrix

atomcount

  `signature(x = "SDF")`: returns atom frequency

bondblock

  `signature(x = "SDF")`: returns bond block as matrix

obmol

  `signature(x = "SDF")`: returns an OBMol pointer

coerce

  `signature(from = "character", to = "SDF")`: `as(character, "SDF")`

coerce

  `signature(from = "list", to = "SDF")`: `as(list, "SDF")`

coerce

  `signature(from = "SDF", to = "character")`: `as(sdf, "character")`

coerce

  `signature(from = "SDF", to = "list")`: `as(sdf, "list")`

coerce

  `signature(from = "SDF", to = "SDFset")`: `as(sdf, "SDFset")`

coerce

  `signature(from = "SDF", to = "SDFstr")`: `as(SDF, "SDFstr")`

coerce

  `signature(from = "SDFset", to = "SDF")`: `as(sdfset, "SDF")`

datablock

  `signature(x = "SDF")`: returns data block as named character vector

datablocktag

  `signature(x = "SDF")`: returns data block as named character vector with subsetting support

header

  `signature(x = "SDF")`: returns header block as named character vector

plot

  `signature(x = "SDF")`: plots molecule structure for `SDF` object

sdf2list

  `signature(x = "SDF")`: returns `SDF` object as `list`

sdf2str

  `signature(sdf = "SDF")`: returns `SDF` object as `character` vector

sdfid

  `signature(x = "SDF")`: returns molecule ID field from header block

show

  `signature(object = "SDF")`: prints summary of `SDF`

### Author(s)

Thomas Girke

### References

SDF format definition: http://www.symyx.com/downloads/public/ctfile/ctfile.jsp

### See Also

Related classes: SDFset, SDFstr, AP, APset

### Examples

    showClass("SDF")

    ## Instances of SDF class
    data(sdfsample); sdfset <- sdfsample
    (sdf <- sdfset[[1]]) # returns first molecule in sdfset as SDF object

    ## Accessing SDF components
    header(sdf); atomblock(sdf); bondblock(sdf); datablock(sdf)
    sdfid(sdf)

    ## Plot molecule structure of SDF
    plot(sdf) # plots to R graphics device
    # sdf.visualize(sdf) # viewing in browser

[Package ChemmineR version 2.30.2 Index]