Title: | Mixture Model for the Deconvolution of Thermal Decay Curves |
---|---|
Description: | Deconvolution of thermal decay curves allows you to quantify proportions of biomass components in plant litter. Thermal decay curves derived from thermogravimetric analysis (TGA) are imported, modified, and then modelled in a three- or four- part mixture model using the Fraser-Suzuki function. The output is estimates for weights of pseudo-components corresponding to hemicellulose, cellulose, and lignin. For more information see: Müller-Hagedorn, M. and Bockhorn, H. (2007) <doi:10.1016/j.jaap.2006.12.008>, Órfão, J. J. M. and Figueiredo, J. L. (2001) <doi:10.1016/S0040-6031(01)00634-7>, and Yang, H. and Yan, R. and Chen, H. and Zheng, C. and Lee, D. H. and Liang, D. T. (2006) <doi:10.1021/ef0580117>. |
Authors: | Saras Windecker [aut, cre], Nick Golding [aut] |
Maintainer: | Saras Windecker <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1.0000 |
Built: | 2025-02-10 03:59:25 UTC |
Source: | https://github.com/smwindecker/mixchar |
Accessor function to extract mean weights
component_weights(object)
component_weights(object)
object |
a decon object |
Extract mean fractions of the object
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) component_weights(output)
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) component_weights(output)
This function deconvolves thermogravimetric data using a Fraser-Suzuki mixture model
deconvolve( process_object, lower_temp = 120, upper_temp = 700, seed = 1, n_peaks = NULL, start_vec = NULL, lower_vec = NULL, upper_vec = NULL )
deconvolve( process_object, lower_temp = 120, upper_temp = 700, seed = 1, n_peaks = NULL, start_vec = NULL, lower_vec = NULL, upper_vec = NULL )
process_object |
process object obtained from process function |
lower_temp |
lower temperature bound to crop dataset, default to 120 |
upper_temp |
upper temperature bound to crop dataset, default to 700 |
seed |
random seed for nloptr optimiser |
n_peaks |
number of curves optional specification |
start_vec |
vector of starting values for nls function. Only specify this vector if you have selected the number of curves in the n_peaks parameter. |
lower_vec |
vector of lower bound values for nls. Only specify this vector if you have selected the number of curves in the n_peaks parameter. |
upper_vec |
vector of upper bound values for nls. Only specify this vector if you have selected the number of curves in the n_peaks parameter. |
decon list containing amended dataframe, temperature bounds, minpack.lm model fit, the number of curves fit, and estimated component weights
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) my_starting_vec <- c(height_1 = 0.003, skew_1 = -0.15, position_1 = 250, width_1 = 50, height_2 = 0.006, skew_2 = -0.15, position_2 = 320, width_2 = 30, height_3 = 0.001, skew_3 = -0.15, position_3 = 390, width_3 = 200) output <- deconvolve(tmp, n_peaks = 3, start_vec = my_starting_vec)
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) my_starting_vec <- c(height_1 = 0.003, skew_1 = -0.15, position_1 = 250, width_1 = 50, height_2 = 0.006, skew_2 = -0.15, position_2 = 320, width_2 = 30, height_3 = 0.001, skew_3 = -0.15, position_3 = 390, width_3 = 200) output <- deconvolve(tmp, n_peaks = 3, start_vec = my_starting_vec)
This function calculates the Fraser-Suzuki function.
fs_function(temp, height, skew, position, width)
fs_function(temp, height, skew, position, width)
temp |
temperature values |
height |
height value |
skew |
shape value |
position |
position value |
width |
width value |
Fraser-Suzuki function
temp <- 150:600 fs_output <- fs_function(temp, height = 0.004, skew = -.15, position = 250, width = 50)
temp <- 150:600 fs_output <- fs_function(temp, height = 0.004, skew = -.15, position = 250, width = 50)
Fraser-Suzuki mixture model
fs_mixture( temp, height_1, skew_1, position_1, width_1, height_2, skew_2, position_2, width_2, height_3, skew_3, position_3, width_3, height_0 = NULL, skew_0 = NULL, position_0 = NULL, width_0 = NULL )
fs_mixture( temp, height_1, skew_1, position_1, width_1, height_2, skew_2, position_2, width_2, height_3, skew_3, position_3, width_3, height_0 = NULL, skew_0 = NULL, position_0 = NULL, width_0 = NULL )
temp |
temperature values |
height_1 |
height value for hemicellulose |
skew_1 |
shape value for hemicellulose |
position_1 |
position value for hemicellulose |
width_1 |
width value for hemicellulose |
height_2 |
height value for cellulose |
skew_2 |
shape value for cellulose |
position_2 |
position value for cellulose |
width_2 |
width value for cellulose |
height_3 |
height value for lignin |
skew_3 |
shape value for lignin |
position_3 |
position value for lignin |
width_3 |
width value for lignin |
height_0 |
height value for second hemicellulose curve, if present |
skew_0 |
shape value for second hemicellulose curve, if present |
position_0 |
position value for second hemicellulose curve, if present |
width_0 |
width value for second hemicellulose curve, if present |
Fraser-Suzuki model output
temp <- 150:600 fs_mixture_output <- fs_mixture(temp, height_1 = 0.003, skew_1 = -0.15, position_1 = 250, width_1 = 50, height_2 = 0.006, skew_2 = -0.15, position_2 = 320, width_2 = 30, height_3 = 0.001, skew_3 = -0.15, position_3 = 390, width_3 = 200)
temp <- 150:600 fs_mixture_output <- fs_mixture(temp, height_1 = 0.003, skew_1 = -0.15, position_1 = 250, width_1 = 50, height_2 = 0.006, skew_2 = -0.15, position_2 = 320, width_2 = 30, height_3 = 0.001, skew_3 = -0.15, position_3 = 390, width_3 = 200)
Non-linear model output using optimised parameter values with a three-part mixture model using Fraser-Suzuki equation
fs_model(dataframe, params, lb, ub)
fs_model(dataframe, params, lb, ub)
dataframe |
dataframe |
params |
starting parameter values |
lb |
lower bounds for model |
ub |
upper bounds for model |
model output
Calculate weight quantiles
get_weights(param_vec, output)
get_weights(param_vec, output)
param_vec |
parameter estimates from minpack model |
output |
deconvolve output of model |
weights for each component
Raw thermogravimetric data from the wetland rush, J. amabilis
data(juncus)
data(juncus)
An object of class 'cross'
Saras M Windecker
data(juncus)
data(juncus)
Raw thermogravimetric data from the wetland forb, M. drumondii.
data(marsilea)
data(marsilea)
An object of class 'cross'
Saras M Windecker
data(marsilea)
data(marsilea)
Accessor function to extract model fit
model_fit(object)
model_fit(object)
object |
a decon object |
$minpack.lm of the object
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) model_fit(output)
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) model_fit(output)
Accessor function to extract model parameters
model_parameters(object)
model_parameters(object)
object |
a decon object |
model parameters from minpack.lm::nlsLM fit
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) model_parameters(output)
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') output <- deconvolve(tmp) model_parameters(output)
This function sets up the default plotting method for outputs from deconvolve function
## S3 method for class 'decon' plot(x, bw = TRUE, ...)
## S3 method for class 'decon' plot(x, bw = TRUE, ...)
x |
decon object as generated by deconvolve |
bw |
logical argument indicating whether the plot should be in black and white or colour |
... |
other options passed to plot |
plot
This function sets up the default plotting method for outputs from process function
## S3 method for class 'process' plot(x, plot_type = NULL, cex = 1, ...)
## S3 method for class 'process' plot(x, plot_type = NULL, cex = 1, ...)
x |
process object as generated by process |
plot_type |
defaults to both plots. Can specify 'mass' or 'rate' curves by themselves. |
cex |
size of plots features |
... |
other options passed to plot |
plot
This function sets up the default print method for outputs from deconvolve function
## S3 method for class 'decon' print(x, ...)
## S3 method for class 'decon' print(x, ...)
x |
decon object as generated by deconvolve |
... |
other options passed to plot |
print output
This function sets up the default print method for outputs from process function
## S3 method for class 'process' print(x, ...)
## S3 method for class 'process' print(x, ...)
x |
process object as generated by deconvolve |
... |
other options passed to plot |
print output
This function processes thermogravimetric data by calculating the derivative of mass loss
process(data, init_mass, temp, mass_loss = NULL, mass = NULL, temp_units = "C")
process(data, init_mass, temp, mass_loss = NULL, mass = NULL, temp_units = "C")
data |
dataframe |
init_mass |
numeric value of initial sample mass in mg |
temp |
column name containing temperature values |
mass_loss |
column name containing mass loss values in mg |
mass |
column name containing mass values in mg |
temp_units |
specify units of temperature, default = Celsius. Can specify 'K' or 'Kelvin' if in Kelvin |
process list containing modified dataframe, initial mass of sample, and maximum and minimum temperature values
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss')
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss')
Accessor function to extract processed dataframe
rate_data(object)
rate_data(object)
object |
a process or deconvolve object |
Dataframe of the object
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') rate_data(tmp)
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') rate_data(tmp)
Accessor function to extract selected temperature bounds
temp_bounds(object)
temp_bounds(object)
object |
the output of either the process or deconvolve functions |
Temperature bounds of the data in the object
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') temp_bounds(tmp)
data(juncus) tmp <- process(juncus, init_mass = 18.96, temp = 'temp_C', mass_loss = 'mass_loss') temp_bounds(tmp)
Calculate weight quantiles
weight_quantiles(output, seed)
weight_quantiles(output, seed)
output |
dataframe |
seed |
seed |
list of means and confidence intervals of weight estimates
Calculate weight single component
wt_component(j, param_vec, lower_temp, upper_temp)
wt_component(j, param_vec, lower_temp, upper_temp)
j |
component |
param_vec |
vector of parameters |
lower_temp |
lower temperature bound |
upper_temp |
upper temperature bound |
weight of component