calcGeneFreq: Calculate gene frequency

View source: R/func__calcGeneFreq.R

calcGeneFreqR Documentation

Calculate gene frequency

Description

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.

Usage

calcGeneFreq(x, n, ord = TRUE)

Arguments

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

Author(s)

Yu Wan (wanyuac@126.com)

Examples

mapping <- countAlleles(...)
gf <- calcGeneFreq(x = mapping[, c("gene", "count")], n = 1125)  # assuming
there are 1125 strains


wanyuac/GeneMates documentation built on Aug. 12, 2022, 7:37 a.m.