View source: R/func__calcGeneFreq.R
calcGeneFreq | R Documentation |
This function takes as input the output data frame of countAlleles (more specifically, only uses its second and third columns) and computes the frequency per gene given a two-column data frame of gene IDs and counts across a bacterial population.
calcGeneFreq(x, n, ord = TRUE)
x |
a two-column data frame where the first column stores gene names and the second column stores allele counts. Columns must not be factor variables. |
n |
total number of bacterial isolates/strains in a population |
ord |
a logical parameter specifying whether the output data frame should be sorted by the gene frequency |
Yu Wan (wanyuac@126.com)
mapping <- countAlleles(...) gf <- calcGeneFreq(x = mapping[, c("gene", "count")], n = 1125) # assuming there are 1125 strains
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.