| Title: | Analysis of Plant Pathogen Pathotype Complexities, Distributionsand Diversity |
| Version: | 4.0.0 |
| 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/Needs/build: | moodymudskipper/devtag |
| Config/roxyglobals/filename: | globals.R |
| Config/roxyglobals/unique: | FALSE |
| Encoding: | UTF-8 |
| Language: | en-US |
| LazyData: | true |
| RoxygenNote: | 7.3.2.9000 |
| 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: | 2025-07-26 03:58:08 UTC; adamsparks |
| Author: | Austin G. McCoy |
| Maintainer: | Adam H. Sparks <adamhsparks@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2025-07-26 04:20:02 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. Sparksadamhsparks@gmail.com (ORCID)
Authors:
Austin G. McCoymccoyaus@msu.edu (ORCID) [conceptor]
Zachary Noelnoelzach@msu.edu (ORCID) [conceptor]
Martin Chilverschilvers@msu.edu (ORCID) [thesis advisor]
Jari Oksanenjhoksane@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, copyright holder]
Project GREEEN [funder, copyright holder]
North Central Soybean Research Program [funder, copyright holder]
Grains Research and Development Corporation (ROR) (GRDC Project DAQ00186 and GRDC Project CUR2210-005OPX(AAGI-CU)) [funder, copyright holder]
Michigan State University (ROR) (MSU AgBioResearch and MSU Extension) [funder, copyright holder]
University of Southern Queensland (ROR) [funder, copyright holder]
Curtin University (ROR) [funder, copyright holder]
See Also
Useful links:
Report bugs athttps://github.com/openplantpathology/hagis/issues
Phytophthora sojae Survey Example Data
Description
Data from aPhytophthora sojae survey
Usage
data(P_sojae_survey)Format
An object of classdata.table with 294 observations of 12variables
- 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 responseafter inoculation
- Lesion (2)
Number of plants that develop a lesion at inoculationsite
- 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 tocotyledon+Dead)
- total.resis
The total number of resistant plants (equal to HRvalue)
Source
Data from an ongoing 2017Phytophthora sojae survey in Michigan,conducted by A. G. McCoyet al..
Examples
data(P_sojae_survey)P_sojae_surveyPlot hagis Complexities Objects
Description
Creates aggplot2 object of the frequency ofcomplexity (percent per complexity) or aggplot2 object of thedistribution (number per complexity) calculated bycalculate_complexities().
Usage
## S3 method for class 'hagis.complexities'autoplot(object, type, color = NULL, order = NULL, ...)Arguments
object | ahagis |
type | a vector of values for which the bar plot is desired. Specifywhether 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 descendingorder of |
... | passed to the chosen |
Value
Aggplot2 object
Examples
# Using the built-in data set, `P_sojae_survey`data(P_sojae_survey)# calculate susceptibilities with a 60 % cutoff valuecomplexities <- 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 aggplot2 object of the gene summariescalculated bysummarize_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. Specifywhether 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 descendingorder of |
... | passed to the chosen |
Value
Aggplot2 plot
Examples
# Using the built-in data set, `P_sojae_survey`data(P_sojae_survey)# calculate susceptibilities with a 60 % cutoff valuesusc <- summarize_gene( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc")# Visualize the summary of genesautoplot(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 samplebeing tested. |
gene | column providing the gene(s) being tested. |
perc_susc | column providing the percent susceptible reactions. |
Value
An object of classhagis.complexities.
An object of classhagis.complexities is alist containing the followingcomponents
- grouped_complexities
a
data.table::data.table()object ofgrouped complexities- individual_complexities
a
data.table::data.table()object ofindividual complexities
Examples
# Using the built-in data set, `P_sojae_survey`data(P_sojae_survey)P_sojae_survey# calculate susceptibilities with a 60 % cutoff valuecomplexities <- calculate_complexities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc")complexitiessummary(complexities)Calculate Diversities Indices
Description
Calculate five pathogen diversity indices.
Diversity indices include:
Simple diversity index, which will show the proportion of uniquepathotypes to total samples. As the values gets closer to 1, there isgreater diversity in pathoypes within the population. Simple diversity iscalculated as:
D = \frac{Np}{Ns}where
Npis the number of pathotypes andNsis the number ofsamples.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
Npis the number of pathotypes andNsis the number ofsamples.Shannon diversity index is typically between 1.5 and 3.5, as richness andevenness of the population increase, so does the Shannon index value.
D = -\sum_{i = 1}^{R} p_i \log p_iWhere
p_iis the proportional abundance of speciesi.Simpson diversity index values range from 0 to 1, 1 represents highdiversity and 0 represents no diversity. Where diversity is calculated as:
D = \sum_{i = 1}^{R} p_i^2Evenness ranges from 0 to 1, as the Evenness value approaches 1, there isa more even distribution of each pathoype's frequency within thepopulation. Where Evenness is calculated as:
D = \frac{H'}{log(Np) }where
H'is the Shannon diversity index andNpis the numberof 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 samplebeing tested. |
gene | column providing the gene(s) being tested. |
perc_susc | column providing the percent susceptible reactions. |
Value
Ahagis.diversities object.
Ahagis.diversities object is alist 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_surveydata(P_sojae_survey)P_sojae_survey# calculate susceptibilities with a 60 % cutoff valuediversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc")diversitiesCreate Binary Data Matrix From Pathotype Data
Description
Creates a binary data matrix from pathotype data representingthe pathotype of each isolate. This binary data matrix can be used tovisualize beta-diversity of pathotypes usingvegan andape.
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 samplebeing 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 valuefinal_matrix <- create_binary_matrix(x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc")final_matrixCustom Print for hagis Diversities Tables
Description
Print the frequency table of diversities from ahagis.diversities objectThe resulting object is apander 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
Apander::pandoc.table() object of diversities
See Also
calculate_diversities(),individual_pathotypes()
Examples
# Using the built-in data set, P_sojae_surveydata(P_sojae_survey)P_sojae_survey# calculate susceptibilities with a 60 % cutoff valuediversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc")# print the diversities tablediversities_table(diversities)Prints Individual Pathotypes for Each Sample
Description
Print an object from ahagis.diversities object with individual pathotypes,i.e. each sample's pathotype. The resulting object is apandertable (a text object for Markdown) for ease of use in reporting and viewingin the console.
Usage
individual_pathotypes(x, ...)Arguments
x | a |
... | other arguments passed to |
Value
Apander::pander() object of individual pathotypes
See Also
calculate_diversities(),diversities_table()
Examples
# Using the built-in data set, P_sojae_surveydata(P_sojae_survey)P_sojae_survey# calculate susceptibilities with a 60 % cutoff valuediversities <- calculate_diversities( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc")# print the diversities tableindividual_pathotypes(diversities)Objects exported from other packages
Description
These objects are imported from other packages. Follow the linksbelow to see their documentation.
- ggplot2
Phytophthora sojae Survey Example Metadata
Description
Metadata to accompany internal data from aPhytophthora sojae survey usedfor an example in the "Beta-diversity Analyses" vignette.
Usage
data(sample_meta)Format
An object of classdata.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 2017Phytophthora sojae survey in Michigan,conducted by A. G. McCoyet al..
Examples
data(sample_meta)sample_metaCalculate 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 samplebeing tested. |
gene | column providing the gene(s) being tested. |
perc_susc | column providing the percent susceptible reactions. |
Value
ahagis.gene.summary object.
An object of classhagis.gene.summary is adata.table::data.table()containing the following components columns
- gene
the gene
- N_virulent_isolates
the total number virulent isolates for agiven gene in the
genecolumn- 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 valuesusc <- summarize_gene( x = P_sojae_survey, cutoff = 60, control = "susceptible", sample = "Isolate", gene = "Rps", perc_susc = "perc.susc")susc