options(warn=-1) library(survival) library(parallel) load('transbig.rdata') my.coxph = function(x, t, e) # Simple CoxPH with silenced errors. { m = try(coxph(Surv(t,e)~x, data=data.frame(t=t,e=e,x=x)), silent=TRUE) p = NA if (!inherits(m, 'try-error')) { s = summary(m); p = s$coefficients['x', 5] } return (p) } pv = apply(X, 2, my.coxph, C$t.rfs, C$e.rfs) pv = p.adjust(pv, method='fdr') pv[which(pv <.2)] ###### my.coxph = function(x, t, e) # Simple CoxPH with silenced errors. { require(survival) m = try(coxph(Surv(t,e)~x, data=data.frame(t=t,e=e,x=x)), silent=TRUE) p = NA if (!inherits(m, 'try-error')) { s = summary(m); p = s$coefficients['x', 5] } return (p) } library(parallel) cl = makeCluster(4, type='PSOCK') pv = parApply(cl, X, 2, my.coxph, C$t.rfs, C$e.rfs) pv = p.adjust(pv, method='fdr') pv[which(pv <.2)] pv = parCapply(cl, X, my.coxph, C$t.rfs, C$e.rfs) pv = p.adjust(pv, method='fdr') pv[which(pv <.2)] stopCluster(cl) ######## my.coxph = function(x, t, e) # Simple CoxPH with silenced errors. { m = try(coxph(Surv(t,e)~x, data=data.frame(t=t,e=e,x=x)), silent=TRUE) p = NA if (!inherits(m, 'try-error')) { s = summary(m); p = s$coefficients['x', 5] } return (p) } cl = makeCluster(4, type='FORK') pv = parApply(cl, X, 2, my.coxph, C$t.rfs, C$e.rfs) pv = p.adjust(pv, method='fdr') pv[which(pv <.2)] pv = parCapply(cl, X, my.coxph, C$t.rfs, C$e.rfs) pv = p.adjust(pv, method='fdr') pv[which(pv <.2)] stopCluster(cl)