## ----style-knitr, eval=TRUE, echo=FALSE,结果= " asis "-------------------- BiocStyle:乳胶 () ## ---- prepareData回声= T,缓存= F -------------------------------------------- 库(RnaSeqSampleSize) # #——singlePower呼应= TRUE,整洁= TRUE,缓存= T ------------------------------- 示例(est_power) # #——singleSampleSize,每个= TRUE,整洁= TRUE,缓存= T -------------------------- 示例(sample_size) # #——showData呼应= F,缓存= F ----------------------------------------------- 数据(包= " RnaSeqSampleSizeData”)$ results,“项”# #----distributionPower1,echo=TRUE,tidy=FALSE,cache=TRUE-------------------- est_power_distribution(n=65,f=0.01,rho=2, distributionObject="TCGA_READ",repNumber=5) ## ----distributionPower2,echo=TRUE,tidy=FALSE,cache=TRUE-------------------- #基于一些感兴趣基因的功率估算。我们使用storeProcess=TRUE返回所有选定基因的详细信息。selectedGenes<-names(TCGA_READ$pseudo.counts.mean)[c(1,3,5,7,9,12:30)] powerDistribution<-est_power_distribution(n=65,f=0.01,rho=2, distributionObject="TCGA_READ", selectedGenes=selectedGenes, storeProcess=TRUE) str(powerDistribution) mean(powerDistribution$power) ## ----distributionPower3,echo=TRUE,tidy=FALSE,cache=T----------------------- powerDistribution<-est_power_distribution(n=65,f=0.01,rho=2, distributionObject="TCGA_READ",path ="00010",minAveCount=1,storeProcess=TRUE) mean(powerDistribution$power) ## ----distributionSampleSize,echo=TRUE,tidy=FALSE,cache=T------------------- sample_size_distribution(power=0.8,f=0.01,distributionObject="TCGA_READ",repNumber = 5, showMessage = TRUE) # #——generateUserData呼应= TRUE,整洁= TRUE,缓存= T -------------------------- # 生成一个10000 * 10 RNA-seq之前数据作为数据集set.seed (123) dataMatrix <矩阵(样本(100000,0:3000取代= TRUE), nrow = 10000, ncol = 10) colnames (dataMatrix) < - c (paste0(“控制”,1:5),paste0(“治疗”,1:5))row.names (dataMatrix) < -paste0(“基因”,1:1)头(dataMatrix) # #——userDataSampleSize呼应= TRUE,整洁= FALSE,缓存= TRUE -------------------- # Estitamete基因数和阅读色散分布dataMatrixDistribution<-est_count_dispersion(dataMatrix, group=c(rep(0,5),rep(1,5))) #通过读计数和色散分布估算功率est_power_distribution(n=65,f=0.01,rho=2, distributionObject=dataMatrixDistribution,repNumber=5) ## ----singlePowerCurves,echo=TRUE,tidy=TRUE,cache=T------------------------- result1<-est_power_curve(n=63, f=0.01,rho=2, lambda0=5, phi0=0.5) result2<-est_power_curve(n=63, f=0.05, rho=2, lambda0=5, lambda0=5,phi0 = 0.5) plot_power_curve(列表(result1,编写此表达式result2 )) ## ---- optimazation,呼应= TRUE,整洁= FALSE,缓存= T ----------------------------- 结果< -optimize_parameter(有趣= est_power opt1 =“n”,opt2 =“lambda0 opt1Value = c(3、5、10、15、20),opt2Value = c(1:5、10、20))