diff QDNAseq-plot.R @ 87:8391cdb7479c draft

Uploaded
author stef
date Thu, 28 May 2015 14:19:57 -0400
parents 5eec30e0fcce
children d2ea2b842c21
line wrap: on
line diff
--- a/QDNAseq-plot.R	Thu May 28 14:19:49 2015 -0400
+++ b/QDNAseq-plot.R	Thu May 28 14:19:57 2015 -0400
@@ -47,14 +47,17 @@
 sample <- SAMPLE_INDEX
 png( outputPngPath, width=PLOT_WIDTH, height=PLOT_HEIGHT, res=PLOT_RES )
 	par( PAR_SET )
+	ylab_text <- "log2 read counts"
 	if ( whatToPlot == 'everything' ){
 		catMsg( c( "Plotting all data in object" ) )
-		plot( qdnaseqObject[ ,sample ] ) 	
+		plot( qdnaseqObject[ ,sample ], ylab=ylab_text )
+		abline( h=c(-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" )
 	} else if( whatToPlot == 'chromosomes' ){
 		catMsg( c( "Plotting subset of chromosomes" ) )
 		fdata <- qdnaseqObject@featureData@data
 		idx_region <- which( fdata$chromosome %in% chromosomesToPlot )
-		plot( qdnaseqObject[ idx_region, sample ] ) 		
+		plot( qdnaseqObject[ idx_region, sample ], ylab=ylab_text )
+		abline( h=c(-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" )
 	} else if( whatToPlot == 'region' ){
 		regionC <- chrName
 		regionS <- chrStart
@@ -64,11 +67,12 @@
 		
 		fdata <- qdnaseqObject@featureData@data
 		idx_region <- which( fdata$chromosome == regionC & fdata$start > regionS & fdata$end < regionE )
+		cat( idx_region, "\n")
 		
-		plot( qdnaseqObject[ idx_region, sample ], doCalls=FALSE ) 		
+		plot( qdnaseqObject[ idx_region, sample ], doCalls=FALSE, ylab=ylab_text )
 	}
 	#mtext( "plotted in galaxy", 3 )
-	abline( h=c(-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" )
+	
 dev.off()