Mercurial > repos > yufei-luo > s_mart
comparison SMART/DiffExpAnal/DESeqTools/plotDispEstimates.R @ 18:94ab73e8a190
Uploaded
| author | m-zytnicki | 
|---|---|
| date | Mon, 29 Apr 2013 03:20:15 -0400 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 17:b0e8584489e6 | 18:94ab73e8a190 | 
|---|---|
| 1 # plotDispEstimates | |
| 2 # scatter plots representing dispersion estimates vs mean expression | |
| 3 | |
| 4 # input : cds, OUT_plotDispEstimatesName | |
| 5 # output : scatterplot (png) | |
| 6 | |
| 7 plotDispEstimates <- function( cds, OUT_plotDispEstimatesName, out = TRUE ){ | |
| 8 | |
| 9 if (out) png( file=OUT_plotDispEstimatesName ) | |
| 10 | |
| 11 plot( | |
| 12 rowMeans( counts(cds, normalized=T) ), | |
| 13 fitInfo(cds)$perGeneDispEsts, | |
| 14 pch=".", log="xy", | |
| 15 xlab = "Mean expression strength", ylab = "Dispersion estimate" ) | |
| 16 | |
| 17 xg <- 10^seq(-.5, 5, length.out=300) | |
| 18 lines( xg, fitInfo(cds)$dispFun(xg), col="red" ) | |
| 19 | |
| 20 if (out) dev.off() | |
| 21 } | 
