From 66b20da9280dcfcf9fa931c061edf38ed664ad9c Mon Sep 17 00:00:00 2001 From: RobFryer Date: Mon, 1 Jul 2024 18:48:36 +0100 Subject: [PATCH] Update TEF stuff --- DESCRIPTION | 2 + R/import_check_functions.R | 22 +++- R/import_functions.R | 48 +++++++-- R/information_functions.R | 131 +++++++++++++++++++++--- example_HELCOM.r | 6 +- example_OSPAR.r | 12 +-- information/AMAP/determinand.csv | 2 +- information/HELCOM_2023/determinand.csv | 5 +- information/OSPAR_2022/determinand.csv | 5 +- man/info_TEF.Rd | 48 +++++++-- vignettes/example_HELCOM.Rmd.orig | 38 ++++--- vignettes/example_OSPAR.Rmd.orig | 15 +-- 12 files changed, 260 insertions(+), 74 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 693544b..4f10036 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,6 +26,7 @@ Imports: dplyr, flexsurv, lattice, + lifecycle, lme4, lubridate, magrittr, @@ -38,6 +39,7 @@ Imports: pbapply, readr, readxl, + rlang, sf, stringr, survival, diff --git a/R/import_check_functions.R b/R/import_check_functions.R index 8b2214a..bf044bf 100644 --- a/R/import_check_functions.R +++ b/R/import_check_functions.R @@ -513,11 +513,29 @@ ctsm.check.unit.biota <- function(data, info) { }) id <- data$determinand %in% "TEQDFP" - if (any(id)) + if (any(id)) { + + TEQ_unit <- paste("TEQ", standard_unit) + data[id,] <- within(data[id,], { - ok <- unit %in% paste("TEQ", standard_unit) + ok <- unit %in% c(standard_unit, TEQ_unit) action <- ifelse(ok, "none", "error") + + if (any(TEQ_unit %in% unit)) { + lifecycle::deprecate_warn( + "1.0.2", + I("use of units of the form 'TEQ ug/kg' or 'TEQ pg/g'"), + details = c( + i = "use e.g. 'ug/kg' instead of 'TEQ ug/kg'", + i = "you might need to update the determinand reference table" + ), + env = rlang::caller_env(), + user_env = rlang::caller_env(2) + ) + } + }) + } id <- data$determinand %in% c("LNMEA") if (any(id)) diff --git a/R/import_functions.R b/R/import_functions.R index 7876081..d865779 100644 --- a/R/import_functions.R +++ b/R/import_functions.R @@ -3444,7 +3444,7 @@ assign("determinand.link.LIPIDWT%", function(data, info, keep, drop, ...) { determinand.link.sum <- function(data, info, keep, drop, weights = NULL) { - + stopifnot(length(keep) == 1, length(drop) > 1) if (!any(data$determinand %in% drop)) @@ -3453,10 +3453,10 @@ determinand.link.sum <- function(data, info, keep, drop, weights = NULL) { if (!is.null(weights)) { if (!identical(sort(drop), sort(names(weights)))) { - stop( - "error in weights list", - call. = FALSE - ) + stop( + "error in weights list", + call. = FALSE + ) } } @@ -3490,15 +3490,23 @@ determinand.link.sum <- function(data, info, keep, drop, weights = NULL) { # check all bases are the same - stopifnot(dplyr::n_distinct(x$basis) == 1) - if (!all(drop %in% x$determinand)) return(NULL) + + if (dplyr::n_distinct(x$basis) != 1) { + stop( + "the determinands in `drop` are reported in different bases within ", + "the same sample;\ncode to deal with this has not yet been written so ", + "please raise an issue with the harsat\ndevelopment team", + call. = FALSE + ) + } + # extract unit and weights information id <- c("value", "uncertainty", "limit_detection", "limit_quantification") - target_unit = ctsm_get_info(info$determinand, keep, "unit", info$compartment,sep="_") + target_unit = ctsm_get_info(info$determinand, keep, "unit", info$compartment, sep="_") x[id] <- lapply(x[id], convert_units, from = x$unit, to = target_unit) @@ -3518,7 +3526,7 @@ determinand.link.sum <- function(data, info, keep, drop, weights = NULL) { out$determinand <- keep out$unit <- target_unit - out$group <- ctsm_get_info(info$determinand, keep, "group", info$compartment,sep="_") + out$group <- ctsm_get_info(info$determinand, keep, "group", info$compartment, sep="_") out$pargroup <- ctsm_get_info(info$determinand, keep, "pargroup") # sum value and limit_detection, make it a less-than if all are less-thans, and take @@ -3575,6 +3583,20 @@ determinand.link.sum <- function(data, info, keep, drop, weights = NULL) { determinand.link.TEQDFP <- function(data, info, keep, drop, weights) { + + lifecycle::deprecate_warn( + "1.0.2", + "determinand.link.TEQDFP()", + details = c( + i = paste( + "use `determinand.link.sum()` with the TEFs supplied in the weights", + "argument" + ), + i = 'see `vignette("example_HELCOM")` for further details' + ), + env = rlang::caller_env(), + user_env = rlang::caller_env(2) + ) stopifnot(length(keep) == 1, length(drop) > 1) @@ -3634,7 +3656,13 @@ determinand.link.TEQDFP <- function(data, info, keep, drop, weights) { out <- x[which.max(x$value), ] out$determinand <- keep - out$unit <- "TEQ ug/kg" + + target_unit <- ctsm_get_info(info$determinand, keep, "unit", info$compartment, sep="_") + if (grepl("TEQ", target_unit)) { + out$unit <- "TEQ ug/kg" + } else { + out$unit <- "ug/kg" + } out$group <- "Dioxins" out$pargroup <- "OC-DX" diff --git a/R/information_functions.R b/R/information_functions.R index f135ed3..0e28e47 100644 --- a/R/information_functions.R +++ b/R/information_functions.R @@ -647,6 +647,26 @@ ctsm_read_determinand <- function( }) + # warn about deprecated TEQ units + + not_ok <- sapply(compartment, function(id) { + unit_id <- paste0(id, "_unit") + any(grepl("^TEQ ", data[[unit_id]])) + }) + + if (any(not_ok)) { + lifecycle::deprecate_warn( + "1.0.2", + I("use of units such as 'TEQ ug/kg' and 'TEQ pg/g'"), + details = c( + i = "use e.g. 'ug/kg' instead of 'TEQ ug/kg'", + i = "you might need to update the determinand reference table" + ), + env = rlang::caller_env(2), + user_env = rlang::caller_env(3) + ) + } + # tidy up for output @@ -1976,6 +1996,20 @@ convert_units_workup <- function(units) { # could add in more units but those below cover all the ones needed to date + if (any(c("TEQ ug/kg", "TEQ pg/g") %in% units)) { + lifecycle::deprecate_warn( + "1.0.2", + I("conversion between units 'TEQ ug/kg' and 'TEQ pg/g'"), + details = c( + i = "use e.g. 'ug/kg' instead of 'TEQ ug/kg'", + i = "you might need to update the determinand reference table" + ), + env = rlang::caller_env(3), + user_env = rlang::caller_env(4) + ) + } + + unit_group <- list( "length" = c("km", "m", "cm", "mm"), "weight" = c("kg", "g", "mg"), @@ -2577,38 +2611,101 @@ get.info.imposex <- function( # TEF values ---- -#' TEF values for selected groups of compounds +#' TEFs for selected groups of compounds +#' +#' A list of named vectors which provide Toxic Equivalency Factors (TEFs) for +#' calculating Toxic EQuivalent (TEQ) sums. #' -#' A list of named vectors which currently provide the TEFs for the WHO TEQ for -#' dioxins, furans and dioxin-like (planar) polychlorinated biphenyls. -#' DFP_environmental and DFP_human_health provide the TEFs appropriate for -#' testing against the environmental and human health standards respectively. +#' @usage #' -#' Adding further TEFs will require more development to the relevant -#' determinand_link function +#' info_TEF$DFP_2005 +#' info_TEF$DFP_2022 +#' +#' @format +#' +#' A list of named vectors: +#' +#' * `DFP_2005` gives the 2005 World Health Organisation TEFs for dioxins, +#' furans and dioxin-like (planar) polychlorinated biphenyls +#' ([Van den Berg et al. 2006](https://doi.org/10.1093/toxsci/kfl055)) +#' * `DFP_2022` gives the 2022 World Health Organisation TEFs for dioxins, +#' furans and dioxin-like (planar) polychlorinated biphenyls +#' ([DeVito et al. 2024](https://doi.org/10.1016/j.yrtph.2023.105525)) +#' * `DFP_HOLAS3` is a superseded version of `DFP_2005` that was used in the +#' HELCOM HOLAS3 assessment. It excludes CB114, CB123 and CB189 and uses code +#' CDFO instead of OCDF. It is included for reproducibility, but might be +#' removed in the future. +#' * `DFP_CEMP` is a superseded version of `DFP_2005` that was used in the +#' OSPAR CEMP assessments up to and including 2024. It excludes CB114, CB123 and +#' CB189, uses code CDFO instead of OCDF, and has a TEF for CDFO of 0.00003 +#' rather than 0.0003. It is included for reproducibility, but might be removed +#' in the future. +#' +#' @references +#' +#' DeVito M, Bokkers B, van Duursen MBM, van Ede K, Feeley M, Gáspár EAF, +#' Haws L, Kennedy S, Peterson RE, Hoogenboom R, Nohara K, Petersen K, Rider C, +#' Rose M, Safe S, Schrenk D, Wheeler MW, Wikoff DS, Zhao B, van den Berg M, +#' 2024. The 2022 world health organization reevaluation of human and mammalian +#' toxic equivalency factors for polychlorinated dioxins, dibenzofurans and +#' biphenyls. Regulatory Toxicology and Pharmacology 146; +#' [https://doi.org/10.1016/j.yrtph.2023.105525] +#' +#' Van den Berg M, Birnbaum LS, Denison M, De Vito M, Farland W, Feeley M, +#' Fiedler H, Hakansson H, Hanberg A, Haws L, Rose M, Safe S, Schrenk D, +#' Tohyama C, Tritscher A, Tuomisto J, Tysklind M, Walker N, Peterson RE, 2006. +#' The 2005 World Health Organization reevaluation of human and mammalian toxic +#' equivalency factors for dioxins and dioxin-like compounds. Toxicological +#' Sciences 93 223–241; [https://doi.org/10.1093/toxsci/kfl055] #' #' @export info_TEF <- list( - DFP_environmental = c( + DFP_2005 = c( + "CB77" = 0.0001, "CB81" = 0.0003, "CB105" = 0.00003, "CB114" = 0.00003, + "CB118" = 0.00003, "CB123" = 0.00003, "CB126" = 0.1, "CB156" = 0.00003, + "CB157" = 0.00003, "CB167" = 0.00003, "CB169" = 0.03, "CB189" = 0.00003, + "CDD1N" = 1, "CDD4X" = 0.1, "CDD6P" = 0.01, "CDD6X" = 0.1, + "CDD9X" = 0.1, "CDDO" = 0.0003, "TCDD" = 1, + "CDF2N" = 0.3, "CDF2T" = 0.1, "CDF4X" = 0.1, "CDF6P" = 0.01, + "CDF6X" = 0.1, "CDF9P" = 0.01, "CDF9X" = 0.1, + "CDFP2" = 0.03, "CDFX1" = 0.1, "OCDF" = 0.0003 + ), + DFP_2022 = c( + "CB77" = 0.0003, "CB81" = 0.006, "CB105" = 0.00003, "CB114" = 0.00003, + "CB118" = 0.00003, "CB123" = 0.00003, "CB126" = 0.05, "CB156" = 0.00003, + "CB157" = 0.00003, "CB167" = 0.00003, "CB169" = 0.005, "CB189" = 0.00003, + "CDD1N" = 0.4, "CDD4X" = 0.09, "CDD6P" = 0.05, "CDD6X" = 0.07, + "CDD9X" = 0.05, "CDDO" = 0.001, "TCDD" = 1, + "CDF2N" = 0.1, "CDF2T" = 0.07, "CDF4X" = 0.1, "CDF6P" = 0.02, + "CDF6X" = 0.09, "CDF9P" = 0.1, "CDF9X" = 0.2, + "CDFP2" = 0.01, "CDFX1" = 0.3, "OCDF" = 0.002 + ), + DFP_CEMP = c( "CB77" = 0.0001, "CB81" = 0.0003, "CB105" = 0.00003, "CB118" = 0.00003, "CB126" = 0.1, "CB156" = 0.00003, "CB157" = 0.00003, "CB167" = 0.00003, - "CB169" = 0.03, "CDD1N" = 1, "CDD4X" = 0.1, "CDD6P" = 0.01, "CDD6X" = 0.1, - "CDD9X" = 0.1, "CDDO" = 0.0003, "CDF2N" = 0.3, "CDF2T" = 0.1, "CDF4X" = 0.1, - "CDF6P" = 0.01, "CDF6X" = 0.1, "CDF9P" = 0.01, - "CDF9X" = 0.1, "CDFO" = 0.00003, "CDFP2" = 0.03, "CDFX1" = 0.1, "TCDD" = 1 + "CB169" = 0.03, + "CDD1N" = 1, "CDD4X" = 0.1, "CDD6P" = 0.01, "CDD6X" = 0.1, + "CDD9X" = 0.1, "CDDO" = 0.0003, "TCDD" = 1, + "CDF2N" = 0.3, "CDF2T" = 0.1, "CDF4X" = 0.1, "CDF6P" = 0.01, + "CDF6X" = 0.1, "CDF9P" = 0.01, "CDF9X" = 0.1, "CDFO" = 0.00003, + "CDFP2" = 0.03, "CDFX1" = 0.1 ), - DFP_human_health = c( + DFP_HOLAS3 = c( "CB77" = 0.0001, "CB81" = 0.0003, "CB105" = 0.00003, "CB118" = 0.00003, "CB126" = 0.1, "CB156" = 0.00003, "CB157" = 0.00003, "CB167" = 0.00003, - "CB169" = 0.03, "CDD1N" = 1, "CDD4X" = 0.1, "CDD6P" = 0.01, "CDD6X" = 0.1, - "CDD9X" = 0.1, "CDDO" = 0.0003, "CDF2N" = 0.3, "CDF2T" = 0.1, "CDF4X" = 0.1, - "CDF6P" = 0.01, "CDF6X" = 0.1, "CDF9P" = 0.01, - "CDF9X" = 0.1, "CDFO" = 0.0003, "CDFP2" = 0.03, "CDFX1" = 0.1, "TCDD" = 1 + "CB169" = 0.03, + "CDD1N" = 1, "CDD4X" = 0.1, "CDD6P" = 0.01, "CDD6X" = 0.1, + "CDD9X" = 0.1, "CDDO" = 0.0003, "TCDD" = 1, + "CDF2N" = 0.3, "CDF2T" = 0.1, "CDF4X" = 0.1, "CDF6P" = 0.01, + "CDF6X" = 0.1, "CDF9P" = 0.01, "CDF9X" = 0.1, "CDFO" = 0.0003, + "CDFP2" = 0.03, "CDFX1" = 0.1 ) ) + + # ICES RECO codes ---- # reads in data from csv files exported from ICES RECO diff --git a/example_HELCOM.r b/example_HELCOM.r index 0239f1a..7221a42 100644 --- a/example_HELCOM.r +++ b/example_HELCOM.r @@ -311,9 +311,9 @@ biota_timeseries <- create_timeseries( action = "sum" ), TEQDFP = list( - det = names(info_TEF$DFP_human_health), - action = "bespoke", - weights = info_TEF$DFP_human_health + det = names(info_TEF$DFP_HOLAS3), + action = "sum", + weights = info_TEF$DFP_HOLAS3 ), "LIPIDWT%" = list(det = c("EXLIP%", "FATWT%"), action = "bespoke") ), diff --git a/example_OSPAR.r b/example_OSPAR.r index 0709554..3967ef0 100644 --- a/example_OSPAR.r +++ b/example_OSPAR.r @@ -101,9 +101,9 @@ sediment_timeseries <- create_timeseries( CB138 = list(det = c("CB138+163"), action = "replace"), CB156 = list(det = c("CB156+172"), action = "replace"), TEQDFP = list( - det = names(info_TEF$DFP_environmental), - action = "bespoke", - weights = info_TEF$DFP_environmental + det = names(info_TEF$DFP_CEMP), + action = "sum", + weights = info_TEF$DFP_CEMP ), HCEPX = list(det = c("HCEPC", "HCEPT"), action = "sum") ), @@ -214,9 +214,9 @@ biota_timeseries <- create_timeseries( action = "sum" ), TEQDFP = list( - det = names(info_TEF$DFP_environmental), - action = "bespoke", - weights = info_TEF$DFP_environmental + det = names(info_TEF$DFP_CEMP), + action = "sum", + weights = info_TEF$DFP_CEMP ), HCEPX = list(det = c("HCEPC", "HCEPT"), action = "sum"), HCH = list(det = c("HCHA", "HCHB", "HCHG"), action = "sum"), diff --git a/information/AMAP/determinand.csv b/information/AMAP/determinand.csv index cf87fba..6d38ef8 100644 --- a/information/AMAP/determinand.csv +++ b/information/AMAP/determinand.csv @@ -552,7 +552,7 @@ TDEOP,TDE (o--p') = DDD (o--p'),OC-DD,Organochlorines,,,TRUE,FALSE,FALSE,ug/kg,, TDEPP,TDE (p--p'),OC-DD,Organochlorines,Organochlorines,Organochlorines,TRUE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,0.006667,0.197,0.006667,0.3,0,0.16425,lognormal,low,OSPAR,ICES TEBDE,tetra-bromodiphenyl ether (sum of congeners),O-BR,Organobromines,,,FALSE,FALSE,FALSE,ug/kg,,,,,,,,,,,,lognormal,low,ICES,ICES TEMP,temperature,P-PHY,Physical measurements,,,FALSE,FALSE,FALSE,,,,,,,,,,,,,,,ICES,ICES -TEQDFP,WHO-TEQ (DFP),OC-DX,Dioxins,Dioxins,,TRUE,FALSE,FALSE,TEQ ug/kg,TEQ ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,0.000018,0.1375,0.000039,0.237592,,,lognormal,low,OSPAR/HELCOM, +TEQDFP,WHO-TEQ (DFP),OC-DX,Dioxins,Dioxins,,TRUE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,0.000018,0.1375,0.000039,0.237592,,,lognormal,low,OSPAR/HELCOM, THCGC,total hydrocarbons (by GC),O-THC,Total hydrocarbons,,,FALSE,FALSE,FALSE,,,,,,,,,,,,,lognormal,low,ICES,ICES THCGR,total hydrocarbons (by gravimetry),O-THC,Total hydrocarbons,,,FALSE,FALSE,FALSE,,,,,,,,,,,,,lognormal,low,ICES,ICES THCIR,total hydrocarbons (by infrared spectrophotometry),O-THC,Total hydrocarbons,,,FALSE,FALSE,FALSE,,,,,,,,,,,,,lognormal,low,ICES,ICES diff --git a/information/HELCOM_2023/determinand.csv b/information/HELCOM_2023/determinand.csv index 8aa9e56..0b52c1a 100644 --- a/information/HELCOM_2023/determinand.csv +++ b/information/HELCOM_2023/determinand.csv @@ -22,7 +22,9 @@ CB99,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug CB101,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,0.033333,0.15,0.033333,0.151854,0,0.175,lognormal,low CB105,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,0.00541,0.175,0.016333,0.180065,,,lognormal,low CB110,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low +CB114,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low CB118,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,0.033333,0.151458,0.03,0.165,0,0.2,lognormal,low +CB123,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low CB126,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,3.00E-05,0.164144,,,,,lognormal,low CB128,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low CB132,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low @@ -74,7 +76,8 @@ CDFDN,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYW CDFO,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low CDFP2,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low CDFX1,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low -TEQDFP,WHO-TEQ (DFP),OC-DX,Dioxins,Dioxins,,TRUE,FALSE,FALSE,TEQ ug/kg,TEQ ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,1.80E-05,0.1375,3.90E-05,0.237592,,,lognormal,low +OCDF,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low +TEQDFP,WHO-TEQ (DFP),OC-DX,Dioxins,Dioxins,,TRUE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,1.80E-05,0.1375,3.90E-05,0.237592,,,lognormal,low PFOS,,O-FL,Organofluorines,Organofluorines,Organofluorines,TRUE,FALSE,TRUE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,0.066667,0.199772,,,0.003333,0.172725,lognormal,low N-PFOS,,O-FL,Organofluorines,Organofluorines,Organofluorines,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low BR-PFOS,,O-FL,Organofluorines,Organofluorines,Organofluorines,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%~LOIGN,,,,,,,,lognormal,low diff --git a/information/OSPAR_2022/determinand.csv b/information/OSPAR_2022/determinand.csv index c527a2e..825f281 100644 --- a/information/OSPAR_2022/determinand.csv +++ b/information/OSPAR_2022/determinand.csv @@ -75,7 +75,9 @@ CB99,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug CB101,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,TRUE,TRUE,TRUE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,0.033333,0.15,0.033333,0.151854,0,0.175,lognormal,low CB105,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,TRUE,TRUE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,0.00541,0.175,0.016333,0.180065,,,lognormal,low CB110,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low +CB114,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low CB118,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,TRUE,TRUE,TRUE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,0.033333,0.151458,0.03,0.165,0,0.2,lognormal,low +CB123,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low CB126,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,TRUE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,3.00E-05,0.164144,,,,,lognormal,low CB128,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low CB132,,OC-CB,Chlorobiphenyls,Chlorobiphenyls,Chlorobiphenyls,FALSE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low @@ -170,7 +172,8 @@ CDFDN,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYW CDFO,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low CDFP2,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low CDFX1,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low -TEQDFP,WHO-TEQ (DFP),OC-DX,Dioxins,Dioxins,,TRUE,TRUE,FALSE,TEQ ug/kg,TEQ ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,1.80E-05,0.1375,3.90E-05,0.237592,,,lognormal,low +OCDF,,OC-DX,Dioxins,Dioxins,,FALSE,FALSE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,,,,,,,lognormal,low +TEQDFP,WHO-TEQ (DFP),OC-DX,Dioxins,Dioxins,,TRUE,TRUE,FALSE,ug/kg,ug/kg,,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,1.80E-05,0.1375,3.90E-05,0.237592,,,lognormal,low PFOA,,O-FL,Organofluorines,Organofluorines,Organofluorines,TRUE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,0.075,0.178,,,,,lognormal,low PFNA,,O-FL,Organofluorines,Organofluorines,Organofluorines,TRUE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,0.05,0.25,,,,,lognormal,low PFDA,,O-FL,Organofluorines,Organofluorines,Organofluorines,TRUE,FALSE,FALSE,ug/kg,ug/kg,ng/l,LNMEA~LIPIDWT%~DRYWT%,AL~CORG~DRYWT%,,0.043333,0.249459,,,,,lognormal,low diff --git a/man/info_TEF.Rd b/man/info_TEF.Rd index b590387..ae182b6 100644 --- a/man/info_TEF.Rd +++ b/man/info_TEF.Rd @@ -3,21 +3,49 @@ \docType{data} \name{info_TEF} \alias{info_TEF} -\title{TEF values for selected groups of compounds} +\title{TEFs for selected groups of compounds} \format{ -An object of class \code{list} of length 2. +A list of named vectors: +\itemize{ +\item \code{DFP_2005} gives the 2005 World Health Organisation TEFs for dioxins, +furans and dioxin-like (planar) polychlorinated biphenyls +(\href{https://doi.org/10.1093/toxsci/kfl055}{Van den Berg et al. 2006}) +\item \code{DFP_2022} gives the 2022 World Health Organisation TEFs for dioxins, +furans and dioxin-like (planar) polychlorinated biphenyls +(\href{https://doi.org/10.1016/j.yrtph.2023.105525}{DeVito et al. 2024}) +\item \code{DFP_HOLAS3} is a superseded version of \code{DFP_2005} that was used in the +HELCOM HOLAS3 assessment. It excludes CB114, CB123 and CB189 and uses code +CDFO instead of OCDF. It is included for reproducibility, but might be +removed in the future. +\item \code{DFP_CEMP} is a superseded version of \code{DFP_2005} that was used in the +OSPAR CEMP assessments up to and including 2024. It excludes CB114, CB123 and +CB189, uses code CDFO instead of OCDF, and has a TEF for CDFO of 0.00003 +rather than 0.0003. It is included for reproducibility, but might be removed +in the future. +} } \usage{ -info_TEF +info_TEF$DFP_2005 +info_TEF$DFP_2022 } \description{ -A list of named vectors which currently provide the TEFs for the WHO TEQ for -dioxins, furans and dioxin-like (planar) polychlorinated biphenyls. -DFP_environmental and DFP_human_health provide the TEFs appropriate for -testing against the environmental and human health standards respectively. +A list of named vectors which provide Toxic Equivalency Factors (TEFs) for +calculating Toxic EQuivalent (TEQ) sums. } -\details{ -Adding further TEFs will require more development to the relevant -determinand_link function +\references{ +DeVito M, Bokkers B, van Duursen MBM, van Ede K, Feeley M, Gáspár EAF, +Haws L, Kennedy S, Peterson RE, Hoogenboom R, Nohara K, Petersen K, Rider C, +Rose M, Safe S, Schrenk D, Wheeler MW, Wikoff DS, Zhao B, van den Berg M, +2024. The 2022 world health organization reevaluation of human and mammalian +toxic equivalency factors for polychlorinated dioxins, dibenzofurans and +biphenyls. Regulatory Toxicology and Pharmacology 146; +\link{https://doi.org/10.1016/j.yrtph.2023.105525} + +Van den Berg M, Birnbaum LS, Denison M, De Vito M, Farland W, Feeley M, +Fiedler H, Hakansson H, Hanberg A, Haws L, Rose M, Safe S, Schrenk D, +Tohyama C, Tritscher A, Tuomisto J, Tysklind M, Walker N, Peterson RE, 2006. +The 2005 World Health Organization reevaluation of human and mammalian toxic +equivalency factors for dioxins and dioxin-like compounds. Toxicological +Sciences 93 223–241; \link{https://doi.org/10.1093/toxsci/kfl055} } \keyword{datasets} diff --git a/vignettes/example_HELCOM.Rmd.orig b/vignettes/example_HELCOM.Rmd.orig index 96a128f..2562de4 100644 --- a/vignettes/example_HELCOM.Rmd.orig +++ b/vignettes/example_HELCOM.Rmd.orig @@ -370,19 +370,25 @@ measurements of a single determinand in a single matrix (tissue type; e.g. 'EH', `LI' or `SB`) in a single species at a single monitoring station. PAH metabolite data are further grouped by `method_analysis`. -The `determinands.control` argument does rather more here. There are four summed -variables: PFOS, SBDE6, HBCD and SCB6. There is also one variable CB138+163 -which needs to be relabeled as (replaced by) CB138. For the purposes of the -assessment, the contribution of CB163 is regarded as small. Similarly CB138+163 -is taken to be a good proxy for CB138. Note that the replacements must be done -before the six PCBs are summed to give SCB6 in order for them to be included -in the sum. - -There are also two 'bespoke' actions in `determinands.control`. These are -customised functions that do more complicated things. One of them computes the -WHO TEQ for dioxins, furans and planar PCBS (labelled TEQDFP) using the TEFs -for the human health QS. The other deals with the three different ways in -which lipid weight measurements can be submitted. +The `determinands.control` argument does rather more here. There are five summed +variables: PFOS, SBDE6, HBCD, SCB6 and TEQDFP. There is also one variable +CB138+163 which needs to be relabeled as (replaced by) CB138. For the purposes +of the assessment, the contribution of CB163 is regarded as small. Similarly +CB138+163 is taken to be a good proxy for CB138. Note that the replacements must +be done before the six PCBs are summed to give SCB6 in order for them to be +included in the sum. + +The calculation of TEQDFP is more complex than that of the other summed variables. +TEQDFP is the label used for the World Health Organisation Toxic Equivalent sum +for dioxins, furans and planar polychlorinated biphenyls. This is calculated +using the Toxic Equivalency Factors (TEFs) stored in `info_TEQ$HOLAS3`, with the +TEFS identified as `weights`. Note that the weights used in the example below +are those used in the HELCOM HOLAS 3 assessment, but have been superseeded; see +`help("info_TEQ")` for more details. + +There is also one 'bespoke' action in `determinands.control`. This triggers a +customised functions that does more complicated things. Here it deals with the +three different ways in which lipid weight measurements can be submitted. Finally, `normalise_biota_HELCOM()` is a customised function that determines which measurements are normalised to 5% lipid in a HELCOM assessment. Again, the @@ -411,9 +417,9 @@ biota_timeseries <- create_timeseries( action = "sum" ), TEQDFP = list( - det = names(info_TEF$DFP_human_health), - action = "bespoke", - weights = info_TEF$DFP_human_health + det = names(info_TEF$DFP_HOLAS3), + action = "sum", + weights = info_TEF$DFP_HOLAS3 ), "LIPIDWT%" = list(det = c("EXLIP%", "FATWT%"), action = "bespoke") ), diff --git a/vignettes/example_OSPAR.Rmd.orig b/vignettes/example_OSPAR.Rmd.orig index 76a0e15..1eff84b 100644 --- a/vignettes/example_OSPAR.Rmd.orig +++ b/vignettes/example_OSPAR.Rmd.orig @@ -164,7 +164,8 @@ Coast or Gulf of Cadiz OSPAR subregions, in which case the concentrations are not normalised. The TEFs for the WHO TEQ for dioxins, furans and planar PCBs (labelled TEQDFP) -are the values for the secondary poisoning QS. +are those used in the OSPAR CEMP assessment up to 2024. Note that these have +been superseeded; see `help("info_TEQ")` for more details. ```{r ospar-sediment-timeseries} sediment_timeseries <- create_timeseries( @@ -178,9 +179,9 @@ sediment_timeseries <- create_timeseries( CB138 = list(det = c("CB138+163"), action = "replace"), CB156 = list(det = c("CB156+172"), action = "replace"), TEQDFP = list( - det = names(info_TEF$DFP_environmental), - action = "bespoke", - weights = info_TEF$DFP_environmental + det = names(info_TEF$DFP_CEMP), + action = "sum", + weights = info_TEF$DFP_CEMP ), HCEPX = list(det = c("HCEPC", "HCEPT"), action = "sum") ), @@ -316,9 +317,9 @@ biota_timeseries <- create_timeseries( action = "sum" ), TEQDFP = list( - det = names(info_TEF$DFP_environmental), - action = "bespoke", - weights = info_TEF$DFP_environmental + det = names(info_TEF$DFP_CEMP), + action = "sum", + weights = info_TEF$DFP_CEMP ), HCEPX = list(det = c("HCEPC", "HCEPT"), action = "sum"), HCH = list(det = c("HCHA", "HCHB", "HCHG"), action = "sum"),