gugl58
10/17/2017 - 7:01 AM

plot cox univariate

take output from cox.univariate and plot the pvalues nicely

plot.cox.univariate <- function(univariate.coxmodellist
								,pvalue.cut=.2){
	plotlist <- list()
	
	plotlist[[1]] <- ggplot(univariate.coxmodellist, aes(y=reorder(Gene, -pValue), x=pValue)) + 
		geom_point() + 
		xlim(c(0, 1)) + 
		geom_vline(xintercept = .05, col="red")
	plotlist[[2]] <- ggplot(subset(x = univariate.coxmodellist, pValue < pvalue.cut), aes(y=reorder(Gene, -pValue), x=pValue)) + 
		geom_point() + 
		xlim(c(0, pvalue.cut)) + 
		geom_vline(xintercept = .05, col="red")
	
	return(plotlist)
}