## ----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<-c("A1BG","A2BP1","A2M","A4GALT","AAAS") 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,eval=FALSE------------ # powerDistribution<-est_power_distribution(n=65,f=0.01,rho=2, # distributionObject="TCGA_READ",pathway="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) ## ----librarySizeAndGeneRange,echo=TRUE,tidy=FALSE,cache=TRUE,message=FALSE,eval=FALSE---- # library(count) # studyId="SRP009615" # url <- download_study(studyId) # load(file.)路径(studyId,rse_gene.Rdata)) # # #显示百分比的映射读取# plot_mappedReads_percent个人(rse_gene) # #显示比例的基因数在不同范围# plot_gene_counts_range (rse_gene targetSize = 4 e + 7 ) # ## ---- AnalyzeDataSet,呼应= TRUE,整洁= FALSE,缓存= TRUE,消息= FALSE, eval = FALSE,图书馆(ExpressionAtlas) # # # # # projectId =“E-ENAD-46”# allExps < - getAtlasData (projectId) # ExpressionAtlasObj < - allExps [[projectId]]美元rnaseq # # #只有保持“两国集团”(COVID-19)和“四国集团”(正常)#样品(colData expObj = ExpressionAtlasObj [(ExpressionAtlasObj)美元AtlasAssayGroup % % c(“g2”、“四国集团”)))# expObjGroups = 2-as.integer (as.factor (colData (expObj) AtlasAssayGroup美元))为正常,1 # 0 # # COVID-19样品只有保持基因至少有10项# minAveCount = 10 # averageCountsGene = rowSums(化验(expObj)) / ncol (expObj) # expObjFilter = expObj[这(averageCountsGene > = minAveCount),) # #结果= analyze_dataset (expObjFilter, expObjGroups = expObjGroups) # # # ----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, phi0=0.5) plot_power_curve(list(result1,result2)) ## ----optimazation,echo=TRUE,tidy=FALSE,cache=T----------------------------- result<-optimize_parameter(fun=est_power,opt1="n", opt2="lambda0",opt1Value=c(3,5,10,15,20), opt2Value=c(1:5,10,20))