# HG changeset patch # User stef # Date 1432835143 14400 # Node ID 5eec30e0fcce5abab6c5933cf93558bfb314516d # Parent 67cbaa54fa037ea7a55851748b437c1933cce413 Uploaded diff -r 67cbaa54fa03 -r 5eec30e0fcce QDNAseq-plot.R --- a/QDNAseq-plot.R Fri May 08 05:59:20 2015 -0400 +++ b/QDNAseq-plot.R Thu May 28 13:45:43 2015 -0400 @@ -37,11 +37,36 @@ catMsg( c( rVersion ) ) qdnaseqObject <- readRDS( rdsFilePath ) +chromosomesToPlot <- unlist( strsplit( chromosomesToPlotString, ",") ) + +#cat( "CHROM: ", chromosomesToPlotString, "\n" ) +#cat( "REGION: ", regionToPlotString, "\n" ) +#cat( "What to plot: ", whatToPlot, "\n" ) + ## COPYNUMBER PLOT sample <- SAMPLE_INDEX png( outputPngPath, width=PLOT_WIDTH, height=PLOT_HEIGHT, res=PLOT_RES ) par( PAR_SET ) - plot( qdnaseqObject[ ,sample ] ) + if ( whatToPlot == 'everything' ){ + catMsg( c( "Plotting all data in object" ) ) + plot( qdnaseqObject[ ,sample ] ) + } 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 ] ) + } else if( whatToPlot == 'region' ){ + regionC <- chrName + regionS <- chrStart + regionE <- chrEnd + if ( regionS > regionE ) stop("Chosen start is > end") + catMsg( c( "Plotting genomic region (chr=", regionC, " start=", regionS, " end=", regionE, ")" ) ) + + fdata <- qdnaseqObject@featureData@data + idx_region <- which( fdata$chromosome == regionC & fdata$start > regionS & fdata$end < regionE ) + + plot( qdnaseqObject[ idx_region, sample ], doCalls=FALSE ) + } #mtext( "plotted in galaxy", 3 ) abline( h=c(-2,-1,1,2,3,4), lty=1, lwd=0.5, col="grey" ) dev.off() diff -r 67cbaa54fa03 -r 5eec30e0fcce QDNAseq-plot.xml --- a/QDNAseq-plot.xml Fri May 08 05:59:20 2015 -0400 +++ b/QDNAseq-plot.xml Thu May 28 13:45:43 2015 -0400 @@ -1,4 +1,4 @@ - + @@ -16,6 +16,8 @@ $cfg + QDNAseq-version.R + @@ -57,7 +59,53 @@ --> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -98,6 +146,11 @@ "${outputPng}" -> outputPngPath "${rdsFile}" -> rdsFilePath as.integer( "${sample_index}" ) -> SAMPLE_INDEX +"${subset_selection.what_to_plot}" -> whatToPlot +"${subset_selection.chromosomes}" -> chromosomesToPlotString +"${subset_selection.chr_name}" -> chrName +"${subset_selection.chr_start}" -> chrStart +"${subset_selection.chr_end}" -> chrEnd ## ----- ## extra options diff -r 67cbaa54fa03 -r 5eec30e0fcce QDNAseq-version.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QDNAseq-version.R Thu May 28 13:45:43 2015 -0400 @@ -0,0 +1,1 @@ +cat( packageDescription("QDNAseq", fields = "Version") ) \ No newline at end of file diff -r 67cbaa54fa03 -r 5eec30e0fcce QDNAseq.xml --- a/QDNAseq.xml Fri May 08 05:59:20 2015 -0400 +++ b/QDNAseq.xml Thu May 28 13:45:43 2015 -0400 @@ -19,6 +19,8 @@ \$QDNASEQ_PATH + QDNAseq-version.R +