## ----setup, include=FALSE------------------------------------------------ opts_chunk$set(cache=TRUE) ## ----, eval=FALSE-------------------------------------------------------- ## library(LeviRmisc) ## df <- geoPmidLookup(c("GSE26712", "PMID18593951")) ## ------------------------------------------------------------------------ library(curatedOvarianData) data(package="curatedOvarianData") ## ------------------------------------------------------------------------ download.file("https://bitbucket.org/lwaldron/ovrc4_sigvalidation/raw/tip/input/patientselection.config", method="wget", destfile="patientselection.config") source("patientselection.config") impute.missing <- TRUE keep.common.only <- TRUE ## ----, results="hide"---------------------------------------------------- download.file("https://bitbucket.org/lwaldron/ovrc4_sigvalidation/raw/tip/src/createEsetList_source.R", method="wget", destfile="createEsetList.R") source("createEsetList.R") ## ------------------------------------------------------------------------ length(esets) ## ------------------------------------------------------------------------ runCox <- function(eset, probeset="CXCL12"){ library(survival) eset$y <- Surv(eset$days_to_death, eset$vital_status == "deceased") if(probeset %in% featureNames(eset)){ obj <- coxph(eset$y ~ scale(t(exprs(eset[probeset, ]))[, 1])) output <- c(obj$coefficients, sqrt(obj$var)) names(output) <- c("log.HR", "SE") }else{output <- NULL} output} runCox(esets[[1]]) ## ------------------------------------------------------------------------ study.coefs <- t(sapply(esets, runCox)); head(study.coefs) ## ----, height=5---------------------------------------------------------- library(metafor) res.fe <- metafor::rma(yi=study.coefs[, 1], sei=study.coefs[, 2], method="FE") forest.rma(res.fe, slab=gsub("_eset$","",rownames(study.coefs)), atransf=exp) ## ------------------------------------------------------------------------ (res.re <- metafor::rma(yi=study.coefs[, 1], sei=study.coefs[, 2], method="DL")) ## ----, eval=TRUE--------------------------------------------------------- if( !require("survHD") || package.version("survHD") != "0.5.0" ){ library(devtools) install_url("https://bitbucket.org/lwaldron/survhd/downloads/survHD_0.5.0.tar.gz") } download.file("https://bitbucket.org/lima1/ovrc4_signew/raw/tip/src/metaCMA.R", destfile="metaCMA.R", method="wget") source("metaCMA.R") gene.coefs <- metaCMA.coefs(esets) FE.res <- metaCMA.opt(esets=esets, coefs=gene.coefs, rma.method="FE", n=200) ## ----, eval=TRUE--------------------------------------------------------- LODO.res <- metaCMA(esets,coefs=gene.coefs,n=200, rma.method="FE")