Learn R Programming

PubChemR (version 3.0.0)

pc_to_rcdk: Convert PubChem Tables to rcdk Molecules

Description

Converts SMILES strings from a PubChem table into `rcdk` molecule objects.

Usage

pc_to_rcdk(x, smiles_col = "CanonicalSMILES", id_col = "CID")

Value

A list of `rcdk` molecule objects.

Arguments

x

Input table or `PubChemResult`.

smiles_col

Column with SMILES strings.

id_col

Optional identifier column used to name returned molecules.

Details

Requires the optional `rcdk` package. Empty or missing SMILES values are dropped before conversion.

Examples

Run this code
names(formals(pc_to_rcdk))

if (FALSE) {
ex_tbl <- tibble::tibble(CID = "1", CanonicalSMILES = "CCO")
mols <- pc_to_rcdk(ex_tbl)
length(mols)
}

Run the code above in your browser using DataLab