library(biodosetools)
knitr::opts_chunk$set(
  fig.dpi = 96,
  collapse = TRUE,
  comment = "#>"
)

Input count data

The first step is to input the count data. On the {shiny} app, we can select to either load the count data from a file (supported formats are .csv, .dat, and .txt) or to input the data manually. Once the table is generated and filled, the "Calculate parameters" button will calculate the total number of cells ($N$), total number of aberrations ($X$), as well as mean ($\bar{y}$), variance ($\sigma^{2}$), dispersion index ($\sigma^{2}/\bar{y}$), and $u$-value.

knitr::include_graphics("figures/screenshot-dicentrics-fit-01.png")
knitr::include_graphics("figures/screenshot-dicentrics-fit-03.png")

This step is accomplished in R by calling the calculate_aberr_table() function:

count_data <- system.file("extdata", "count-data-barquinero-1995.csv", package = "biodosetools") %>%
  utils::read.csv() %>%
  calculate_aberr_table(type = "count")
count_data

Irradiation conditions

Because irradiation conditions during calibration may influence future dose estimates, and for a better traceability, the user can input the conditions under which the samples used to construct the curve were irradiated. This option is only available in the Shiny app, so that these can be saved into the generated reports.

knitr::include_graphics("figures/screenshot-dicentrics-fit-02.png")

Perform fitting

To perform the fitting the user needs to select the appropriate fitting options to click the "Calculate fitting" button on the "Data input" box.

The fitting results and summary statistics are shown in the "Results" tabbed box, and the dose-effect curve is displayed in the "Curve plot" box.

The "Export results" box shows two buttons: (a) "Save fitting data", and (b) "Download report". The "Save fitting data" will generate an .rds file that contains all information about the count data, irradiation conditions, and options selected when performing the fitting. This file can be then loaded in the dose estimation module to load the dose-effect curve coefficients.

Similarly, the "Download report" will generate a .pdf or a .docx report containing all inputs and fitting results.

knitr::include_graphics("figures/screenshot-dicentrics-fit-04.png")

To perform the fitting in R we call the fit() function:

fit_results <- fit(
  count_data = count_data,
  model_formula = "lin-quad",
  model_family = "automatic",
  fit_link = "identity",
  aberr_module = "dicentrics"
)

The fit_results object is a list that contains all necessary information about the count data as well as options selected when performing the fitting. This is a vital step to ensure traceability and reproducibility. Below we can see its elements:

names(fit_results)

In particular, we can see how fit_coeffs matches the results obtained in the UI:

fit_results$fit_coeffs

To visualise the dose-effect curve, we call the plot_fit_dose_curve() function:

r. The grey shading indicates the uncertainties associated with the calibration curve."} plot_fit_dose_curve( fit_results, aberr_name = "Dicentrics" )



biodosimetry-uab/biodosetools documentation built on Jan. 26, 2024, 5:36 p.m.