view deseq/differential_expression_analysis_pipeline_for_rnaseq_data-a03838a6eb54/DiffExpAnal/DESeqTools/MAplotDE.R @ 10:6e573fd3c41b draft

Uploaded
author yufei-luo
date Mon, 13 May 2013 10:06:30 -0400
parents
children
line wrap: on
line source

# Marie-Anges Dillies
# MAplotDE
# MAplot of DE genes

# input : res, alpha,OUT_MAplotDEName 
# output : MAplot (png)

MAplotDE <- function( res, alpha, OUT_MAplotDEName, out = TRUE ){

 	if (out) png( file=OUT_MAplotDEName )
  
 	plot( res$baseMean, res$log2FoldChange, pch=".", xlab="Mean expression", ylab="log2FC", main="",
  		log="x", col=ifelse(res$padj < alpha, "red", "black") )
	abline(h=0, col="red")

  	if (out) dev.off()
}