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("bim-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('bim') Loading required package: qtl > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "Bnapus" > > ### * Bnapus > > flush(stderr()); flush(stdout()) > > ### Name: Bnapus > ### Title: Cross structure for complete Brassica napus data > ### Aliases: Bnapus > ### Keywords: datasets > > ### ** Examples > > data(Bnapus) > ## Don't show: > library(qtl) > ## End Don't show > summary(Bnapus) Backcross No. individuals: 104 No. phenotypes: 11 Percent phenotyped: 94.2 94.2 96.2 88.5 93.3 99 99 99 99 99 99 No. chromosomes: 19 Total markers: 300 No. markers: 16 22 27 12 18 15 18 8 11 15 10 16 36 17 12 9 15 10 13 Percent genotyped: 83.2 Genotypes (%): AA:49.6 AB:50.4 > plot(Bnapus) > ## Not run: > ##D Bnapus.bim = run.bmapqtl(Bnapus,"log10flower8") > ## End(Not run) > > > > cleanEx(); ..nameEx <- "bim.effects" > > ### * bim.effects > > flush(stderr()); flush(stdout()) > > ### Name: bim.effects > ### Title: Bayesian QTL map of loci and effects > ### Aliases: bim.effects plot.bim.effects > ### Keywords: models hplot > > ### ** Examples > > data( vern ) > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > vern.qtl <- bim.effects( verngeo.bim, vern, 2 ) > plot.bim.effects( verngeo.bim, vern, 2, qtl = vern.qtl ) > > > > cleanEx(); ..nameEx <- "bim.fdr" > > ### * bim.fdr > > flush(stderr()); flush(stdout()) > > ### Name: bim.fdr > ### Title: Bayesian False Discovery Rate for QTL mapping > ### Aliases: bim.fdr plot.bim.fdr > ### Keywords: models hplot > > ### ** Examples > > data( vern ) > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > plot.bim.fdr( verngeo.bim, vern, pattern=c(1,1) ) H0 M0 M1 0.2231207 0.0000000 1.0000000 $hyp H0 M0 M1 0.223 0.000 1.000 $fdr 0.05 0.1 0.15 0.2 0.25 0.02 0.40 0.82 0.97 0.99 > > > > cleanEx(); ..nameEx <- "bim.model" > > ### * bim.model > > flush(stderr()); flush(stdout()) > > ### Name: bim.model > ### Title: Bayesian model selection for number and pattern of QTL across > ### genome > ### Aliases: bim.model bim.nqtl bim.pattern > ### Keywords: models > > ### ** Examples > > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > bim.model( verngeo.bim ) $nqtl $nqtl$posterior 1 2 3 4 5 6 7 8 9 0.040 0.291 0.311 0.189 0.102 0.042 0.018 0.004 0.003 $nqtl$prior 1 2 3 4 5 6 0.5000000000 0.1666666667 0.0555555556 0.0185185185 0.0061728395 0.0020576132 7 8 9 0.0006858711 0.0002286237 0.0000762079 $nqtl$bf 1 2 3 4 5 6 7 8 9 1.000 21.825 69.975 127.575 206.550 255.150 328.050 218.700 492.075 $nqtl$bfse 1 2 3 4 5 6 0.1549193 1.0772857 3.2936111 8.3568980 19.3804243 38.5348508 7 8 9 76.6230673 109.1310809 283.6731642 $pattern $pattern$posterior pattern 3*1 2*1 4*1 5*1 6*1 1 7*1 0.311 0.291 0.189 0.102 0.042 0.040 0.018 $pattern$prior pattern 3*1 2*1 4*1 5*1 6*1 1 0.166666667 0.500000000 0.055555556 0.018518519 0.006172840 1.500000000 7*1 0.002057613 $pattern$bf pattern 3*1 2*1 4*1 5*1 6*1 1 7*1 1.00000000 0.31189711 1.82315113 2.95176849 3.64630225 0.01429082 4.68810289 $pattern$bfse pattern 3*1 2*1 4*1 5*1 6*1 1 0.047068398 0.015395293 0.119426910 0.276962120 0.550694545 0.002213924 7*1 1.095006321 $param $param$nqtl [1] 1 $param$pattern NULL $param$exact [1] FALSE $param$cutoff [1] 1 attr(,"class") [1] "bim.model" > > > > cleanEx(); ..nameEx <- "bim.qtl" > > ### * bim.qtl > > flush(stderr()); flush(stdout()) > > ### Name: bim. > ### Title: Bayesian QTL estimation and mapping of loci > ### Aliases: bim.qtl plot.bim.qtl > ### Keywords: models hplot > > ### ** Examples > > data( vern ) > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > plot.bim.qtl( verngeo.bim, vern, 2 ) > > > > cleanEx(); ..nameEx <- "bmapqtl.options" > > ### * bmapqtl.options > > flush(stderr()); flush(stdout()) > > ### Name: bmapqtl.options > ### Title: Options Settings for BmapQTL > ### Aliases: bmapqtl.options > ### Keywords: utilities > > ### ** Examples > > bmapqtl.options() simulate 400000 MCMC steps, recording by 400 with 0.05 burnin and 0.05 pre-burnin prior for number of QTL: geometric(3) initial number of QTL: 0 hyperparameters for priors: 1 2 init 0.5 -1 prior.mean 1.0 -1 prior.var 3.0 -1 prior.add 0.0 0 prior.dom 0.0 0 random seed: 0 > bmapqtl.options(niter=100000, by=1000) simulate 100000 MCMC steps, recording by 1000 with 0.05 burnin and 0.05 pre-burnin prior for number of QTL: geometric(3) initial number of QTL: 0 hyperparameters for priors: 1 2 init 0.5 -1 prior.mean 1.0 -1 prior.var 3.0 -1 prior.add 0.0 0 prior.dom 0.0 0 random seed: 0 > > > > cleanEx(); ..nameEx <- "fisch" > > ### * fisch > > flush(stderr()); flush(stdout()) > > ### Name: fisch > ### Title: Eight QTL Stephens and Fisch simulated data > ### Aliases: fisch fisch.bim > ### Keywords: datasets > > ### ** Examples > > data(fisch) > data(fisch.bim) > > > > cleanEx(); ..nameEx <- "plot.bim" > > ### * plot.bim > > flush(stderr()); flush(stdout()) > > ### Name: plot.bim > ### Title: Diagnostics plots for Bayesian interval mapping > ### Aliases: plot.bim > ### Keywords: hplot models > > ### ** Examples > > data( vern ) > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > plot.bim( verngeo.bim, vern ) time series of burnin and mcmc runs jittered plot of quantitative trait loci by chromosome... model selection plots: number of QTL and chromosome pattern... posterior for number of QTL as % 1 2 3 4 5 6 7 8 9 4 29 31 19 10 4 2 0 0 Bayes factor ratios for number of QTL 1 2 3 4 5 6 7 8 9 1.0 21.8 70.0 127.6 206.6 255.2 328.1 218.7 492.1 model posterior above cutoff 1 as % pattern 3*1 2*1 4*1 5*1 6*1 1 7*1 31 29 19 10 4 4 2 Bayes factor ratios for chromosome pattern pattern 3*1 2*1 4*1 5*1 6*1 1 7*1 1.0 0.3 1.8 3.0 3.6 0.0 4.7 quantitative trait loci (histogram) and effects (scatter plot)... QTL loci and density peaks: chr loci dens 1 ch1 81.12688 0.03195633 HPD region density cutoffs: 0.5 0.55 0.6 0.65 0.7 0.75 0.016657731 0.014632603 0.013291712 0.012334799 0.011970909 0.011718709 0.8 0.85 0.9 0.95 0.011212764 0.009548800 0.008438146 0.002412640 QTL loci and effect estimates: chrom loci add add.sd ch1 ch1 81.12688 0.1785783 0.06996807 mean NA 2.9100177 0.03955753 QTL density estimates by chromosome at 512 grid points with bw = 2 Smoothing spline parameters for additive effects: ch1 0.812509 summary diagnostics as histograms and boxplots by number of QTL LOD 9.353 conditional LOD 1 2 3 4 5 6 7 8 9 5.514 8.632 9.337 10.466 10.023 10.484 9.989 9.176 10.851 mean 2.91 conditional mean 1 2 3 4 5 6 7 8 9 2.958 2.923 2.906 2.902 2.902 2.893 2.896 2.923 2.936 envvar 0.056 conditional envvar 1 2 3 4 5 6 7 8 9 0.065 0.058 0.056 0.054 0.055 0.054 0.053 0.056 0.051 addvar 0.524 conditional addvar 1 2 3 4 5 6 7 8 9 0.395 0.501 0.517 0.560 0.583 0.531 0.586 0.623 0.595 herit 0.314 conditional heritability 1 2 3 4 5 6 7 8 9 0.220 0.290 0.314 0.339 0.325 0.341 0.362 0.292 0.329 > > > > cleanEx(); ..nameEx <- "plot.bim.diag" > > ### * plot.bim.diag > > flush(stderr()); flush(stdout()) > > ### Name: plot.bim.diag > ### Title: Marginal and model-conditional summaries of Bayesian interval > ### mapping diagnostics > ### Aliases: plot.bim.diag > ### Keywords: models > > ### ** Examples > > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > plot.bim.diag( verngeo.bim, 2, items = c("LOD","herit") ) LOD 9.484 conditional LOD 2 3 4 5 6 7 8 9 8.632 9.337 10.466 10.023 10.484 9.989 9.176 10.851 herit 0.317 conditional heritability 2 3 4 5 6 7 8 9 0.290 0.314 0.339 0.325 0.341 0.362 0.292 0.329 > > > > cleanEx(); ..nameEx <- "plot.bim.loci" > > ### * plot.bim.loci > > flush(stderr()); flush(stdout()) > > ### Name: plot.bim.loci > ### Title: Jittered plot of Bayesian QTL loci samples by chromosome > ### Aliases: plot.bim.loci > ### Keywords: models > > ### ** Examples > > data( vern ) > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > plot.bim.loci( verngeo.bim, vern, 2 ) > > > > cleanEx(); ..nameEx <- "plot.bim.mcmc" > > ### * plot.bim.mcmc > > flush(stderr()); flush(stdout()) > > ### Name: plot.bim.mcmc > ### Title: Bayesian MCMC sequence plots for burnin and iterations. > ### Aliases: plot.bim.mcmc > ### Keywords: models > > ### ** Examples > > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > plot.bim.mcmc( verngeo.bim ) > > > > cleanEx(); ..nameEx <- "plot.bim.model" > > ### * plot.bim.model > > flush(stderr()); flush(stdout()) > > ### Name: plot.bim.model > ### Title: Graphical model assessment for Bayesian interval mapping > ### Aliases: plot.bim.model > ### Keywords: models > > ### ** Examples > > data( vern ) > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > plot.bim.model( verngeo.bim, vern, 2 ) $nqtl $nqtl$posterior 2 3 4 5 6 7 0.303125000 0.323958333 0.196875000 0.106250000 0.043750000 0.018750000 8 9 0.004166667 0.003125000 $nqtl$prior 2 3 4 5 6 7 0.1666666667 0.0555555556 0.0185185185 0.0061728395 0.0020576132 0.0006858711 8 9 0.0002286237 0.0000762079 $nqtl$bf 2 3 4 5 6 7 8 9 1.000000 3.206186 5.845361 9.463918 11.690722 15.030928 10.020619 22.546392 $nqtl$bfse 2 3 4 5 6 7 0.04893628 0.14948417 0.38104125 0.88588814 1.76401551 3.50945253 8 9 4.99986024 12.99681011 $pattern $pattern$posterior pattern 3*1 2*1 4*1 5*1 6*1 7*1 0.3239583 0.3031250 0.1968750 0.1062500 0.0437500 0.0187500 $pattern$prior pattern 3*1 2*1 4*1 5*1 6*1 7*1 0.166666667 0.500000000 0.055555556 0.018518519 0.006172840 0.002057613 $pattern$bf pattern 3*1 2*1 4*1 5*1 6*1 7*1 1.0000000 0.3118971 1.8231511 2.9517685 3.6463023 4.6881029 $pattern$bfse pattern 3*1 2*1 4*1 5*1 6*1 7*1 0.04662368 0.01526308 0.11884566 0.27630595 0.55019133 1.09458809 $param $param$nqtl [1] 2 $param$pattern NULL $param$exact [1] FALSE $param$cutoff [1] 1 attr(,"class") [1] "bim.model" > > > > cleanEx(); ..nameEx <- "read.bim" > > ### * read.bim > > flush(stderr()); flush(stdout()) > > ### Name: read.bim > ### Title: Read samples from WinQTL output > ### Aliases: read.bim > ### Keywords: file > > ### ** Examples > > ## Not run: verngeo.bim <- read.bim( ".", "verngeo.z" ) > > > > cleanEx(); ..nameEx <- "read.bmapqtl" > > ### * read.bmapqtl > > flush(stderr()); flush(stdout()) > > ### Name: read.bmapqtl > ### Title: Read and write options for WinQTL > ### Aliases: read.bmapqtl write.bmapqtl > ### Keywords: file > > ### ** Examples > > ## Not run: > ##D write.bmapqtl( ".", "nval.dat") > ##D read.bmapqtl(".", "nval.dat" ) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "run.bmapqtl" > > ### * run.bmapqtl > > flush(stderr()); flush(stdout()) > > ### Name: run.bmapqtl > ### Title: Run Bmapqtl reversible jump MCMC > ### Aliases: run.bmapqtl > ### Keywords: models > > ### ** Examples > > data(vern) > ## Not run: > ##D bim = run.bmapqtl(vern) > ##D plot(bim) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "subset.bim" > > ### * subset.bim > > flush(stderr()); flush(stdout()) > > ### Name: subset.bim > ### Title: Subsetting Bayesian interval mapping data > ### Aliases: subset.bim > ### Keywords: utilities > > ### ** Examples > > ## Not run: > ##D bim223 <- subset.bim( bim, pattern = c(2,2,3) ) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "summary.bim" > > ### * summary.bim > > flush(stderr()); flush(stdout()) > > ### Name: summary.bim > ### Title: Summary of Bayesian interval mapping samples > ### Aliases: summary.bim summary.bim.model summary.bim.qtl > ### Keywords: utilities > > ### ** Examples > > data( verngeo.bim ) > ## Don't show: > library(qtl) > ## End Don't show > summary( verngeo.bim ) Bayesian interval mapping object verngeo.bim had iterations recorded at each 400 steps with 1000 pre-burn-in and 20000 burn-in steps. Prior for number of QTL was geometric(3). Percentages for number of QTL detected: 1 2 3 4 5 6 7 8 9 4 29 31 19 10 4 2 0 0 Diagnostic summaries: nqtl LOD mean envvar Min. :1.000 Min. : 3.092 Min. :2.779 Min. :0.03602 1st Qu.:2.000 1st Qu.: 7.777 1st Qu.:2.883 1st Qu.:0.05030 Median :3.000 Median : 9.353 Median :2.910 Median :0.05587 Mean :3.258 Mean : 9.332 Mean :2.910 Mean :0.05690 3rd Qu.:4.000 3rd Qu.:11.038 3rd Qu.:2.937 3rd Qu.:0.06283 Max. :9.000 Max. :15.799 Max. :3.032 Max. :0.09408 addvar herit Min. :0.0917 Min. :0.07131 1st Qu.:0.3950 1st Qu.:0.25162 Median :0.5244 Median :0.31403 Mean :0.5421 Mean :0.31366 3rd Qu.:0.6621 3rd Qu.:0.37316 Max. :1.3688 Max. :0.57321 > verngeo.model <- bim.model( verngeo.bim ) > summary( verngeo.model ) posterior for number of QTL as % 1 2 3 4 5 6 7 8 9 4 29 31 19 10 4 2 0 0 Bayes factor ratios for number of QTL 1 2 3 4 5 6 7 8 9 1.0 21.8 70.0 127.6 206.6 255.2 328.1 218.7 492.1 model posterior above cutoff 1 as % pattern 3*1 2*1 4*1 5*1 6*1 1 7*1 31 29 19 10 4 4 2 Bayes factor ratios for chromosome pattern pattern 3*1 2*1 4*1 5*1 6*1 1 7*1 1.0 0.3 1.8 3.0 3.6 0.0 4.7 > ## estimate QTL density and locate peak(s) > verngeo.qtl <- bim.qtl( verngeo.bim ) > ## augment bim.qtl with estimates of effects > verngeo.qtl <- bim.effects( verngeo.bim, qtl = verngeo.qtl ) > ## same idea but with just one call > verngeo.qtl <- bim.effects( verngeo.bim ) > > > > cleanEx(); ..nameEx <- "vern" > > ### * vern > > flush(stderr()); flush(stdout()) > > ### Name: vern > ### Title: Eight week vernalization data for Brassica napus > ### Aliases: vern verngeo.bim vernpois.bim > ### Keywords: datasets > > ### ** Examples > > data(vern) > data(verngeo.bim) > data(vernpois.bim) > ## or use run.bmapqtl to create bim objects: > ## Not run: > ##D bmapqtl.options(prior.nqtl="geometric") > ##D verngeo.bim = run.bmapqtl(vern) > ##D bmapqtl.options(prior.nqtl="poisson") > ##D vernpois.bim = run.bmapqtl(vern) > ## End(Not run) > > > > ### *