Title: | Analysis of Plant Pathogen Pathotype Complexities, Distributions and Diversity |
---|---|
Description: | Analysis of plant pathogen pathotype survey data. Functions provided calculate distribution of susceptibilities, distribution of complexities with statistics, pathotype frequency distribution, as well as diversity indices for pathotypes. This package is meant to be a direct replacement for Herrmann, Löwer and Schachtel's (1999) <doi:10.1046/j.1365-3059.1999.00325.x> Habgood-Gilmour Spreadsheet, 'HaGiS', previously used for pathotype analysis. |
Authors: | Austin G. McCoy [aut, ccp] |
Maintainer: | Adam H. Sparks <[email protected]> |
License: | MIT + file LICENSE |
Version: | 4.0.0 |
Built: | 2025-02-05 05:20:38 UTC |
Source: | https://github.com/openplantpathology/hagis |
Creates a ggplot2 object of the frequency of
complexity (percent per complexity) or a ggplot2 object of the
distribution (number per complexity) calculated by
calculate_complexities()
.
## S3 method for class 'hagis.complexities' autoplot(object, type, color = NULL, order = NULL, ...)
## S3 method for class 'hagis.complexities' autoplot(object, type, color = NULL, order = NULL, ...)
object |
a hagis |
type |
a vector of values for which the bar plot is desired. Specify
whether to return a graph of the frequency of complexities as a percentage,
" |
color |
a named or hexadecimal color value to use for the bar color |
order |
sort the x-axis of the bar chart by ascending or descending
order of |
... |
passed to the chosen |
A ggplot2 object
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) # calculate susceptibilities with a 60 % cutoff value complexities <- calculate_complexities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # Visualize the distribution (count or actual values) autoplot(complexities, type = "count") # Visualize the frequency (percentages) autoplot(complexities, type = "percentage")
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) # calculate susceptibilities with a 60 % cutoff value complexities <- calculate_complexities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # Visualize the distribution (count or actual values) autoplot(complexities, type = "count") # Visualize the frequency (percentages) autoplot(complexities, type = "percentage")
Creates a ggplot2 object of the gene summaries
calculated by summarize_gene()
## S3 method for class 'hagis.gene.summary' autoplot(object, type, color = NULL, order = NULL, ...)
## S3 method for class 'hagis.gene.summary' autoplot(object, type, color = NULL, order = NULL, ...)
object |
a |
type |
a vector of values for which the bar plot is desired. Specify
whether to return a graph of the percent pathogenic isolates, |
color |
a named or hexadecimal color value to use for the bar color |
order |
sort the x-axis of the bar chart by ascending or descending
order of |
... |
passed to the chosen |
A ggplot2 plot
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) # calculate susceptibilities with a 60 % cutoff value susc <- summarize_gene( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # Visualize the summary of genes autoplot(susc, type = "percentage")
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) # calculate susceptibilities with a 60 % cutoff value susc <- summarize_gene( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # Visualize the summary of genes autoplot(susc, type = "percentage")
Calculate the distribution of susceptibilities by sample id.
calculate_complexities(x, cutoff, control, sample, gene, perc_susc)
calculate_complexities(x, cutoff, control, sample, gene, perc_susc)
x |
a |
cutoff |
value for percent susceptible cutoff. |
control |
value used to denote the susceptible control in the |
sample |
column providing the unique identification for each sample
being tested. |
gene |
column providing the gene(s) being tested. |
perc_susc |
column providing the percent susceptible reactions.
|
An object of class hagis.complexities
.
An object of class hagis.complexities
is a list
containing the following
components
a data.table::data.table()
object of
grouped complexities
a data.table::data.table()
object of
individual complexities
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value complexities <- calculate_complexities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) complexities summary(complexities)
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value complexities <- calculate_complexities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) complexities summary(complexities)
Calculate five pathogen diversity indices.
Diversity indices include:
Simple diversity index, which will show the proportion of unique pathotypes to total samples. As the values gets closer to 1, there is greater diversity in pathoypes within the population. Simple diversity is calculated as:
where is the number of pathotypes and
is the number of
samples.
Gleason diversity index, an alternate version of Simple diversity index, is less sensitive to sample size than the Simple index.
Where is the number of pathotypes and
is the number of
samples.
Shannon diversity index is typically between 1.5 and 3.5, as richness and evenness of the population increase, so does the Shannon index value.
Where
is the proportional abundance of species
.
Simpson diversity index values range from 0 to 1, 1 represents high diversity and 0 represents no diversity. Where diversity is calculated as:
Evenness ranges from 0 to 1, as the Evenness value approaches 1, there is a more even distribution of each pathoype's frequency within the population. Where Evenness is calculated as:
where is the Shannon diversity index and
is the number
of pathotypes.
calculate_diversities(x, cutoff, control, sample, gene, perc_susc)
calculate_diversities(x, cutoff, control, sample, gene, perc_susc)
x |
a |
cutoff |
value for percent susceptible cutoff. |
control |
value used to denote the susceptible control in the |
sample |
column providing the unique identification for each sample
being tested. |
gene |
column providing the gene(s) being tested. |
perc_susc |
column providing the percent susceptible reactions.
|
A hagis.diversities
object.
A hagis.diversities
object is a list
containing:
Number of Samples
Number of Pathotypes
Simple Diversity Index
Gleason Diversity Index
Shannon Diversity Index
Simpson Diversity Index
Evenness Diversity Index
# Using the built-in data set, P_sojae_survey data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value diversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) diversities
# Using the built-in data set, P_sojae_survey data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value diversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) diversities
Creates a binary data matrix from pathotype data representing the pathotype of each isolate. This binary data matrix can be used to visualize beta-diversity of pathotypes using vegan and ape.
create_binary_matrix(x, cutoff, control, sample, gene, perc_susc)
create_binary_matrix(x, cutoff, control, sample, gene, perc_susc)
x |
a |
cutoff |
value for percent susceptible cutoff. |
control |
value used to denote the susceptible control in the |
sample |
column providing the unique identification for each sample
being tested. |
gene |
column providing the gene(s) being tested. |
perc_susc |
column providing the percent susceptible reactions.
|
a binary matrix of pathotype data
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value final_matrix <- create_binary_matrix(x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc") final_matrix
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value final_matrix <- create_binary_matrix(x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc") final_matrix
Print the frequency table of diversities from a hagis.diversities
object
The resulting object is a pander table (a text object for Markdown) for
ease of use in reporting and viewing in the console.
diversities_table(x, ...)
diversities_table(x, ...)
x |
a |
... |
other arguments passed to |
A pander object of diversities
calculate_diversities()
, individual_pathotypes()
# Using the built-in data set, P_sojae_survey data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value diversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # print the diversities table diversities_table(diversities)
# Using the built-in data set, P_sojae_survey data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value diversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # print the diversities table diversities_table(diversities)
Print an object from a hagis.diversities
object with individual pathotypes,
i.e. each sample's pathotype. The resulting object is a pander table
(a text object for Markdown) for ease of use in reporting and viewing in the
console.
individual_pathotypes(x, ...)
individual_pathotypes(x, ...)
x |
a |
... |
other arguments passed to |
A pander object of individual pathotypes
calculate_diversities()
, diversities_table()
# Using the built-in data set, P_sojae_survey data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value diversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # print the diversities table individual_pathotypes(diversities)
# Using the built-in data set, P_sojae_survey data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value diversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) # print the diversities table individual_pathotypes(diversities)
Data from a Phytophthora sojae survey
data(P_sojae_survey)
data(P_sojae_survey)
An object of class data.table
with 294 observations of 12
variables
P. sojae isolate identifier
Soybean cultivar
Rps gene identifier
Total number of plants inoculated
Number of plants that exhibit a hypersensitive response after inoculation
Number of plants that develop a lesion at inoculation site
Number of plants that develop a lesion, which advances to the hypocotyl of the seedling after infection
Number of dead plants that are observed after inoculation
The total number of susceptible plants (Lesion+Lesion to cotyledon+Dead)
The total number of resistant plants (equal to HR value)
Data from an ongoing 2017 Phytophthora sojae survey in Michigan, conducted by A. G. McCoy et al..
data(P_sojae_survey) P_sojae_survey
data(P_sojae_survey) P_sojae_survey
Metadata to accompany internal data from a Phytophthora sojae survey used for an example in the "Beta-diversity Analyses" vignette.
data(sample_meta)
data(sample_meta)
An object of class data.frame
with 21 observations of 2 variables
P. sojae sample identifier
US State where sample was collected, limited to Michigan
Data from an ongoing 2017 Phytophthora sojae survey in Michigan, conducted by A. G. McCoy et al..
data(sample_meta) sample_meta
data(sample_meta) sample_meta
Calculate the distribution of susceptibilities by gene.
summarize_gene(x, cutoff, control, sample, gene, perc_susc)
summarize_gene(x, cutoff, control, sample, gene, perc_susc)
x |
a |
cutoff |
value for percent susceptible cutoff. |
control |
value used to denote the susceptible control in the |
sample |
column providing the unique identification for each sample
being tested. |
gene |
column providing the gene(s) being tested. |
perc_susc |
column providing the percent susceptible reactions.
|
a hagis.gene.summary
object.
An object of class hagis.gene.summary
is adata.table::data.table()
containing the following components columns
the gene
the total number virulent isolates for a
given gene in the gene
column
the frequency with which a gene is pathogenic
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value susc <- summarize_gene( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) susc
# Using the built-in data set, `P_sojae_survey` data(P_sojae_survey) P_sojae_survey # calculate susceptibilities with a 60 % cutoff value susc <- summarize_gene( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc" ) susc