EU-kalat: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎Bayes model for dioxin concentrations: technical improvements but mixing problem remains)
(→‎Calculations: code updated but not debugged)
Line 69: Line 69:
library(reshape2)
library(reshape2)


eu <- Ovariable("eu", ddata = "Op_en3104", subset = "POPs")
euRaw <- Ovariable("euRaw", ddata = "Op_en3104", subset = "POPs")
eu <- EvalOutput(eu)
eu@output <- eu@output[c(1:4, 18, 19)] # THL code, Matrix, Congener, Fish species
eu@marginal <- eu@marginal[c(1:4, 18, 19)]
colnames(eu@output) <- c("THLcode", "Matrix", "Congener", "Fish", "euResult", "euSource")


#> unique(eu@output$Congener)
# levels(TEF$Group)
#[1] "Chlorinated dibenzo-p-dioxins" "Chlorinated dibenzofurans"   
#[3] "Mono-ortho–substituted PCBs"  "Non-ortho–substituted PCBs" 
 
TEQgroups <- list(
  In = c(
    "Chlorinated dibenzo-p-dioxins",
    "Chlorinated dibenzofurans",
    "Mono-ortho–substituted PCBs",
    "Non-ortho–substituted PCBs"
  ),
  Out = c("TEQdx", "TEQdx", "TEQpcb", "TEQpcb")
)
 
euAll <- Ovariable(
  "euAll",
  dependencies = data.frame(
    Name=c("euRaw", "TEF"),
    Ident=c(NA,"Op_en4017/initiate")
  ),
  formula = function(...) {
    euAll <- euRaw[,c(1:4, 18, 19)] # THL code, Matrix, Congener, Fish species
    colnames(euAll@output)[1:4] <- c("THLcode", "Matrix", "Compound", "Fish")
    if(exists("TEQgroups")) levels(TEF$Group) <- TEQgroups$Out
   
    temp <- oapply(euAll * TEF, cols = "Compound", FUN = "sum")
    colnames(temp@output)[colnames(temp@output)=="Group"] <- "Compound"
    eu2 <- combine(euAll, temp)
   
    return(eu2)
  }
)
 
euAll <- EvalOutput(euAll)
 
################## Data for the main congeners and species only
 
#> unique(euAll$Congener)
#[1] 2378TCDD    12378PeCDD  123478HCDD  123678HCDD  123789HCDD  1234678HpCDD
#[1] 2378TCDD    12378PeCDD  123478HCDD  123678HCDD  123789HCDD  1234678HpCDD
#[7] OCDD        2378TCDF    12378PeCDF  23478PeCDF  123478HCDF  123678HCDF   
#[7] OCDD        2378TCDF    12378PeCDF  23478PeCDF  123478HCDF  123678HCDF   
Line 82: Line 115:
# Remove the four with too little data (>70% BDL) and all non-PCDDF
# Remove the four with too little data (>70% BDL) and all non-PCDDF
# aggregate(eu@data$euResult, by = eu@data["POP"], FUN = function(x) mean(x == 0))
# aggregate(eu@data$euResult, by = eu@data["POP"], FUN = function(x) mean(x == 0))
conl <- unique(eu@output$Congener)[c(1:12, 14, 15)] # 7 OCDD should be removed
conl <- unique(euAll@output$Congener)[c(1:12, 14, 15)] # 7 OCDD should be removed
eu@output <- eu@output[eu@output$Congener %in% conl , ]  
euMain <- euAll[euAll$Congener %in% conl , ]  


#[1] Baltic herring Sprat          Salmon        Sea trout      Vendace       
#[1] Baltic herring Sprat          Salmon        Sea trout      Vendace       
Line 90: Line 123:
#[16] Trout          Rainbow trout  Arctic char   
#[16] Trout          Rainbow trout  Arctic char   


fisl <- unique(eu@output$Fish)[c(1:4, 6:14, 17)]  
fisl <- unique(euAll@output$Fish)[c(1:4, 6:14, 17)]  
eu@output <- eu@output[eu@output$Fish %in% fisl , ] # Remove four with too little data
euMain <- euMain[euMain$Fish %in% fisl , ] # Remove four with too little data


