R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("negenes-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('negenes') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "Mtb80" > > ### * Mtb80 > > flush(stderr()); flush(stdout()) > > ### Name: Mtb80 > ### Title: Number of insertion sites in each gene in M tb CDC1551 > ### Aliases: Mtb80 > ### Keywords: datasets > > ### ** Examples > > ## Not run: data(Mtb80) > ##D > ##D # simulate 44% of genes to be essential > ##D essential <- rep(0,nrow(Mtb80)) > ##D essential[sample(1:nrow(Mtb80),ceiling(nrow(Mtb80)*0.44))] <- 1 > ##D > ##D # simulate 759 mutants > ##D counts <- sim.mutants(Mtb80[,1], essential, Mtb80[,2], 759) > ##D > ##D # run the Gibbs sampler > ##D output <- negenes(Mtb80[,1], counts[,1], Mtb80[,2], counts[,2]) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "negenes" > > ### * negenes > > flush(stderr()); flush(stdout()) > > ### Name: negenes > ### Title: Estimate the number of essential genes in a genome > ### Aliases: negenes > ### Keywords: models > > ### ** Examples > > 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]) 0 20 40 60 80 100 > > # run the Gibbs sampler, returning the detailed output > output2 <- negenes(Mtb80[,1], counts[,1], Mtb80[,2], counts[,2], return=TRUE) 0 20 40 60 80 100 > > > > cleanEx(); ..nameEx <- "sim.mutants" > > ### * sim.mutants > > flush(stderr()); flush(stdout()) > > ### Name: sim.mutants > ### Title: Simulate data for a random transposon mutagenesis experiment > ### Aliases: sim.mutants > ### Keywords: datagen > > ### ** Examples > > ## Not run: data(Mtb80) > ##D > ##D # simulate 44% of genes to be essential > ##D essential <- rep(0,nrow(Mtb80)) > ##D essential[sample(1:nrow(Mtb80),ceiling(nrow(Mtb80)*0.44))] <- 1 > ##D > ##D # simulate 759 mutants > ##D counts <- sim.mutants(Mtb80[,1], essential, Mtb80[,2], 759) > ##D > ##D # run the Gibbs sampler > ##D output <- negenes(Mtb80[,1], counts[,1], Mtb80[,2], counts[,2]) > ## End(Not run) > > > > ### *