knitr::opts_chunk$set(echo = TRUE, warning = FALSE)

Import Data

library(tidyverse)
library(readxl)
library(janitor)

fhb_spe1<- read_excel("data/dat-isolates.xlsx")

Toxin type frequency

## Frequency of genotypes

fhb_spe1 %>% 
  filter(tri!="NA",
         year!="2012") %>% 
  tabyl(tri) 
### 2018

tri_2018 <- fhb_spe1 %>%
  filter(year =="2018") %>% 
  filter(tri!="NA")

tri_2018 %>%
  tabyl(location, tri, year) 
## $`2018`
##   location 15ADON 3ADON NIV
##  Armstrong     25     2   1
##     Centre    156     5   0
##  Lancaster     35     0   0
##    Lebanon      3     0   0
##     Potter      7     6   2
##      Tioga     32     3   0
##       York     34     0   0
### 2019

tri_2019 <- fhb_spe1 %>%
  filter(year =="2019") %>% 
  filter(tri!="NA")

tri_2019 %>%
  tabyl(location, tri, year) 
## $`2019`
##   location 15ADON 3ADON NX-2
##     Centre     14     0    0
##   Crawford      3     0    0
##       Erie     11     0    0
##  Lancaster     38     0    0
##    Lebanon     30     1    1
##     Potter      5     0    0
### 2012

tri_2012 <- fhb_spe1 %>%
  filter(year =="2012") %>% 
  filter(tri!="NA")

tri_2012 %>%
  tabyl(year, tri) 

Independence tests

Toxin type vs. Year

tri_year <- fhb_spe1 %>% 
  filter(tri!="NA",
         year!="2012") %>% 
  tabyl(tri, year) 

fisher.test(tri_year, simulate.p.value = TRUE)
## 
##  Fisher's Exact Test for Count Data with simulated p-value
##  (based on 2000 replicates)
## 
## data:  tri_year
## p-value = 0.05347
## alternative hypothesis: two.sided
# No significant association between trichothecene genotype and year of sampling.

Toxin type vs. location - 2018

tri_county_2018 <- fhb_spe1 %>% 
  filter(year == "2018") %>%
  filter(tri!="NA") %>%
  tabyl(county, tri)

fisher.test(tri_county_2018, simulate.p.value = TRUE)
## 
##  Fisher's Exact Test for Count Data with simulated p-value
##  (based on 2000 replicates)
## 
## data:  tri_county_2018
## p-value = 0.0004998
## alternative hypothesis: two.sided
# Significant association between trichothecene genotype and sampled location in 2018. 

Toxin type vs. location - 2019

tri_county_2019 <- fhb_spe1 %>% 
  filter(year == "2019") %>%
  filter(tri!="NA") %>%
  tabyl(county, tri)

fisher.test(tri_county_2019, simulate.p.value = TRUE)
## 
##  Fisher's Exact Test for Count Data with simulated p-value
##  (based on 2000 replicates)
## 
## data:  tri_county_2019
## p-value = 0.6447
## alternative hypothesis: two.sided
# No significant association between trichothecene genotype and sampled location in 2019. 

Toxin type vs. host - 2018

host_tri_2018 <- fhb_spe1 %>%
  filter(year == "2018") %>%
  filter(tri!="NA") %>%
  tabyl(crop, tri)


chisq.test(host_tri_2018)
## 
##  Pearson's Chi-squared test
## 
## data:  host_tri_2018
## X-squared = 2.9445, df = 2, p-value = 0.2294
fisher.test(host_tri_2018, simulate.p.value = TRUE)
## 
##  Fisher's Exact Test for Count Data with simulated p-value
##  (based on 2000 replicates)
## 
## data:  host_tri_2018
## p-value = 0.2414
## alternative hypothesis: two.sided
# No significant association between trichothecene genotype and sampled host in 2018. 

Toxin type vs. host - 2019

host_tri_2019 <- fhb_spe1 %>%
  filter(year == "2019") %>%
  filter(tri!="NA") %>%
  tabyl(crop, tri)


fisher.test(host_tri_2019, simulate.p.value = TRUE)
## 
##  Fisher's Exact Test for Count Data with simulated p-value
##  (based on 2000 replicates)
## 
## data:  host_tri_2019
## p-value = 1
## alternative hypothesis: two.sided
# No significant association between trichothecene genotype and sampled host in 2019. 

FGSC frequency

## Frequency of FGSC members

fhb_spe1 %>% 
  filter(Fg_16!="NA") %>% 
  tabyl(Fg_16)
### 2018

spc_2018 <- fhb_spe1 %>%
  filter(Fg_16!="NA") %>% 
  filter(year =="2018")

spc_2018 %>%
  tabyl(Fg_16)
### 2019

spc_2019 <- fhb_spe1 %>%
  filter(Fg_16!="NA") %>% 
  filter(year =="2019")

spc_2019 %>%
  tabyl(Fg_16)

Non-FGSC frequency

## TEF gene

fhb_spe1 %>%
  filter(year!="2012",
         TEF!="NA"  ,
         TEF!="Fusarium graminearum",
         TEF!="Unidentified") %>%
  tabyl(TEF)
Copyright 2020 Maira R. Duffeck