Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get.largest.component

Gets the largest component in a disconnected molecular graph.


Description

A molecule may be represented as a disconnected graph, such as when read in as a salt form. This method will return the larges connected component or if there is only a single component (i.e., the molecular graph is complete or fully connected), that component is returned.

Usage

get.largest.component(mol)

Arguments

mol

The molecule to query. Should be a 'jobjRef' representing an 'IAtomContainer'

Value

The largest component as an 'IAtomContainer' object or else the input molecule itself

Author(s)

Rajarshi Guha (rajarshi.guha@gmail.com)

See Also

Examples

m <- parse.smiles("CC.CCCCCC.CCCC")[[1]]
largest <- get.largest.component(m)
length(get.atoms(largest)) == 6

rcdk

Interface to the 'CDK' Libraries

v3.5.0
LGPL
Authors
Rajarshi Guha [aut, cph], Zachary Charlop-Powers [cre], Emma Schymanski [ctb]
Initial release
2020-03-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.