Gets the largest component in a disconnected molecular graph.
Source:R/rcdk.R
get.largest.component.Rd
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.
Author
Rajarshi Guha (rajarshi.guha@gmail.com)
Examples
m <- parse.smiles("CC.CCCCCC.CCCC")[[1]]
largest <- get.largest.component(m)
length(get.atoms(largest)) == 6
#> [1] TRUE