annotate SMART/DiffExpAnal/DESeqTools/MAplotDE.R @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 # MAplotDE
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 # MAplot of DE genes
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4 # input : res, alpha,OUT_MAplotDEName
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 # output : MAplot (png)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7 MAplotDE <- function( res, alpha, OUT_MAplotDEName, out = TRUE ){
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9 if (out) png( file=OUT_MAplotDEName )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11 plot( res$baseMean, res$log2FoldChange, pch=".", xlab="Mean expression", ylab="log2FC", main="",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12 log="x", col=ifelse(res$padj < alpha, "red", "black") )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 abline(h=0, col="red")
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15 if (out) dev.off()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 }