The objectives of this analyses is to determine factors affecting the prevalence and infection intensity of the exotic pathogen Bonamia ostreae on the NZ native flat oyster (Ostrea chilensis).
Code
library(tidyverse)library(readxl)library(knitr)library(janitor)library(sjPlot)library(DHARMa)library(broom)library(ggfortify)theme_set(theme_minimal())d <-read_excel('Bonamia results for Javier formatted for R.xlsx', 1) %>%mutate(PCROs =factor(PCROs),Cohort =factor(Cohort),APX =factor(APX),Bucephalus =if_else(is.na(Buc), 0, 1))vars <-read_excel('Bonamia results for Javier formatted for R.xlsx', 2)
2 Cohort size
Cohort 1 was smaller than Cohort 2 (mean 62.4 mm ± 7.1 S.D. and 69.3 mm ± 8.4, respectively, Table 1 and Figure 1) and this difference was significant (t-test, t = - 4.26, p<0.001, Table 2).
Table 2: Results of t-test comparing mean oyster size between cohorts
estimate
estimate1
estimate2
statistic
p.value
parameter
conf.low
conf.high
method
alternative
-6.92
62.4
69.3
-4.26
5.41e-05
81.2
-10.1
-3.69
Welch Two Sample t-test
two.sided
3 Prevalence of Bonamia, Bucephalus and APX by Cohort
Code
read_excel('Bonamia results for Javier formatted for R.xlsx', 1) %>%mutate(Bucephalus =if_else(is.na(Buc), 0, 1)) %>%pivot_longer(cols =c(PCROs, APX, Bucephalus)) %>%mutate(name =fct_recode(name, `Bonamia ostreae`="PCROs")) %>%ggplot() +geom_bar(aes(x =factor(Cohort), fill =factor(value)),alpha =0.6,color ='gray20',position ='fill') +labs(x ="Cohort", y =NULL) +scale_fill_discrete(name =NULL ) +scale_y_continuous(labels = scales::percent_format(accuracy =1)) +facet_wrap(~fct_rev(name))
Figure 2: Barplot of prevalence of Bonamia ostraea, APX and Bucephalus in relation to cohort
Figure 2 shows that the prevalence of all three parasites was much higher in cohort 2 compared to cohort 1.
Fisher’s exact test was used to determine if there were an association between parasite prevalence and cohort. It is similar to chi-square test, however the Fisher’s test runs an exact procedure especially for small-sized samples, rather than an approximation assuming a large sample size.
Table 3: Results of the Fisher’s extact test to test the association between the prevalence of B.ostreae, Bucephalus and APX in relation to cohort’
Parasite
estimate
p.value
conf.low
conf.high
APX
29.0
0.000002
4.27
1240
Bucephalus
10.2
0.008110
1.42
449
B.ostreae
44.1
0.000000
11.60
220
The Fisher;’ exact test confirmed that the differences in prevalence between cohorts were highly significant for all three parasites (p<0.001, Table 3).
4 Logistic regression
Due to the binary nature of the prevalence data (i.e. presence/absence) logistic regression was used to test the effect of cohort, the prevalence of other parasites and % gonadal area. Logistic regression allows to test for for several factor simultaneously and their potential interactions (e.g. Cohort dependent effects of the prevalence of other parasite). In addition, it allows to control for the effects of continuous covariates (e.g. percent gonadal area). Logistic regression models were fitted with cohort and the prevalence of other parasites as a fixed effects with two levels each. The interaction between Cohort and the prevalence of other parasites was also included to test for potential cohort dependant effects. Percentage gonadal areas was fitted as a continuous variable to control for its potential effect on B. ostrae prevalence. The regression coefficients are presented as odds ratios (exponentiated coefficients) that are interpreted as the ratio of the probability of a infection event and the probability of the no infection.
5Bonamia ostreae prevalence
Table 4 and Figure 3 show the frequency of Bonamia ostreae prevalence in relation to Cohort and APX
5.1 Data exploration
Code
d %>%group_by(Cohort, APX) %>%count(PCROs, name ="Frequency") %>%kable()
Table 4: Frequency of Bonamia ostreae prevalence in relation to Cohort and APX.
Table 6: Results of the final (most parsimonious) logistic regression model.
PCR Os
Predictors
Odds Ratios
CI
p
(Intercept)
0.30
0.13 – 0.62
0.003
Cohort [2]
47.25
14.41 – 195.79
<0.001
Observations
95
R2 Tjur
0.526
Table 6 shows that the most parsimonious model only retained the effect of Cohort (p<0.001). The model predicted that the odds of having B. ostrae are 47 times higher for cohort 2 compared to cohort 1.
5.4 Model validation
Code
simulationOutput <-simulateResiduals(fittedModel = m_bonamia_final)plot(simulationOutput, quantreg =FALSE, title =NULL)
Figure 5: Logistic regression model validation
The model was validated by inspecting simulated residuals. Figure 5 shows that the model assumptions were met (over-dispersion and homogeneity of variance).
Table 7: Results of the logistic regression testing the effects of cohort, Bonamia ostreae, Bucephalus and % gonadal area on the prevalence of APX.
APX
Predictors
Odds Ratios
CI
p
(Intercept)
0.12
0.01 – 0.74
0.055
Cohort [2]
26.30
4.93 – 490.00
0.002
% gonadal area
0.96
0.93 – 0.99
0.009
Observations
95
R2 Tjur
0.314
Table 7 shows that the most parsimonious model retained the effect of Cohort (p<0.01) and gonadal area (p<0.01). The model predicted that the odds of having B. ostrae are 26 times higher for cohort 2 compared to cohort 1 and that larger gonadal area slightly reduced the odds of infection (p<0.01).
6.2 Model validation
Code
simulationOutput_apx <-simulateResiduals(fittedModel = m_apx_final)plot(simulationOutput_apx, quantreg =FALSE, title =NULL)
Figure 6: APX logistic regression model validation
The model was validated by inspecting simulated residuals. Figure 6 shows that the model assumptions were met (over-dispersion and homogeneity of variance).
Table 8: Results of the logistic regression testing the effects of cohort, Bonamia ostreae, APX and % gonadal area on the prevalence of Bucephalus
factor(Bucephalus)
Predictors
Odds Ratios
CI
p
(Intercept)
0.57
0.03 – 5.56
0.641
Cohort [2]
21.32
1.60 – 673.49
0.037
% gonadal area
0.85
0.77 – 0.91
<0.001
Observations
95
R2 Tjur
0.677
Table 8 shows that the most parsimonious model retained the effect of Cohort (p<0.05) and gonadal area (p<0.001). The model predicted that the odds of having B. ostrae are 21 times higher for cohort 2 compared to cohort 1 and that larger gonadal area slightly reduced the odds of infection (p<0.001).
Note the full model summary is not presented for the sake of brevity.
7.2 Model validation
Code
simulationOutput_buc <-simulateResiduals(fittedModel = m_buc_final)plot(simulationOutput_buc, quantreg =FALSE, title =NULL)
Figure 7: Logistic regression model validation
The model was validated by inspecting simulated residuals. Figure 5 shows that the model assumptions were met (over-dispersion and homogeneity of variance).
WholeGrade data was filtered by `Useable for bonamia intensity`. Figure 8 show the distribution of Bonamia intensity is quite uniform across the observed range (0 - 3). It also shows that some oysters that tested positive did not show histological symptoms (i.e. WholeGrade zero).
Code
d1 <- d %>% dplyr::filter(`Useable for bonamia intensity`=="1") %>%mutate(Cohort =factor(Cohort),APX =factor(APX),Bucephalus =if_else(is.na(Buc), 0, 1))ggplot(d1, aes(WholeGrade, fill = PCROs)) +geom_histogram()
Figure 8: Histogram of Bonamia intensity
Figure 9 shows that intensity was larger in Cohort two but did not varied considerably with the presence of APX Figure 9 (a) and BucephalusFigure 9 (b)
Figure 10: Scatterplot of % gonaldal area vs. infection intensity
9.1 Linear model
A linear model was used to test the effect of cohort, the prevalence of APX and % gonadal area. Cohort and APX were fitted as a fixed effects with two levels each. Percentage gonadal areas was fitted as a continuous variable to control for its potential effect on B. ostrae prevalence.
Table 9: Results of the full linear model to test differences in infection intensity
log(Whole Grade+0.1)
Predictors
Estimates
CI
p
(Intercept)
-1.83
-2.85 – -0.81
0.001
Cohort [2]
1.58
0.85 – 2.30
<0.001
APX [1]
-0.08
-0.75 – 0.59
0.811
% gonadal area
-0.00
-0.03 – 0.02
0.764
Bucephalus
0.16
-0.86 – 1.18
0.760
Observations
78
R2 / R2 adjusted
0.251 / 0.210
Table 9 show that there was a significant effect of Cohort on infection intensity (p<0.001), whereas APX, Bucephalus and percentage gonadal area had no effect (p>0.75).
9.2 Model selection
The model was selected using a stepwise procedure based on the AIC. The most parsimonious model only included the effect of Cohort (Table 10). The model predicted a significant increase in infection intensity for oysters in Cohort 2.
Code
lm2 <-step(lm1, trace = F)tab_model(lm2)
Table 10: Results of the final linear model to test differences in infection intensity
log(Whole Grade+0.1)
Predictors
Estimates
CI
p
(Intercept)
-1.94
-2.50 – -1.38
<0.001
Cohort [2]
1.58
0.94 – 2.21
<0.001
Observations
78
R2 / R2 adjusted
0.244 / 0.234
9.3 Model validation
The model was validated by inspecting model residuals, that showed that model assumptions were reasonably met (Figure 11).
Oysters from Cohort 1 were significantly smaller than those from Cohort 2.
The prevalence of all three parasites, namely B. ostraea, APX and Bucephalus, was significantly higher in Cohort 2 compared to Cohort 1.
The prevalence of APX and Bucephalus was slightly but significantly reduced in oyster with increasing percentage gonadal area.
There was no significant effect of other parasites on all three parasite prevalence.
Infection intensity of B. ostraea followed the same pattern as prevalence , i.e. there was a significant Cohort effect but no effect of APX or gonadal area was detected.