Learn R Programming

rcdk (version 3.4.7.1)

is.connected: Get the Largest Component in a Disconnected Molecule

Description

These methods allow one to check whether a molecule is fully connected or else retrieve the largest disconnected component

Usage

get.largest.component(mol)
is.connected(mol)

Arguments

mol

A jObjRef representing an IAtomContainer object

Value

For get.largest.component, if the input molecule has more than one disconnected component, the largest is returned. Otherwise, the molecule itself is returned.

For is.connected, TRUE if the molecule is fully connected, FALSE otherwise

Examples

Run this code
# NOT RUN {
m <- parse.smiles("CC.CCCCCC.CCCC")[[1]]
largest <- get.largest.component(m)
length(get.atoms(largest)) == 6
# }

Run the code above in your browser using DataLab