atomcount {ChemmineR} | R Documentation

## Molecular property functions

### Description

Functions to compute molecular properties: weight, formula, atom frequencies, etc.

### Usage

    atomcount(x, addH = FALSE, ...)

    atomcountMA(x, ...)

    MW(x, mw=atomprop, ...)

    MF(x, ...)

### Arguments

`x` | object of class `SDFset` or `SDF`
`mw` | `data.frame` with atomic weights; imported by default with data(atomprop); supports custom data sets
`addH` | 'addH = TRUE' should be passed on to any of these function to add hydrogens that are often not specified in SD files
`...` | Arguments to be passed to/from other methods.

### Details

...

### Value

`named vector` | `MW` and `MF`
`list` | `atomcount`
`matrix` | `atomcountMA`

### Author(s)

Thomas Girke

### References

Standard atomic weights (2005) from: http://iupac.org/publications/pac/78/11/2051/

### See Also

Functions: `datablock`, `datablocktag`

### Examples

    ## Instance of SDFset class
    data(sdfsample)
    sdfset <- sdfsample

    ## Compute properties; to consider missing hydrogens, set 'addH = TRUE'
    MW(sdfset[1:4], addH = FALSE)
    MF(sdfset[1:4], addH = FALSE)
    atomcount(sdfset[1:4], addH = FALSE)
    propma <- atomcountMA(sdfset[1:4], addH = FALSE)
    boxplot(propma, main="Atom Frequency")

    ## 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)

[Package ChemmineR version 3.44.0 Index]