Title: | Analysis of Plant Pathogen Pathotype Complexities, Distributions and Diversity |
Version: | 3.1.12 |
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. |
License: | MIT + file LICENSE |
URL: | https://github.com/openplantpathology/hagis, https://openplantpathology.github.io/hagis/ |
BugReports: | https://github.com/openplantpathology/hagis/issues |
Depends: | R (≥ 3.4.0) |
Imports: | data.table, ggplot2, pander, stats, utils |
Suggests: | ape, dplyr, knitr, rmarkdown, roxyglobals, testthat, vdiffr, vegan |
VignetteBuilder: | knitr |
Config/roxyglobals/filename: | globals.R |
Config/roxyglobals/unique: | FALSE |
Encoding: | UTF-8 |
Language: | en-US |
LazyData: | true |
RoxygenNote: | 7.3.1 |
X-schema.org-applicationCategory: | Tools |
X-schema.org-isPartOf: | https://openplantpathology.org |
X-schema.org-keywords: | plant-pathology, pathotype, pathogen-survey, virulence analysis, differential set, assessment scale |
NeedsCompilation: | no |
Packaged: | 2024-05-16 12:59:03 UTC; 283204f |
Author: | Austin G. McCoy |
Maintainer: | Adam H. Sparks <adamhsparks@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-05-16 13:10:03 UTC |
hagis: 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.
Author(s)
Maintainer: Adam H. Sparks adamhsparks@gmail.com (ORCID)
Authors:
Austin G. McCoy mccoyaus@msu.edu (ORCID) [conceptor]
Zachary Noel noelzach@msu.edu (ORCID) [conceptor]
Martin Chilvers chilvers@msu.edu (ORCID) [thesis advisor]
Jari Oksanen jhoksane@gmail.com (Contributed fix for the use of 'vegan' in betadiversity vignette.)
Other contributors:
Zhian N. Kamvar (ORCID) [contributor, reviewer]
Michigan Soybean Promotion Committee [funder]
Project GREEEN [funder]
North Central Soybean Research Program [funder]
GRDC Project DAQ00186 [funder]
See Also
Useful links:
Report bugs at https://github.com/openplantpathology/hagis/issues
Phytophthora sojae Survey Example Data
Description
Data from a Phytophthora sojae survey
Usage
data(P_sojae_survey)
Format
An object of class data.table
with 294 observations of 12 variables
- Isolate
P. sojae isolate identifier
- Line
Soybean cultivar
- Rps
Rps gene identifier
- Total
Total number of plants inoculated
- HR (1)
Number of plants that exhibit a hypersensitive response after inoculation
- Lesion (2)
Number of plants that develop a lesion at inoculation site
- Lesion to cotyledon (3)
Number of plants that develop a lesion, which advances to the hypocotyl of the seedling after infection
- Dead (4)
Number of dead plants that are observed after inoculation
- total.susc
The total number of susceptible plants (Lesion+Lesion to cotyledon+Dead)
- total.resis
The total number of resistant plants (equal to HR value)
Source
Data from an ongoing 2017 Phytophthora sojae survey in Michigan, conducted by A. G. McCoy et al..
Examples
data(P_sojae_survey)
P_sojae_survey
Plot hagis Complexities Objects
Description
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()
.
Usage
## S3 method for class 'hagis.complexities'
autoplot(object, type, color = NULL, order = NULL, ...)
Arguments
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 |
Value
A ggplot2 object
Examples
# 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")
Plot hagis Summary Objects
Description
Creates a ggplot2 object of the gene summaries
calculated by summarize_gene()
Usage
## S3 method for class 'hagis.gene.summary'
autoplot(object, type, color = NULL, order = NULL, ...)
Arguments
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 |
Value
A ggplot2 plot
Examples
# 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 Distribution of Complexities by Sample
Description
Calculate the distribution of susceptibilities by sample id.
Usage
calculate_complexities(x, cutoff, control, sample, gene, perc_susc)
Arguments
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.
|
Value
An object of class hagis.complexities
.
An object of class hagis.complexities
is a list
containing the following
components
- grouped_complexities
a
data.table::data.table()
object of grouped complexities- individual_complexities
a
data.table::data.table()
object of individual complexities
Examples
# 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 Diversities Indices
Description
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:
D = \frac{Np}{Ns}
where
Np
is the number of pathotypes andNs
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.
D = \frac{ (Np - 1) }{ log(Ns)}
Where
Np
is the number of pathotypes andNs
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.
D = -\sum_{i = 1}^{R} p_i \log p_i
Where
p_i
is the proportional abundance of speciesi
.Simpson diversity index values range from 0 to 1, 1 represents high diversity and 0 represents no diversity. Where diversity is calculated as:
D = \sum_{i = 1}^{R} p_i^2
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:
D = \frac{H'}{log(Np) }
where
H'
is the Shannon diversity index andNp
is the number of pathotypes.
Usage
calculate_diversities(x, cutoff, control, sample, gene, perc_susc)
Arguments
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.
|
Value
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
Examples
# 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
Create Binary Data Matrix From Pathotype Data
Description
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.
Usage
create_binary_matrix(x, cutoff, control, sample, gene, perc_susc)
Arguments
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.
|
Value
a binary matrix of pathotype data
Examples
# 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
Custom Print for hagis Diversities Tables
Description
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.
Usage
diversities_table(x, ...)
Arguments
x |
a |
... |
other arguments passed to |
Value
A pander object of diversities
See Also
calculate_diversities()
, individual_pathotypes()
Examples
# 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)
Prints Individual Pathotypes for Each Sample
Description
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.
Usage
individual_pathotypes(x, ...)
Arguments
x |
a |
... |
other arguments passed to |
Value
A pander object of individual pathotypes
See Also
calculate_diversities()
, diversities_table()
Examples
# 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)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- ggplot2
Phytophthora sojae Survey Example Metadata
Description
Metadata to accompany internal data from a Phytophthora sojae survey used for an example in the "Beta-diversity Analyses" vignette.
Usage
data(sample_meta)
Format
An object of class data.frame
with 21 observations of 2 variables
- Sample
P. sojae sample identifier
- Locale
US State where sample was collected, limited to Michigan
Source
Data from an ongoing 2017 Phytophthora sojae survey in Michigan, conducted by A. G. McCoy et al..
Examples
data(sample_meta)
sample_meta
Calculate and Summarize Distribution of Susceptibilities by Gene
Description
Calculate the distribution of susceptibilities by gene.
Usage
summarize_gene(x, cutoff, control, sample, gene, perc_susc)
Arguments
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.
|
Value
a hagis.gene.summary
object.
An object of class hagis.gene.summary
is a
data.table::data.table()
containing the following components columns
- gene
the gene
- N_virulent_isolates
the total number virulent isolates for a given gene in the
gene
column- percent_pathogenic
the frequency with which a gene is pathogenic
Examples
# 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