### R代码来自Vignette Source'plotting.rnw'########################################################## ###代码块数字1:plotting.rnw:5-6 ##########################################################################################-64 ############################# require(genominator)选项(verbose = false)n <-100000#观测数。k <-100#注释区域的数量,不少于10 df <-data.frame(chr = sample(1:16,size = n,size = n,replact = true),位置=示例(1:1000,size = n,替换= true),strand = sample(c(1l,-1l),size = n,替换= true))edata <-crentegateExpData(importToToExpData(df,dbfileName =“ pmy.db”,pmy.db“,pmy.db”,perpRite = true,true,tablename = tablename = tablename = tableName =“ ex_tbl”))annodata < - data.frame(chr = sample(1:16,size = k,替换= true),strand = sample(c(1,-1),size = k,replact = k,replact = true),,start =(st < - sample(1:1000,size = k,替换= true)),end = st + rpois(k,75),特征= c(“ gene”,“ intermenic”)[sample(1:1:2,size = k,替换= true)]))ROWNAMES(annodata)< - 粘贴(“ elt”,1:k,sep =“。”)###############################################################################rp < - genominator ::: makeregionplotter(list(“ track.1” = list(expdata = eData,what =“ counts”))))args(rp)#####################################################:plotting.rnw:74-75 ######################################################## rp(1,10,1000)################################### ### code chunk number 5: plotting.Rnw:82-85 ################################################### rp <- Genominator:::makeRegionPlotter(list("track.1" = list(expData = eData, what = "counts", dp = DisplayPars(lwd = .45, color = "grey")))) rp(1, 400, 500) ################################################### ### code chunk number 6: plotting.Rnw:93-103 ################################################### annoFactory <- Genominator:::makeAnnoFactory(annoData, featureColumnName = "feature", groupColumnName = NULL, idColumnName = NULL, dp = DisplayPars("gene" = "blue", "intergenic" = "green")) rp <- Genominator:::makeRegionPlotter(list("track.1" = list(expData = eData, what = "counts", dp = DisplayPars(lwd=.2, color = "grey")), "track.2" = list(expData = eData, what = "counts", fx = log2, DisplayPars(lwd=.3, color = "black"))), annoFactory = annoFactory) rp(annoData[1,"chr"], annoData[1, "start"] - 100, annoData[1, "end"] + 100) ################################################### ### code chunk number 7: plotting.Rnw:113-127 ################################################### require("biomaRt") mart <- useMart("ensembl", dataset = "scerevisiae_gene_ensembl") annoFactory <- Genominator:::makeAnnoFactory(mart, chrFunction = function(chr) as.roman(chr)) load(system.file("data", "chr1_yeast.rda", package = "Genominator")) head(chr1_yeast) yData <- importToExpData(chr1_yeast, dbFilename = "my.db", tablename = "yeast", overwrite = TRUE) rp <- Genominator:::makeRegionPlotter(list("track.-" = list(expData = yData, what = c("mRNA_1", "mRNA_2"), fx = rowMeans, strand = -1, dp = DisplayPars(lwd=.3, color = "grey"))), annoFactory = annoFactory) rp(1, 20000, 50000) ################################################### ### code chunk number 8: sessionInfo ################################################### toLatex(sessionInfo())