Mercurial > repos > yufei-luo > differential_expression_analysis_pipeline_for_rnaseq_data
diff DiffExpAnal/DESeqTools/densityPlot.R @ 0:63799b789162 draft
Uploaded
author | yufei-luo |
---|---|
date | Tue, 22 Jan 2013 10:07:03 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DiffExpAnal/DESeqTools/densityPlot.R Tue Jan 22 10:07:03 2013 -0500 @@ -0,0 +1,23 @@ +# densityPlot +# density plot of all samples + +# input : counts, target, projectName +# output : densplot (png) + +# created Feb 7th, 2012 +# modified April 30th, 2012 +# Marie-Anges Dillies + +densityPlot <- function( counts, group, OUT_densityPlotName, out = TRUE ){ + + if (out) png( file=OUT_densityPlotName ) + + couleurs <- as.integer( group ) + 1 + ylim <- c(0, max(density(log2(counts)+1)$y)*1.5) + plot( density(log2(counts[,1])+1), main="Density of counts distribution", col=couleurs[1], ylim = ylim ) + for (i in 2:ncol(counts)) + lines( density(log2(counts[,i])+1), col=couleurs[i] ) + legend( "topright", as.character(unique(group)), lty=1, col=as.integer(unique(group))+1 ) + + if (out) dev.off() +}