# # # R代码从装饰图案的ssize来源。Rnw“# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块1号:ssize。Rnw: 251 - 255 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #库(ssize)库(xtable)库(gdata) #脑袋()选项(宽度= 30)# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块2号:ssize。Rnw: 264 - 270 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #加载示例数据数据(exp.sd) #只使用第一个1000,#所以例子运行得更快exp.sd <——exp.sd(1:1000) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块3号:SDPlot # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # par (cex = 2) xlab < - c(“标准差”,“(在对数尺度数据)”)嘘(exp。sd, n = 40,坳=“青色”,边境=“蓝色”,主要= " xlab = xlab日志= " x ")洞穴< -密度(exp.sd)了。< -窝点$ y * par (usr) [4] / max(洞穴$ y)行(窝点$ x,缩放。y,坳= "红色",lwd = 2) # $ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块数量4:ssize。Rnw: 309 - 313 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # n < 6 fold.change权力< -2.0 < -0.8 sig.level < -0.05 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #代码块5号:CumNPlot # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #。< - ssize (sd = exp大小。sd,δ= log2 (fold.change) sig.level =团体。水平,权力=权力)票面(cex = 1) ssize.plot(所有。大小、lwd = 2,坳=“红色”,xlim = c (20)) xmax < - par (usr) [2] 1;ymin < - par (usr)[3] + 0.05传奇(x = xmax, y = ymin,传说= strsplit(粘贴(“折叠改变= ",褶皱。change,",", "alpha=", sig.level, ",", "power=",power,",", "# genes=", nobs(exp.sd), sep=''), "," )[[1]], xjust=1, yjust=0, cex=0.90) title("Sample Size to Detect 2-Fold Change") ################################################### ### code chunk number 6: CumPowerPlot ################################################### all.power <- pow(sd=exp.sd, n=n, delta=log2(fold.change), sig.level=sig.level) par(cex=1) power.plot(all.power, lwd=2, col="blue") xmax <- par("usr")[2]-0.05; ymax <- par("usr")[4]-0.05 legend(x=xmax, y=ymax, legend= strsplit( paste("n=",n,",", "fold change=",fold.change,",", "alpha=", sig.level, ",", "# genes=", nobs(exp.sd), sep=''), "," )[[1]], xjust=1, yjust=1, cex=0.90) title("Power to Detect 2-Fold Change") ################################################### ### code chunk number 7: CumFoldChangePlot ################################################### all.delta <- delta(sd=exp.sd, power=power, n=n, sig.level=sig.level) par(cex=1, mar=c(5.1,5.1,4,2)) delta.plot(all.delta, lwd=2, col="magenta", xlim=c(1,10), ylab = paste("Proportion of Genes with ", "Power >= 80% \n", "at Fold Change of delta") ) xmax <- par("usr")[2]-1; ymin <- par("usr")[3] + 0.05 legend(x=xmax, y=ymin, legend= strsplit( paste("n=",n,",", "alpha=", sig.level, ",", "power=",power,",", "# genes=", nobs(exp.sd), sep=''), "," )[[1]], xjust=1, yjust=0, cex=0.90) title("Fold Change to Achieve 80% Power")