Learn R Programming

ChemmineR (version 2.24.2)

validSDF: Validity check of SDFset

Description

Performs validity check of SDFs stored in SDFset objects. Currently, the function tests whether the atom block and the bond block in each SDF component of an SDFset have at least Nabcol and Nbbcol columns (default is 3 for both). In additions, it tests for the presence of NA values in the atom and bond blocks. The function returns a logical vector with TRUE values for valid compounds and FALSE values for invalid ones.

Usage

validSDF(x, Nabcol = 3, Nbbcol = 3, logic = "&", checkNA=TRUE)

Arguments

x
x object of class SDFset
Nabcol
minimum number of columns in atom block
Nbbcol
minimum number of columns in bond block
logic
logical connection (& or |) among Nabcol and Nbbcol cutoffs
checkNA
checks for NA values in atom and bond blocks

Value

logical vector of length x with TRUE for valid compounds and FALSE for invalid compounds.

Details

The function is important to remove invalid compounds from SDFset containers.

References

...

See Also

Functions: read.SDFset

Examples

Run this code
## SDFset instance
data(sdfsample)
sdfset <- sdfsample

## Detect and remove invalid SDFs in SDFset. 
valid <- validSDF(sdfset)
which(!valid) # Returns index for invalid SDFs
sdfset <- sdfset[valid] # Returns only valid SDFs.

Run the code above in your browser using DataLab