view deseq/differential_expression_analysis_pipeline_for_rnaseq_data-a03838a6eb54/DiffExpAnal/DESeqTools/barplotTC.R @ 10:6e573fd3c41b draft

Uploaded
author yufei-luo
date Mon, 13 May 2013 10:06:30 -0400
parents
children
line wrap: on
line source

# barplotTC
# barplot representing total count per sample

# input : counts, target, projectName
# output : barplotTC (png)

# created Feb 7th, 2012
# modified April 30th, 2012 (group instead of target$group)
# Marie-Anges Dillies

barplotTC <- function( counts, group, OUT_barplotTCName, out = TRUE ){

  if (out) png( file=OUT_barplotTCName )

  ylim <- c(0, max(colSums(counts))*1.2)
  barplot( colSums(counts), col=as.integer(group)+1, main = "Total Read Count per Sample",  ylim=ylim )
  legend( "topright", as.character(unique(group)), lty=1,
         col=as.integer(unique(group))+1 )

  if (out) dev.off()
}