Title: | Advanced Method Optimization for Spectra-Generating Sampling and Analysis Instrumentation |
---|---|
Description: | A graphical user interface to apply an advanced method optimization algorithm to various sampling and analysis instruments. This includes generating experimental designs, uploading and viewing data, and performing various analyses to determine the optimal method. Details of the techniques used in this package are published in Gamble, Granger, & Mannion (2024) <doi:10.1021/acs.analchem.3c05763>. |
Authors: | Benjamin Luke [aut], Stephanie Gamble [aut, cre], Battelle Savannah River Alliance [cph] |
Maintainer: | Stephanie Gamble <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0 |
Built: | 2024-12-19 06:28:52 UTC |
Source: | CRAN |
Runs an ANOVA test for any variables that were selected by the user.
anovaben(objectives, data, ffd, obj_results, alpha)
anovaben(objectives, data, ffd, obj_results, alpha)
objectives |
User selected objectives. |
data |
Peak information (all times, heights, etc.). |
ffd |
Fractional factorial design |
obj_results |
Calculated objectives. |
alpha |
Alpha value. |
list containing the results of ANOVA on the data from the FFD (including p-values and which parameters are significant), the suggested changes to add a level for a BBD, suggested values for the BBD, row indices for the results, and the data frame of the FFD with objective results included
Computes the areas beneath the specified maxima.
area(data, hts, tms)
area(data, hts, tms)
data |
dataframe of time versus intensity. |
hts |
heights of peaks in chronological order. |
tms |
time locations of peaks in chronological order. |
area for each peak
Generates the baseline of the spectra, interpolates between points, and subtracts from the intensity to generate corrected baseline.
blc(frame, noise = 10^5, subtract = NULL)
blc(frame, noise = 10^5, subtract = NULL)
frame |
data frame of time versus intensity. |
noise |
strength of the baseline subtraction. |
subtract |
how much intensity to initially subtract. |
data frame of of data that has been baseline corrected
Generate a Gaussian fit with given parameters.
gauss(a, b, c, t)
gauss(a, b, c, t)
a |
amplitute. |
b |
phase shift. |
c |
standard deviation. |
t |
time at which to fit. |
value of Gaussian function
'MethodOpt()' runs the GUI.
MethodOpt()
MethodOpt()
No arguments are needed to initiate the GUI. 'MethodOpt()' is split into three main tabs.
No return value, opens and runs the GUI
The first step in method optimization is to build an experimental design. Hence, the first tab of the GUI is dedicated to designing a fractional factorial experimental design. Parameters are input with their corresponding low and high values. Pressing "Generate FFD" will yield the experimental design. The user will run experiments according to each method.
The second step in method optimization is to run an ANOVA test. This is carried out under the "Analysis" tab. Raw experimental screening data is uploaded, and the spectra can be viewed. In subtabs, the spectra peaks must be identified (either by an uploaded retention time file or by a built-in identification algorithm), objectives must be selected, and the initial experimental design must be uploaded; then the ANOVA test may be run. Statistically significant parameters are indicated.
The third step is to generate a three-level Box-Behnken experimental design with the significant parameters. Low, middle, and high values are input with their corresponding parameters. The design can be generated by pressing "Generate BBD."
The final step is to run the optimization with the results of the Box-Behnken design. Similarly to the second step, raw data is uploaded in the "Analysis" tab. Spectra peaks must be identified, objectives must be selected, and the experimental design must be uploaded; then the optimal values can be calculated.
# Please see the vignette for the MethodOpt package for a full example of how # to use the GUI launched by MethodOpt::MethodOpt().
# Please see the vignette for the MethodOpt package for a full example of how # to use the GUI launched by MethodOpt::MethodOpt().
Calculate the optimal parameter values for given objectives.
opt(objectives, bbd, results, lim_fac, valid_range_data)
opt(objectives, bbd, results, lim_fac, valid_range_data)
objectives |
objectives input by user. |
bbd |
Box-Behnken design. |
results |
objective results. |
lim_fac |
limiting factors. |
valid_range_data |
ranges of validity corresponding to the limiting factors. |
a list containing the parameters which cannot be set to the unbounded solution, the maximum value of the objectives, and the unbounded parameter solutions
Returns the maxima, the times they occur at, the index location of the maxima, and the next viable peaks with times after the first 'keep'.
peaks( data, begin_search = NULL, end_search = NULL, keep = 11, precision = 15, factor = 10, bl_noise = 0 )
peaks( data, begin_search = NULL, end_search = NULL, keep = 11, precision = 15, factor = 10, bl_noise = 0 )
data |
time versus intensity dataframe. |
begin_search |
time at which to start the search for the peaks. |
end_search |
time at which to stop the search for the peaks. |
keep |
a whole number indicating how many peaks to search for and return. |
precision |
an integer indicating the size of the window for searching for local maxima. |
factor |
constant of proportionality indicating the cutoff peak height (i.e., peaks greater than 'factor' times height are not returned as viable peaks). |
bl_noise |
constant level at which response should be considered as noise. |
list containing spectra maxima,the times they occur at, the index location of the maxima, and the the same info for the next viable peaks with times after the first 'keep'.
Locate the maxima of the peaks corresponding to the retention times.
peaks_rts(raw_data, retention_times, rt_index, bl_noise = 0)
peaks_rts(raw_data, retention_times, rt_index, bl_noise = 0)
raw_data |
time versus intensity dataframe. |
retention_times |
retention time file. |
rt_index |
which method to evaluate for. |
bl_noise |
constant level at which response should be considered as noise. |
list containing the peaks' heights, times where they occur, the full data TIC, full time index, and the peaks' widths
Calculate the widths (standard deviation) for each identified peak.
widths(data, hts, tms)
widths(data, hts, tms)
data |
time versus intensity dataframe. |
hts |
heights of peaks. |
tms |
times of peaks. |
width for each peak