negenes               package:negenes               R Documentation

_E_s_t_i_m_a_t_e _t_h_e _n_u_m_b_e_r _o_f _e_s_s_e_n_t_i_a_l _g_e_n_e_s _i_n _a _g_e_n_o_m_e

_D_e_s_c_r_i_p_t_i_o_n:

     Estimate, via a Gibbs sampler, the posterior distribution of the
     number of essential genes in a genome with data from a random
     transposon mutagenesis experiment.

_U_s_a_g_e:

     negenes(n.sites, counts, n.sites2, counts2,
             n.mcmc=5000, skip=49, burnin=500, 
             startp=1, trace=TRUE,
             calc.prob=FALSE, return.output=FALSE)

_A_r_g_u_m_e_n_t_s:

 n.sites: A vector specifying the number of transposon insertion sites
          in each gene (alone).  All elements must by strictly
          positive.

  counts: A vector specifying the number of mutants observed for each
          gene (alone).  Must be the same length as 'n.sites', and all
          elements must be non-negative integers.

n.sites2: A vector specfying the number of transposon insertion sites
          shared by adjacent genes.  The _i_th 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.

 counts2: A vector specfying the number of mutants shared by adjacent
          gene (analogous to 'n.sites2').

  n.mcmc: Number of Gibbs steps to perform.

    skip: An integer; only save every 'skip' + 1st step.

  burnin: Number of initial Gibbs steps to run (output discarded).

  startp: Initial proportion of genes for which no mutant was observed
          that will be assumed essential for the Gibbs sampler.  (Genes
          for which a mutant was observed are assumed non-essential;
          other genes are assumed essential independent with this
          probability.)

   trace: If TRUE, print iteration number occassionally.

calc.prob: If TRUE, return the log posterior probability (up to an
          additive constant) for each saved iteration.

return.output: If TRUE, include detailed Gibbs results in the output.

_D_e_t_a_i_l_s:

     See the technical report cited below.

_V_a_l_u_e:

     A list with components 'n.essential' (containing the total number
     of essential genes at each iteration of the Gibbs sampler)
     'summary' (a vector containing the estimated mean, SD, 2.5
     percentile and 97.5 percentile of the posterior distribution of
     the number of essential genes.  

     The next component, 'geneprob', is a vector with one element for
     each gene, containing the estimated posterior probability that
     each gene is essential.  These are Rao-Blackwellized estimates.

     If the argument 'calc.prob' was true, there will also be a
     component 'logprob' containing the log (base e) of the posterior
     probability (up to an additive constant) at each Gibbs step.

     If the argument 'return.output' was true, there will also be a
     matrix with 'n.mcmc' / ('skip' + 1) rows (corresponding to the
     Gibbs steps) and a column for each gene The entries in the matrix
     are either 0 (essential gene) or 1 (non-essential gene) according
     to the state of that gene at that step in the Gibbs sampler.

_A_u_t_h_o_r(_s):

     Karl W Broman, kbroman@jhsph.edu

_R_e_f_e_r_e_n_c_e_s:

     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. <URL:
     http://www.biostat.jhsph.edu/~kbroman/publications/ms0220.pdf>

_S_e_e _A_l_s_o:

     'sim.mutants', 'Mtb80'

_E_x_a_m_p_l_e_s:

     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 without returning detailed output
     output <- negenes(Mtb80[,1], counts[,1], Mtb80[,2], counts[,2])

     # run the Gibbs sampler, returning the detailed output
     output2 <- negenes(Mtb80[,1], counts[,1], Mtb80[,2], counts[,2], return=TRUE)

