Skip to contents

Returns functional group counts relevant to calculating estimated volatility for specified compounds. Users will not typically interact with this function directly, but rather by using calc_vol().

Usage

get_fx_groups(compound_sdf, validate = TRUE)

Arguments

compound_sdf

a ChemmineR::SDFset object returned by ChemmineR::read.SDFset() or ChemmineR::smiles2sdf(), for example.

validate

logical; if TRUE (default), results are checked for possible errors in parsing by Open Babel and NAs are returned if possible errors are found. Setting to FALSE bypasses these checks—use at your own risk! Validation is not available on Windows. See Details for more information.

Value

A tibble with columns of basic compound info and functional group counts.

Details

It is unfortunately difficult to capture errors and warnings produced by the command line tool OpenBabel used by ChemmineOB, a dependency of volcalc. These errors and warnings are printed to the R console, but they are not R errors and do not stop code from running and producing potentially incorrect data. validate = TRUE checks the output of certain OpenBabel procedures for the symptoms of these errors, namely missing values for InChI and molecular formula. Unfortunately, since InChI generation is not available with the Windows version of ChemmineOB, this validation step cannot be performed on Windows and validate = TRUE will simply print a warning that can be silenced by setting validate = FALSE.

Note

This function currently does not capture the carbon number on the acid-side of amide, one of the functional groups used in SIMPOL.1. Contributions of SMARTS strings or other methods to capture this "functional group" are welcome.

See also

Examples

mol_path <- mol_example()[1]
sdf <- ChemmineR::read.SDFset(mol_path)
get_fx_groups(sdf)
#> # A tibble: 1 × 51
#>   formula name    exact_mass molecular_weight carbons carbons_asa rings_aromatic
#>   <chr>   <chr>        <dbl>            <dbl>   <int>       <int>          <int>
#> 1 C6H12O6 D-Gluc…       180.             180.       6          NA              0
#> # ℹ 44 more variables: rings_total <int>, rings_aliphatic <int>,
#> #   carbon_dbl_bonds_aliphatic <int>, CCCO_aliphatic_ring <int>,
#> #   hydroxyl_total <int>, hydroxyl_aromatic <int>, hydroxyl_aliphatic <int>,
#> #   aldehydes <int>, ketones <int>, carbox_acids <int>, ester <int>,
#> #   ether_total <int>, ether_alkyl <int>, ether_alicyclic <int>,
#> #   ether_aromatic <int>, nitrate <int>, nitro <int>, amine_primary <int>,
#> #   amine_secondary <int>, amine_tertiary <int>, amine_aromatic <int>, …