eut <- eu
euRatio <- euMain[
eut@output <- eut@output[
   euMain$Congener == "2378TCDD" & euMain$Matrix == "Muscle" & result(euMain) != 0 , ] # Zeros cannot be used in ratio estimates
   eut@output$Congener == "2378TCDD" & eut@output$Matrix == "Muscle" & result(eut) != 0 , ] # Zeros cannot be used in ratio estimates
euRatio$Congener <- NULL
eut@output$Congener <- NULL
euRatio <- log10(euMain / euRatio)@output
eut@marginal[colnames(eut@output) == "Congener"] <- NULL
euRatio <- euRatio[euRatio$Congener %in% setdiff(conl, "2378TCDD") , ]
eut <- log10(eu / eut)@output
conl <- conl[conl != "2378TCDD"]
eut <- eut[eut$Congener %in% conl , ]


# Analysis: a few rows disappear here, as shown by numbers per fish species. Why?
# Analysis: a few rows disappear here, as shown by numbers per fish species. Why?
Line 113: Line 143:
# Conclusion: this is ok. Total 2292 rows.
# Conclusion: this is ok. Total 2292 rows.


ggplot(eu@output, aes(x = euResult, colour = Fish))+geom_density()+
ggplot(euAll@output, aes(x = euAllResult, colour = Fish))+geom_density()+
   facet_wrap(~ Congener) + scale_x_log10()
   facet_wrap(~ Compound) + scale_x_log10()


ggplot(eut, aes(x = Result, colour = Fish))+geom_density()+
ggplot(euRatio, aes(x = Result, colour = Fish))+geom_density()+
   facet_wrap(~ Congener)  
   facet_wrap(~ Compound)  


objects.store(eu,eut)
objects.store(euAll, euMain, euRatio)
cat("Ovariable eu and data.frame eut stored.\n")
cat("Ovariables euAll and euMain, and data.frame eutRatio stored.\n")
</rcode>
</rcode>


Line 155: Line 185:
# cong_j depends on fish species.
# cong_j depends on fish species.


if(FALSE) { # Multicongener model NOT updated to reflect new names: eu -> euMain
conl <- as.character(unique(eu@output$Congener))
conl <- as.character(unique(eu@output$Congener))
fisl <- sort(as.character(unique(eu@output$Fish)))
fisl <- sort(as.character(unique(eu@output$Fish)))
Line 168: Line 199:
   timevar = "Congener",  
   timevar = "Congener",  
   drop = c("Matrix", "euSource"),  
   drop = c("Matrix", "euSource"),  
  direction = "wide"
)
# Find the level of quantification for dinterval function
LOQ <- unlist(lapply(fishsamples[3:ncol(fishsamples)], FUN = function(x) min(x[x!=0])))
names(LOQ) <- conl
cong <- data.matrix(fishsamples[3:ncol(fishsamples)])
cong <- sapply(1:length(LOQ), FUN = function(x) ifelse(cong[,x]==0, 0.5*LOQ[x], cong[,x]))
mod <- textConnection("
  model{
    for(i in 1:S) { # s = fish sample
      #        below.LOQ[i,j] ~ dinterval(-cong[i,j], -LOQ[j])
      cong[i,1:C] ~ dmnorm(mu[fis[i],], Omega[fis[i],,])
    }
    for(i in 1:Fi) { # Fi = fish species
      for(j in 1:C) {
        mu[i,j] ~ dnorm(mu1[j], tau1[j])
      }
      Omega[i,1:C,1:C] ~ dwish(Omega0[1:C,1:C],S)
      pred[i,1:C] ~ dmnorm(mu[i,], Omega[i,,]) # Model prediction
    }
    for(i in 1:C) { # C = Compound
      mu1[i] ~ dnorm(0, 0.0001)
      tau1[i] ~ dunif(0,10000)
      pred1[i] ~ dnorm(mu1[i], tau1[i])
    }
    Omega1[1:C,1:C] ~ dwish(Omega0[1:C,1:C],S)
  }
")
jags <- jags.model(
  mod,
  data = list(
    S = nrow(fishsamples),
    C = C,
    Fi = Fi,
    cong = log(cong),
    #    LOQ = LOQ,
    #    below.LOQ = is.na(cong)*1,
    fis = match(fishsamples$Fish, fisl),
    Omega0 = diag(C)/100000
  ),
  n.chains = 4,
  n.adapt = 100
)
} # if(FALSE)
conl <- c("TEQdx", "TEQpcb")
fisl <- sort(as.character(unique(euMain$Fish))) # Take only the main fish species
C <- length(conl)
Fi <- length(fisl)
N <- 1000
conl
fisl
fishsamples <- euAll@output[euAll$Compound %in% conl , ]
fishsamples <- reshape(
  fishsamples,
  v.names = "euAllResult",
  idvar = "THLcode",
  timevar = "Compound",
  drop = c("Matrix", "euRawSource"),
   direction = "wide"
   direction = "wide"
)
)

