diff SMART/DiffExpAnal/DESeqTools/barplotNul.R @ 31:0ab839023fe4

Uploaded
author m-zytnicki
date Tue, 30 Apr 2013 14:33:21 -0400
parents 94ab73e8a190
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SMART/DiffExpAnal/DESeqTools/barplotNul.R	Tue Apr 30 14:33:21 2013 -0400
@@ -0,0 +1,19 @@
+# barplotNul
+# barplot representing null counts per sample
+
+# input : counts, target, projectName
+# output : barplotNul (png)
+
+# created Feb 7th, 2012
+# modified April 30th, 2012 (target$group instead of target)
+
+barplotNul <- function( counts, group,  OUT_barplotNulName, out = TRUE ){
+
+  if (out) png( file=OUT_barplotNulName )
+
+  N <- apply(counts, 2, function(x){sum(x == 0)})/nrow(counts)
+  barplot(N, col=as.integer(group)+1, main = "Proportion of null counts per Sample", ylim = c(0,1))
+  legend("topright", as.character(unique(group)), lty=1, col=as.integer(unique(group))+1)
+
+  if (out) dev.off()
+}