Calculates the Double Bond Equivalent (DBE) for a given neutral molecular formula.
DBE is a measure of unsaturation, representing the total number of rings and pi bonds
in a molecule. This function uses the masses data table to determine valence information
for each element in the input molecular formula.
A numeric vector of the same length as the number of rows in mfd,
where each entry represents the calculated DBE for the corresponding molecular formula.
The result vector is named 'dbe'.
Arguments
mfd
data.table with molecular formula data as derived from
ume::assign_formulas. Column names of elements/isotopes must match names in
the isotope column of ume::masses; values are integers representing
counts per formula.
masses
A data.table. Defaults to ume::masses (based on NIST data)
containing isotope information for elements, including nominal and exact mass,
relative abundance, and Hill system order.
verbose
logical; if TRUE, show progress messages.
...
Additional arguments passed to methods.
Details
This function computes DBE based on the molecular formula specified in mfd.
mfd can be a data.table or a character string or character vector of molecular formula strings.
For each isotope in the formula, DBE is calculated as the sum of (valence - 2)
multiplied by the count of that isotope, divided by 2, and then adding 1.
Elements with a valence of 2 are excluded from the DBE calculation.
The function will stop and print an error if any elements in mfd have missing valence information
in masses.
# Example with user-defined datacalc_dbe("C6H10O6")
calc_dbe("C6H10Br2")
calc_dbe(c("C3[13C1]H10O4", "C6H10O6"))
# Example with demo data from UME packagecalc_dbe(mfd = mf_data_demo)