### R代码从vignette源的PGSEA2。Rnw ' ################################################### ### 代码块1号:PGSEA2。Rnw: 36-41 ################################################### 库(PGSEA)库(GEOquery)图书馆(GSEABase) gse < getGEO(“GSE7023”,GSEMatrix = TRUE)(“gse.rda #负载 ") ################################################### ### 代码块2号:PGSEA2。Rnw: 45-49 ################################################### < - gsub亚型 ("\\.", "_", gsub(“亚型:“、”“phenoData (gse [[1]]) $ characteristics_ch1))把< -新(“AnnotatedDataFrame”,data = data.frame(亚型),varMetadata = data.frame (labelDescription =亚型))rownames (pheno@data) < - colnames (exprs (gse [[1]])) eset < -新(“ExpressionSet exprs = exprs (gse [[1]]), phenoData =把 ) ################################################### ### 代码块3号:PGSEA2。Rnw: 54-56 ################################################### 数据(VAIgsc)细节(VAIgsc [[1 ]]) ################################################### ### 代码块数量4:PGSEA2。Rnw: 63 - 64 ################################################### pg < - PGSEA (eset、VAIgsc ref =(子类型= =“不 ")) ################################################### ### 代码块5号:PGSEA2。Rnw: 69 - 70 ################################################### pg(8、8 ] ################################################### ### 代码块6号:PGSEA2。Rnw: 78 - 80 ################################################### 范围(pg有限= TRUE) smcPlot (pg坳=。rwb规模= c(-15年,15岁 )) ################################################### ### 代码块7号:PGSEA2。Rnw: 87 - 88 ################################################### smcPlot (pg因子(亚型),坳=。Rwb, scale=c(- 15,15), margin =c(1,1,6,9),显示。网格= TRUE, r.cex =。)################################################### ### code chunk number 8: PGSEA2.Rnw:96-108 ################################################### pgNF <- PGSEA(eset, VAIgsc, ref=which(subtype=="NO"), p.value=NA) library(limma) design <- model.matrix(~ -1+factor(subtype)) colnames(design) <- names(table(subtype)) fit <- lmFit(pgNF, design) contrast.matrix <- makeContrasts(P2B-NO , levels=design) fit <- contrasts.fit(fit, contrast.matrix) fit <- eBayes(fit) topTable(fit, n=10)[,c("logFC","t","adj.P.Val")] ################################################### ### code chunk number 9: PGSEA2.Rnw:114-115 ################################################### smcPlot(pg[as.numeric(rownames(topTable(fit, n=10))),], factor(subtype,levels=c("P1","P2B")), col=.rwb, scale=c(-15, 15), margins=c(1, 1, 6, 19), show.grid=TRUE, r.cex=.75) ################################################### ### code chunk number 10: PGSEA2.Rnw:127-137 ################################################### gos <- go2smc() pg <- PGSEA(eset, gos, ref=which(subtype=="NO")) pgNF <- PGSEA(eset, gos, ref=which(subtype=="NO"), p.value=NA) #load("ABC.rda") design <- model.matrix(~ -1+factor(subtype)) colnames(design) <- names(table(subtype)) fit <- lmFit(pgNF, design) contrast.matrix <- makeContrasts(P2B-P1,levels=design) fit <- contrasts.fit(fit, contrast.matrix) fit <- eBayes(fit) ################################################### ### code chunk number 11: PGSEA2.Rnw:143-144 ################################################### smcPlot(pg[as.numeric(rownames(topTable(fit,n=30,resort.by="logFC"))),], factor(subtype,levels=c("P1","P2B")), col=.rwb, scale=c(-15, 15), margins=c(1, 1, 6, 19), show.grid=TRUE, r.cex=.75)