Revision as of 13:51, 22 May 2017


EU-kalat is a study, where concentrations of PCDD/Fs, PCBs, PBDEs and heavy metals have been measured from fish

Question

The scope of EU-kalat study was to measure concentrations of persistent organic pollutants (POPs) including dioxin (PCDD/F), PCB and BDE in fish from Baltic sea and Finnish inland lakes and rivers. [1] [2] [3].

Answer

The original sample results can be acquired from Opasnet base. The study showed that levels of PCDD/Fs and PCBs depends especially on the fish species. Highest levels were on salmon and large sized herring. Levels of PCDD/Fs exceeded maximum level of 4 pg TEQ/g fw multiple times. Levels of PCDD/Fs were correlated positively with age of the fish.

Mean congener concentrations as WHO2005-TEQ in Baltic herring can be printed out with the Run code below.

+ Show code

Rationale

Data

Data was collected between 2009-2010. The study contains years, tissue type, fish species, and fat content for each concentration measurement. Number of observations is 285.

There is a new study EU-kalat 3, which will produce results in 2016.

Calculations

+ Show code

Bayes model for dioxin concentrations

  • Model run 28.2.2017 [6]
  • Model run 28.2.2017 with corrected survey model [7]
  • Model run 28.2.2017 with Mu estimates [8]
  • Model run 1.3.2017 [9]
  • Model run 23.4.2017 [10] produces list conc.param and ovariable concentration
  • Model run 24.4.2017 [11]
  • Model run 19.5.2017 without ovariable concentration [12] ⇤--#: . The model does not mix well, so the results should not be used for final results. --Jouni (talk) 19:37, 19 May 2017 (UTC) (type: truth; paradigms: science: attack)
----#: . Maybe we should just estimate TEQs until the problem is fixed. --Jouni (talk) 19:37, 19 May 2017 (UTC) (type: truth; paradigms: science: comment)

+ Show code

Initiate concentration

  • Model run 19.5.2017 [13]

+ Show code

See also

References

  1. A. Hallikainen, H. Kiviranta, P. Isosaari, T. Vartiainen, R. Parmanne, P.J. Vuorinen: Kotimaisen järvi- ja merikalan dioksiinien, furaanien, dioksiinien kaltaisten PCB-yhdisteiden ja polybromattujen difenyylieettereiden pitoisuudet. Elintarvikeviraston julkaisuja 1/2004. [1]
  2. E-R.Venäläinen, A. Hallikainen, R. Parmanne, P.J. Vuorinen: Kotimaisen järvi- ja merikalan raskasmetallipitoisuudet. Elintarvikeviraston julkaisuja 3/2004. [2]
  3. Anja Hallikainen, Riikka Airaksinen, Panu Rantakokko, Jani Koponen, Jaakko Mannio, Pekka J. Vuorinen, Timo Jääskeläinen, Hannu Kiviranta. Itämeren kalan ja muun kotimaisen kalan ympäristömyrkyt: PCDD/F-, PCB-, PBDE-, PFC- ja OT-yhdisteet. Eviran tutkimuksia 2/2011. ISSN 1797-2981 ISBN 978-952-225-083-4 [3]