sim.mutants: Simulate data for a random transposon mutagenesis experiment

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/sim_mutants.R

Description

Simulate data for a random transposon mutagenesis experiment.

Usage

1
sim.mutants(n.sites, essential, n.sites2 = NULL, n.mutants)

Arguments

n.sites

A vector specifying the number of transposon insertion sites in each gene. All elements must by strictly positive.

essential

A vector containing 1's (indicating that the corresponding gene is essential) and 0's (indicating that the corresponding gene is not essential). Must be the same length as n.sites.

n.sites2

A vector specfying the number of transposon insertion sites shared by adjacent genes. The ith element is the number of insertion sites shared by genes i and i+1. The last element is for sites shared by genes N and 1. If missing, these are assumed to be all 0.

n.mutants

Number of mutants to simulate.

Value

If n.sites2 is missing or contains all 0's, a vector is returned containing the number of mutants observed for each gene.

If n.sites2 is not missing and has some positive entries, a matrix with two columns is returned. The first column contains the number of mutants observed for each gene alone; the second column contains the number of mutants observed shared by adjacent genes.

Author(s)

Karl W Broman, broman@wisc.edu

References

Blades, N. J. and Broman, K. W. (2002) Estimating the number of essential genes in a genome by random transposon mutagenesis. Technical Report MS02-20, Department of Biostatistics, Johns Hopkins University, Baltimore, MD. https://www.biostat.wisc.edu/~kbroman/publications/ms0220.pdf

See Also

negenes::negenes(), negenes::Mtb80()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: data(Mtb80)

# simulate 44% of genes to be essential
essential <- rep(0,nrow(Mtb80))
essential[sample(1:nrow(Mtb80),ceiling(nrow(Mtb80)*0.44))] <- 1

# simulate 759 mutants
counts <- sim.mutants(Mtb80[,1], essential, Mtb80[,2], 759)

# run the Gibbs sampler
output <- negenes(Mtb80[,1], counts[,1], Mtb80[,2], counts[,2])
## End(Not run)

negenes documentation built on Aug. 6, 2019, 1:02 a.m.