diff SMART/DiffExpAnal/DESeqTools/plotDispEstimates.R @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SMART/DiffExpAnal/DESeqTools/plotDispEstimates.R	Mon Apr 29 03:20:15 2013 -0400
@@ -0,0 +1,21 @@
+# plotDispEstimates
+# scatter plots representing dispersion estimates vs mean expression
+
+# input : cds, OUT_plotDispEstimatesName
+# output : scatterplot (png)
+
+plotDispEstimates <- function( cds, OUT_plotDispEstimatesName, out = TRUE ){
+
+  if (out) png( file=OUT_plotDispEstimatesName )
+  
+  plot(
+  	rowMeans( counts(cds, normalized=T) ),
+  	fitInfo(cds)$perGeneDispEsts,
+  	pch=".", log="xy",
+  	xlab = "Mean expression strength", ylab = "Dispersion estimate" )
+  	
+  xg <- 10^seq(-.5, 5, length.out=300)
+  lines( xg, fitInfo(cds)$dispFun(xg), col="red" )
+
+  if (out) dev.off()
+}