summarize_gene: Calculate and Summarize Distribution of Susceptibilities by...

View source: R/summarize_gene.R

summarize_geneR Documentation

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 data.frame containing the data.

cutoff

value for percent susceptible cutoff. Numeric.

control

value used to denote the susceptible control in the gene column. Character.

sample

column providing the unique identification for each sample being tested. Character.

gene

column providing the gene(s) being tested. Character.

perc_susc

column providing the percent susceptible reactions. Character.

Value

returns an object of class hagis.gene.summary 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


hagis documentation built on Sept. 8, 2023, 5:20 p.m.