Title: | An R Shiny Application for Biological Dosimetry |
---|---|
Description: | A tool to perform all different statistical tests and calculations needed by Biological Dosimetry Laboratories. Detailed documentation is available in <https://biodosetools-team.github.io/documentation/> and the paper by Hernández et al. (2023) <doi:10.1080/09553002.2023.2176564>. |
Authors: | Alfredo Hernández [aut, cre] |
Maintainer: | Alfredo Hernández <[email protected]> |
License: | GPL-3 |
Version: | 3.6.1.9000 |
Built: | 2025-02-23 05:34:16 UTC |
Source: | https://github.com/biodosetools-team/biodosetools |
Calculate AIC (Akaike's 'An Information Criterion')
AIC_from_data( general_fit_coeffs, data, dose_var = "dose", yield_var = "yield", fit_link = "identity" )
AIC_from_data( general_fit_coeffs, data, dose_var = "dose", yield_var = "yield", fit_link = "identity" )
general_fit_coeffs |
Generalised fit coefficients matrix. |
data |
Data (dose, yield) to calculate AIC from. |
dose_var |
Name of the dose variable (enquoted). |
yield_var |
Name of the yield variable (enquoted). |
fit_link |
A specification for the model link function. |
Numeric value of AIC.
biodosetools
packageShiny App To Be Used By Biological Dosimetry Laboratories
See the README on GitHub
Aberration calculation functions
calculate_aberr_power(data, aberr_prefix = "C", power = 1) calculate_aberr_mean(X, N) calculate_aberr_var(X, X2, N) calculate_aberr_disp_index(mean, var) calculate_aberr_u_value(X, N, mean, var, assessment_u = 1) init_aberr_table( data, type = c("count", "case"), aberr_module = c("dicentrics", "translocations", "micronuclei") )
calculate_aberr_power(data, aberr_prefix = "C", power = 1) calculate_aberr_mean(X, N) calculate_aberr_var(X, X2, N) calculate_aberr_disp_index(mean, var) calculate_aberr_u_value(X, N, mean, var, assessment_u = 1) init_aberr_table( data, type = c("count", "case"), aberr_module = c("dicentrics", "translocations", "micronuclei") )
data |
Count or case data. |
aberr_prefix |
Prefix of the aberrations in the data. |
power |
Power of aberration. |
X |
Sum of detected aberrations. |
N |
Number of cells analysed. |
X2 |
Quadratic sum of detected aberrations. |
mean |
Mean. |
var |
Variance. |
assessment_u |
Expected |
type |
Type of input data. Either "count" and "case". |
aberr_module |
Aberration module. |
Calculate aberrations table
calculate_aberr_table( data, type = c("count", "case"), aberr_module = c("dicentrics", "translocations", "micronuclei"), assessment_u = 1 )
calculate_aberr_table( data, type = c("count", "case"), aberr_module = c("dicentrics", "translocations", "micronuclei"), assessment_u = 1 )
data |
Count or case data. |
type |
Type of input data. Either "count" and "case". |
aberr_module |
Aberration module, required for |
assessment_u |
Expected |
Data frame containing cell count (), aberrations (
),
and other coefficients (dispersion index,
-value, ...), as well as
raw count or case
data
.
Calculate characteristic limits
calculate_characteristic_limits(mu0, n1, alpha = 0.05, beta = 0.1)
calculate_characteristic_limits(mu0, n1, alpha = 0.05, beta = 0.1)
mu0 |
Background rate |
n1 |
Number of cells that will be analysed. |
alpha |
Type I error rate, 0.05 by default. |
beta |
Type II error rate, 0.1 by default. |
List of characteristic limits (decision_threshold
, detection_limit
).
Method based on the paper by Lucas, J. N. et al. (1992). Rapid Translocation Frequency Analysis in Humans Decades after Exposure to Ionizing Radiation. International Journal of Radiation Biology, 62(1), 53-63. <doi:10.1080/09553009214551821>.
calculate_genome_factor(dna_table, chromosomes, colors, sex)
calculate_genome_factor(dna_table, chromosomes, colors, sex)
dna_table |
DNA content fractions table. Can be |
chromosomes |
Vector of stained chromosomes. |
colors |
Vector of colors of the stains. |
sex |
Sex of the individual. |
Numeric value of genomic conversion factor.
Calculate model statistics
calculate_model_stats( model_data, fit_coeffs_vec, glm_results = NULL, fit_algorithm = NULL, response = "yield", link = c("identity", "log"), type = c("theory", "raw"), Y = NULL, mu = NULL, n = NULL, npar = NULL, genome_factor = NULL, calc_type = c("fitting", "estimation") )
calculate_model_stats( model_data, fit_coeffs_vec, glm_results = NULL, fit_algorithm = NULL, response = "yield", link = c("identity", "log"), type = c("theory", "raw"), Y = NULL, mu = NULL, n = NULL, npar = NULL, genome_factor = NULL, calc_type = c("fitting", "estimation") )
model_data |
Data of the model. |
fit_coeffs_vec |
Vector of fitting coefficients. |
glm_results |
Results of glm. |
fit_algorithm |
String of the algorithm used. |
response |
Type of response. |
link |
Fit link. |
type |
Theoretical or raw glm model statistics. |
Y |
Y response (required in constraint-maxlik-optimization). |
mu |
mu response required in constraint-maxlik-optimization). |
n |
number of parameters (required in constraint-maxlik-optimization). |
npar |
number of parameters (required in constraint-maxlik-optimization). |
genome_factor |
Genomic conversion factor used in translocations. |
calc_type |
Calculation type, either "fitting" or "estimation". |
Data frame of model statistics.
Calculate manual translocation rate
calculate_trans_rate_manual(cells, genome_factor, expected_aberr_value)
calculate_trans_rate_manual(cells, genome_factor, expected_aberr_value)
cells |
Number of cells |
genome_factor |
Genomic conversion factor. |
expected_aberr_value |
Expected aberrations. |
Numeric value of translocation rate.
Method based on the paper by Sigurdson, A. J. et al. (2008). International study of factors affecting human chromosome translocations. Mutation Research/Genetic Toxicology and Environmental Mutagenesis, 652(2), 112-121. <doi:10.1016/j.mrgentox.2008.01.005>.
calculate_trans_rate_sigurdson( cells, genome_factor, age_value, sex_bool = FALSE, sex_value = "none", smoker_bool = FALSE, ethnicity_value = "none", region_value = "none" )
calculate_trans_rate_sigurdson( cells, genome_factor, age_value, sex_bool = FALSE, sex_value = "none", smoker_bool = FALSE, ethnicity_value = "none", region_value = "none" )
cells |
Number of cells |
genome_factor |
Genomic conversion factor. |
age_value |
Age of the individual. |
sex_bool |
If |
sex_value |
Sex of the individual, either "male" of "female". |
smoker_bool |
Whether the individual smokes or not. |
ethnicity_value |
Ethnicity of the individual. |
region_value |
Region of the individual. |
Numeric value of translocation rate.
Calculate yield from dose
calculate_yield( dose, type = c("estimate", "lower", "upper"), general_fit_coeffs, general_fit_var_cov_mat = NULL, protracted_g_value = 1, conf_int = 0.95 )
calculate_yield( dose, type = c("estimate", "lower", "upper"), general_fit_coeffs, general_fit_var_cov_mat = NULL, protracted_g_value = 1, conf_int = 0.95 )
dose |
Numeric value of dose. |
type |
Type of yield calculation. Can be "estimate", "lower", or "upper". |
general_fit_coeffs |
Generalised fit coefficients matrix. |
general_fit_var_cov_mat |
Generalised variance-covariance matrix. |
protracted_g_value |
Protracted |
conf_int |
Curve confidence interval, 95% by default. |
Numeric value of yield.
Calculate theoretical yield infimum
calculate_yield_infimum( type = c("estimate", "lower", "upper"), general_fit_coeffs, general_fit_var_cov_mat = NULL, conf_int = 0.95 )
calculate_yield_infimum( type = c("estimate", "lower", "upper"), general_fit_coeffs, general_fit_var_cov_mat = NULL, conf_int = 0.95 )
type |
Type of yield calculation. Can be "estimate", "lower", or "upper". |
general_fit_coeffs |
Generalised fit coefficients matrix. |
general_fit_var_cov_mat |
Generalised variance-covariance matrix. |
conf_int |
Curve confidence interval, 95% by default. |
Numeric value of yield infimum.
Correct boundary of irradiated fractions to be bounded by 0 and 1
correct_boundary(x)
correct_boundary(x)
x |
Numeric value. |
Numeric value in [0, 1] range.
Correct yield confidence interval if simple method is required.
correct_conf_int( conf_int, general_fit_var_cov_mat, protracted_g_value = 1, type, dose = seq(0, 10, 0.2) )
correct_conf_int( conf_int, general_fit_var_cov_mat, protracted_g_value = 1, type, dose = seq(0, 10, 0.2) )
conf_int |
Confidence interval. |
general_fit_var_cov_mat |
Generalised variance-covariance matrix. |
protracted_g_value |
Protracted |
type |
Type of yield calculation. Can be "estimate", "lower", or "upper". |
dose |
Numeric value of dose. |
Numeric value of corrected confidence interval.
Correct negative values
correct_negative_vals(x)
correct_negative_vals(x)
x |
Numeric value. |
Numeric value corrected to zero if negative.
Correct yields if they are below the curve
correct_yield( yield, type = "estimate", general_fit_coeffs, general_fit_var_cov_mat, conf_int )
correct_yield( yield, type = "estimate", general_fit_coeffs, general_fit_var_cov_mat, conf_int )
yield |
Numeric value of yield. |
type |
Type of yield calculation. Can be "estimate", "lower", or "upper". |
general_fit_coeffs |
Generalised fit coefficients matrix. |
general_fit_var_cov_mat |
Generalised variance-covariance matrix. |
conf_int |
Curve confidence interval. |
Numeric value of corrected yield.
Normalised DNA Content of Human Chromosomes from the International Human Genome Sequencing Consortium.
dna_content_fractions_ihgsc
dna_content_fractions_ihgsc
A data frame with 24 rows and 3 variables:
Chromosome.
Normalised content of megabases on male human DNA.
Normalised content of megabases on female human DNA.
Last accessed in July 2020.
https://www.ncbi.nlm.nih.gov/grc/human/data
Normalised DNA Content of Human Chromosomes from Morton, N. E. (1991). Parameters of the human genome. Proceedings of the National Academy of Sciences, 88(17), 7474-7476.
dna_content_fractions_morton
dna_content_fractions_morton
A data frame with 24 rows and 3 variables:
Chromosome.
Normalised content of megabases on male human DNA.
Normalised content of megabases on female human DNA.
Method based on the paper by Pujol, M. et al. (2016). A New Model for Biological Dose Assessment in Cases of Heterogeneous Exposures to Ionizing Radiation. Radiation Research, 185(2), 151-162. <doi:10.1667/RR14145.1>.
estimate_hetero_mixed_poisson( case_data, fit_coeffs, fit_var_cov_mat, conf_int = 0.95, protracted_g_value = 1, gamma, gamma_error )
estimate_hetero_mixed_poisson( case_data, fit_coeffs, fit_var_cov_mat, conf_int = 0.95, protracted_g_value = 1, gamma, gamma_error )
case_data |
Case data in data frame form. |
fit_coeffs |
Fitting coefficients matrix. |
fit_var_cov_mat |
Fitting variance-covariance matrix. |
conf_int |
Confidence interval, 95% by default. |
protracted_g_value |
Protracted |
gamma |
Survival coefficient of irradiated cells. |
gamma_error |
Error of the survival coefficient of irradiated cells. |
List containing estimated mixing proportions data frame, estimated yields data
frame, estimated doses data frame, estimated fraction of irradiated blood data frame,
AIC, and conf_int_*
used.
Method based on the paper by Dolphin, G. W. (1969). Biological Dosimetry with Particular Reference to Chromosome Aberration Analysis: A Review of Methods. International Atomic Energy Agency (IAEA) Retrieved from https://inis.iaea.org/search/search.aspx?orig_q=RN:45029080.
estimate_partial_body_dolphin( case_data, fit_coeffs, fit_var_cov_mat, conf_int = 0.95, protracted_g_value = 1, genome_factor = 1, gamma, aberr_module = c("dicentrics", "translocations", "micronuclei") )
estimate_partial_body_dolphin( case_data, fit_coeffs, fit_var_cov_mat, conf_int = 0.95, protracted_g_value = 1, genome_factor = 1, gamma, aberr_module = c("dicentrics", "translocations", "micronuclei") )
case_data |
Case data in data frame form. |
fit_coeffs |
Fitting coefficients matrix. |
fit_var_cov_mat |
Fitting variance-covariance matrix. |
conf_int |
Confidence interval, 95% by default. |
protracted_g_value |
Protracted |
genome_factor |
Genomic conversion factor used in translocations, else 1. |
gamma |
Survival coefficient of irradiated cells. |
aberr_module |
Aberration module. |
List containing estimated doses data frame, observed fraction of cells scored
which were irradiated, estimated fraction of irradiated blood data frame, AIC, and
conf_int_*
used.
Method based on 2001 manual by the International Atomic Energy Agency (IAEA). Cytogenetic Analysis for Radiation Dose Assessment, Technical Reports Series (2001). Retrieved from https://www.iaea.org/publications/6303/cytogenetic-analysis-for-radiation-dose-assessment.
estimate_whole_body_delta( case_data, fit_coeffs, fit_var_cov_mat, conf_int = 0.95, protracted_g_value = 1, aberr_module = c("dicentrics", "translocations", "micronuclei") )
estimate_whole_body_delta( case_data, fit_coeffs, fit_var_cov_mat, conf_int = 0.95, protracted_g_value = 1, aberr_module = c("dicentrics", "translocations", "micronuclei") )
case_data |
Case data in data frame form. |
fit_coeffs |
Fitting coefficients matrix. |
fit_var_cov_mat |
Fitting variance-covariance matrix. |
conf_int |
Confidence interval, 95% by default. |
protracted_g_value |
Protracted |
aberr_module |
Aberration module. |
List containing estimated doses data frame, AIC, and conf_int
used.
Method based on the paper by Merkle, W. (1983). Statistical methods in regression and calibration analysis of chromosome aberration data. Radiation and Environmental Biophysics, 21(3), 217-233. <doi:10.1007/BF01323412>.
estimate_whole_body_merkle( case_data, fit_coeffs, fit_var_cov_mat, conf_int_yield = 0.83, conf_int_curve = 0.83, protracted_g_value = 1, genome_factor = 1, aberr_module = c("dicentrics", "translocations", "micronuclei") )
estimate_whole_body_merkle( case_data, fit_coeffs, fit_var_cov_mat, conf_int_yield = 0.83, conf_int_curve = 0.83, protracted_g_value = 1, genome_factor = 1, aberr_module = c("dicentrics", "translocations", "micronuclei") )
case_data |
Case data in data frame form. |
fit_coeffs |
Fitting coefficients matrix. |
fit_var_cov_mat |
Fitting variance-covariance matrix. |
conf_int_yield |
Confidence interval of the yield, 83% by default. |
conf_int_curve |
Confidence interval of the curve, 83% by default. |
protracted_g_value |
Protracted |
genome_factor |
Genomic conversion factor used in translocations, else 1. |
aberr_module |
Aberration module. |
List containing estimated doses data frame, AIC, and conf_int_*
used.
Perform dose-effect fitting. A generalized linear model (GLM) is used by default, with a maximum likelihood estimation (MLE) as a fallback method.
fit( count_data, model_formula, model_family, fit_link = "identity", aberr_module = c("dicentrics", "translocations", "micronuclei"), algorithm = c("glm", "maxlik") )
fit( count_data, model_formula, model_family, fit_link = "identity", aberr_module = c("dicentrics", "translocations", "micronuclei"), algorithm = c("glm", "maxlik") )
count_data |
Count data in data frame form. |
model_formula |
Model formula. |
model_family |
Model family. |
fit_link |
Family link. |
aberr_module |
Aberration module. |
algorithm |
Optional selection of algorithm to be used, either "glm" (for GLM) or "maxlik" (for MLE). By default, "glm" is used, with "maxlik" as a fallback method. |
The GLM method is based on the paper by Edwards, A. A. et al. (1979). Radiation induced chromosome aberrations and the Poisson distribution. Radiation and Environmental Biophysics, 16(2), 89-100. <doi:10.1007/BF01323216>.
The MLE method is based on the paperby Oliveira, M. et al. (2016). Zero-inflated regression models for radiation-induced chromosome aberration data: A comparative study. Biometrical Journal, 58(2), 259-279. <doi:10.1002/bimj.201400233>.
List object containing fit results either using GLM or maxLik optimization.
Method based on the paper by Edwards, A. A. et al. (1979). Radiation induced chromosome aberrations and the Poisson distribution. Radiation and Environmental Biophysics, 16(2), 89-100. <doi:10.1007/BF01323216>.
fit_glm_method( count_data, model_formula, model_family = c("automatic", "poisson", "quasipoisson", "nb2"), fit_link = "identity", aberr_module = c("dicentrics", "translocations", "micronuclei") )
fit_glm_method( count_data, model_formula, model_family = c("automatic", "poisson", "quasipoisson", "nb2"), fit_link = "identity", aberr_module = c("dicentrics", "translocations", "micronuclei") )
count_data |
Count data in data frame form. |
model_formula |
Model formula. |
model_family |
Model family. |
fit_link |
Family link. |
aberr_module |
Aberration module. |
List object containing GLM fit results.
Method based on the paper by Oliveira, M. et al. (2016). Zero-inflated regression models for radiation-induced chromosome aberration data: A comparative study. Biometrical Journal, 58(2), 259-279. <doi:10.1002/bimj.201400233>.
fit_maxlik_method( data, model_formula, model_family = c("automatic", "poisson", "quasipoisson", "nb2"), fit_link, aberr_module = c("dicentrics", "translocations", "micronuclei") )
fit_maxlik_method( data, model_formula, model_family = c("automatic", "poisson", "quasipoisson", "nb2"), fit_link, aberr_module = c("dicentrics", "translocations", "micronuclei") )
data |
Count data. |
model_formula |
Model formula. |
model_family |
Model family. |
fit_link |
Family link. |
aberr_module |
Aberration module. |
List object containing maxLik fit results.
Delta method for approximating the standard error of a transformation of a random variable
, given estimates of the mean and covariance matrix of
.
get_deltamethod_std_err( fit_is_lq, variable = c("dose", "fraction_partial", "fraction_hetero"), mean_estimate, cov_estimate, protracted_g_value = NA, d0 = NA )
get_deltamethod_std_err( fit_is_lq, variable = c("dose", "fraction_partial", "fraction_hetero"), mean_estimate, cov_estimate, protracted_g_value = NA, d0 = NA )
fit_is_lq |
Whether the fit is linear quadratic ( |
variable |
Variable resulting of the transformation |
mean_estimate |
The estimated mean of |
cov_estimate |
The estimated covariance matrix of |
protracted_g_value |
Protracted |
d0 |
Survival coefficient of irradiated cells. |
Numeric value containing the standard error of the dose estimate.
Include Markdown help
include_help(...)
include_help(...)
... |
Character vector specifying directory and or file to point to inside the current package. |
Load RMarkdown report
load_rmd_report(...)
load_rmd_report(...)
... |
Character vector specifying directory and or file to point to inside the current package. |
Plot dose estimation curve
plot_estimated_dose_curve( est_doses, fit_coeffs, fit_var_cov_mat, protracted_g_value = 1, conf_int_curve, aberr_name )
plot_estimated_dose_curve( est_doses, fit_coeffs, fit_var_cov_mat, protracted_g_value = 1, conf_int_curve, aberr_name )
est_doses |
List of dose estimations results from |
fit_coeffs |
Fitting coefficients matrix. |
fit_var_cov_mat |
Fitting variance-covariance matrix. |
protracted_g_value |
Protracted |
conf_int_curve |
Confidence interval of the curve. |
aberr_name |
Name of the aberration to use in the y-axis. |
ggplot2
object.
Plot fit dose curve
plot_fit_dose_curve(fit_results_list, aberr_name)
plot_fit_dose_curve(fit_results_list, aberr_name)
fit_results_list |
List of fit results. |
aberr_name |
Name of the aberration to use in the y-axis. |
ggplot2
object.
Prepare count data for max-likelihood optimization fitting
prepare_maxlik_count_data( count_data, model_formula, aberr_module = c("dicentrics", "translocations", "micronuclei") )
prepare_maxlik_count_data( count_data, model_formula, aberr_module = c("dicentrics", "translocations", "micronuclei") )
count_data |
Count data in data frame form. |
model_formula |
Model formula. |
aberr_module |
Aberration module. |
Data frame of parsed count data.
Project yield into dose-effect fitting curve
project_yield( yield, type = "estimate", general_fit_coeffs, general_fit_var_cov_mat = NULL, protracted_g_value = 1, conf_int = 0.95 )
project_yield( yield, type = "estimate", general_fit_coeffs, general_fit_var_cov_mat = NULL, protracted_g_value = 1, conf_int = 0.95 )
yield |
Yield to be projected. |
type |
Type of yield calculation. Can be "estimate", "lower", or "upper". |
general_fit_coeffs |
Generalised fit coefficients matrix. |
general_fit_var_cov_mat |
Generalised variance-covariance matrix. |
protracted_g_value |
Protracted |
conf_int |
Curve confidence interval, 95% by default. |
Numeric value of projected dose.
Calculation based on the paper by Lea, D. E. & Catcheside, D. G. (1942). The mechanism of the induction by radiation of chromosome aberrations inTradescantia. Journal of Genetics, 44(2-3), 216-245. <doi:10.1007/BF02982830>.
protracted_g_function(time, time_0 = 2)
protracted_g_function(time, time_0 = 2)
time |
Time over which the irradiation occurred. |
time_0 |
The mean lifetime of the breaks, which has been shown to be on the order of ~ 2 hours (default value). |
Numeric value of .
Calculate R regression confidence factor depending on selected confidence interval and type of fit.
R_factor(general_fit_coeffs, conf_int = 0.95)
R_factor(general_fit_coeffs, conf_int = 0.95)
general_fit_coeffs |
Generalised fit coefficients matrix. |
conf_int |
Confidence interval, 95% by default. |
Numeric value of R regression confidence factor.
Run the Shiny Application
run_app(...)
run_app(...)
... |
A series of options to be used inside the app. |
Used for side-effect.
Calculate yield error using Merkle's method
yield_error_fun(dose, general_fit_var_cov_mat = NULL, protracted_g_value = 1)
yield_error_fun(dose, general_fit_var_cov_mat = NULL, protracted_g_value = 1)
dose |
Numeric value of dose. |
general_fit_var_cov_mat |
Generalised variance-covariance matrix. |
protracted_g_value |
Protracted |
Numeric value of yield error.
Calculate yield
yield_fun(dose, general_fit_coeffs, protracted_g_value = 1)
yield_fun(dose, general_fit_coeffs, protracted_g_value = 1)
dose |
Numeric value of dose. |
general_fit_coeffs |
Generalised fit coefficients matrix. |
protracted_g_value |
Protracted |
Numeric value of yield.