comparison QDNAseq-plot.R @ 88:d2ea2b842c21 draft default tip

Uploaded
author stef
date Mon, 06 Jul 2015 06:29:19 -0400
parents 8391cdb7479c
children
comparison
equal deleted inserted replaced
87:8391cdb7479c 88:d2ea2b842c21
49 par( PAR_SET ) 49 par( PAR_SET )
50 ylab_text <- "log2 read counts" 50 ylab_text <- "log2 read counts"
51 if ( whatToPlot == 'everything' ){ 51 if ( whatToPlot == 'everything' ){
52 catMsg( c( "Plotting all data in object" ) ) 52 catMsg( c( "Plotting all data in object" ) )
53 plot( qdnaseqObject[ ,sample ], ylab=ylab_text ) 53 plot( qdnaseqObject[ ,sample ], ylab=ylab_text )
54 abline( h=c(-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" ) 54 abline( h=c(-4,-3,-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" )
55 } else if( whatToPlot == 'chromosomes' ){ 55 } else if( whatToPlot == 'chromosomes' ){
56 catMsg( c( "Plotting subset of chromosomes" ) ) 56 catMsg( c( "Plotting subset of chromosomes" ) )
57 fdata <- qdnaseqObject@featureData@data 57 fdata <- qdnaseqObject@featureData@data
58 idx_region <- which( fdata$chromosome %in% chromosomesToPlot ) 58 idx_region <- which( fdata$chromosome %in% chromosomesToPlot )
59 plot( qdnaseqObject[ idx_region, sample ], ylab=ylab_text ) 59 plot( qdnaseqObject[ idx_region, sample ], ylab=ylab_text )
60 abline( h=c(-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" ) 60 abline( h=c(-4,-3,-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" )
61 } else if( whatToPlot == 'region' ){ 61 } else if( whatToPlot == 'region' ){
62 regionC <- chrName 62 regionC <- chrName
63 regionS <- chrStart 63 regionS <- chrStart
64 regionE <- chrEnd 64 regionE <- chrEnd
65 if ( regionS > regionE ) stop("Chosen start is > end") 65 if ( regionS > regionE ) stop("Chosen start is > end")