Learn R Programming

rcdk (version 2.9.21)

matches: Perform Substructure Searching

Description

This function performs substructure searches of a query, specified in SMILES or SMARTS forms, over one or more target molecules.

Usage

matches(query, targets)

Arguments

query
A SMILES or SMARTS string
targets
A single IAtomContainer object or a list of IAtomContainer objects

Value

  • A boolean vector, where each element is TRUE or FALSE depending on whether the corresponding element in targets contains the query or not.

Details

Note that since the CDK SMARTS matcher internally will perform aromaticity perception and atom typing, the target molecules need not have these operations done on them beforehand.

See Also

load.molecules, get.smiles, do.aromaticity, do.typing, do.isotopes

Examples

Run this code
smiles <- c('CCC', 'c1ccccc1', 'C(C)(C=O)C(CCNC)C1CC1C(=O)')
mols <- sapply(smiles, parse.smiles)
query <- '[#6]=O'
matches <- match(query, mols)

Run the code above in your browser using DataLab