Mercurial > repos > geert-vandeweyer > coverage_report
diff CoverageReport.pl @ 22:95062840f80f draft
Correction to png calls to use cairo instead of x11. thanks to Eric Enns for pointing this out.
author | geert-vandeweyer |
---|---|
date | Mon, 17 Nov 2014 07:10:11 -0500 |
parents | 86df3f847a72 |
children | fd788f9db899 |
line wrap: on
line diff
--- a/CoverageReport.pl Thu Nov 06 04:28:02 2014 -0500 +++ b/CoverageReport.pl Mon Nov 17 07:10:11 2014 -0500 @@ -208,7 +208,7 @@ open OUT, ">$wd/Rout/boxplot.R"; print OUT 'coverage <- read.table("../Targets.Global.Coverage",as.is=TRUE,sep="\t",header=FALSE)'."\n"; print OUT 'coverage <- coverage[,'.$covcol.']'."\n"; -print OUT 'png(file="../Plots/CoverageBoxPlot.png", bg="white", width=240, height=480)'."\n"; +print OUT 'png(file="../Plots/CoverageBoxPlot.png", bg="white", width=240, height=480,type=c("cairo"))'."\n"; print OUT 'boxplot(coverage,range=1.5,main="Target Region Coverage")'."\n"; print OUT 'graphics.off()'."\n"; close OUT; @@ -274,7 +274,7 @@ print OUT ' }'."\n"; print OUT '}'."\n"; # open output image and create plot -print OUT 'png(file="../Plots/CoverageNtPlot.png", bg="white", width=540, height=480)'."\n"; +print OUT 'png(file="../Plots/CoverageNtPlot.png", bg="white", width=540, height=480,type=c("cairo"))'."\n"; print OUT 'par(xaxs="i",yaxs="i")'."\n"; print OUT 'plot(values$cov,values$count,ylim=c(0,100),pch=".",main="Cumulative Normalised Base-Coverage Plot",xlab="Normalizalised Coverage",ylab="Cumulative Nr. Of Bases")'."\n"; print OUT 'lines(values$cov,values$count)'."\n"; @@ -423,7 +423,7 @@ } my $width = 480 * $scale; my $height = 240 * $scale; - print OUT 'png(file="../Plots/Coverage_'.$currgroup.'.png", bg="white", width='.$width.', height='.$height.')'."\n"; + print OUT 'png(file="../Plots/Coverage_'.$currgroup.'.png", bg="white", width='.$width.', height='.$height.',type=c("cairo"))'."\n"; print OUT 'ylim = c(0,max(max(log10(coverage),log10('.($thresh+20).'))))'."\n"; print OUT 'mp <- barplot(log10(coverage),col=colors,main="Exon Coverage for '.$currgroup.'",ylab="Log10(Coverage)",ylim=ylim)'."\n"; print OUT 'text(mp, log10(coverage) + '.(0.4/$scale).',format(coverage),xpd = TRUE,srt=90)'."\n"; @@ -465,7 +465,7 @@ } my $width = 480 * $scale; my $height = 240 * $scale; - print OUT 'png(file="../Plots/Coverage_'.$currgroup.'.png", bg="white", width='.$width.', height='.$height.')'."\n"; + print OUT 'png(file="../Plots/Coverage_'.$currgroup.'.png", bg="white", width='.$width.', height='.$height.',type=c("cairo"))'."\n"; print OUT 'ylim = c(0,max(max(log10(coverage),log10('.($thresh+20).'))))'."\n"; print OUT 'mp <- barplot(log10(coverage),col=colors,main="Exon Coverage for '.$currgroup.'",ylab="Log10(Coverage)", ylim=ylim)'."\n"; print OUT 'text(mp, log10(coverage) + log10(2),format(coverage),xpd = TRUE,srt=90)'."\n"; @@ -561,7 +561,7 @@ $exonstr =~ s/\s/_/g; $exon =~ s/_/ /g; $exon =~ s/\|/ /g; - print OUT 'png(file="../Plots/Coverage_'.$exonstr.'.png", bg="white", width='.$width.', height='.$height.')'."\n"; + print OUT 'png(file="../Plots/Coverage_'.$exonstr.'.png", bg="white", width='.$width.', height='.$height.',type=c("cairo"))'."\n"; print OUT 'ylim = c(0,log10(max(max(coverage),'.($thresh+10).')))'."\n"; if ($orient eq '-') { print OUT 'plot(positions,log10(coverage),type="n",main="Coverage for '.$exon.'",ylab="log10(Coverage)",ylim=ylim,xlab="Position",xlim=rev(range(positions)),sub="(Transcribed from minus strand)")'."\n"; @@ -658,7 +658,7 @@ $exonstr =~ s/\s/_/g; $exon =~ s/_/ /g; $exon =~ s/\|/ /g; - print OUT 'png(file="../Plots/Coverage_'.$exonstr.'.png", bg="white", width='.$width.', height='.$height.')'."\n"; + print OUT 'png(file="../Plots/Coverage_'.$exonstr.'.png", bg="white", width='.$width.', height='.$height.',type=c("cairo"))'."\n"; print OUT 'ylim = c(0,log10(max(max(coverage),'.($thresh+10).')))'."\n"; if ($orient eq '-') { print OUT 'plot(positions,log10(coverage),type="n",main="Coverage for '.$exon.'",ylab="log10(Coverage)",ylim=ylim,xlab="Position",xlim=rev(range(positions)),sub="(Transcribed from minus strand)")'."\n";