diff --git a/R/plot_Annotations_BinnedTruthMetrics.R b/R/plot_Annotations_BinnedTruthMetrics.R index 4748defb2..9f9ee290c 100644 --- a/R/plot_Annotations_BinnedTruthMetrics.R +++ b/R/plot_Annotations_BinnedTruthMetrics.R @@ -1,4 +1,4 @@ -#!/broad/tools/apps/R-2.6.0/bin/Rscript +#!/bin/env Rscript args <- commandArgs(TRUE) verbose = TRUE @@ -187,4 +187,4 @@ pdf(outfile, height=7, width=7) par(cex=1.1) plot(all$value,all$numVariants,xlab=annotationName,log="x",ylab="Num variants in bin",type="h",xaxt="n",ps=14,lwd=4); axis(1,axTicks(1), format(axTicks(1), scientific=F)) -dev.off() \ No newline at end of file +dev.off() diff --git a/R/plot_ClusterReport.R b/R/plot_ClusterReport.R index 6a23b7808..f2288386f 100755 --- a/R/plot_ClusterReport.R +++ b/R/plot_ClusterReport.R @@ -1,4 +1,4 @@ -#!/broad/tools/apps/R-2.6.0/bin/Rscript +#!/bin/env Rscript args <- commandArgs(TRUE) verbose = TRUE @@ -16,4 +16,4 @@ maxP = max(data$knownDist, data$novelDist) plot(data$annotationValue, data$knownDist, ylim=c(0,maxP),type="b",col="orange",lwd=2,xlab=annotationName,ylab="fraction of SNPs") points(data$annotationValue, data$novelDist, type="b",col="blue",lwd=2) legend('topright', c('knowns','novels'),lwd=2,col=c("orange","blue")) -dev.off() \ No newline at end of file +dev.off() diff --git a/R/plot_OptimizationCurve.R b/R/plot_OptimizationCurve.R index c2410075a..d2f72c078 100755 --- a/R/plot_OptimizationCurve.R +++ b/R/plot_OptimizationCurve.R @@ -1,4 +1,4 @@ -#!/broad/tools/apps/R-2.6.0/bin/Rscript +#!/bin/env Rscript args <- commandArgs(TRUE) verbose = TRUE diff --git a/R/plot_residualError_OtherCovariate.R b/R/plot_residualError_OtherCovariate.R index 94072801b..a1385ff3f 100644 --- a/R/plot_residualError_OtherCovariate.R +++ b/R/plot_residualError_OtherCovariate.R @@ -1,4 +1,4 @@ -#!/broad/tools/apps/R-2.6.0/bin/Rscript +#!/bin/env Rscript args <- commandArgs(TRUE) verbose = TRUE @@ -105,4 +105,4 @@ if( is.numeric(c$Covariate) ) { } axis(2,axTicks(2), format(axTicks(2), scientific=F)) } -dev.off() \ No newline at end of file +dev.off() diff --git a/R/plot_residualError_QualityScoreCovariate.R b/R/plot_residualError_QualityScoreCovariate.R index 0df6966a6..81bc9460d 100644 --- a/R/plot_residualError_QualityScoreCovariate.R +++ b/R/plot_residualError_QualityScoreCovariate.R @@ -1,4 +1,4 @@ -#!/broad/tools/apps/R-2.6.0/bin/Rscript +#!/bin/env Rscript args <- commandArgs(TRUE) diff --git a/R/plot_variantROCCurve.R b/R/plot_variantROCCurve.R index 1b7ae9292..3469e752e 100755 --- a/R/plot_variantROCCurve.R +++ b/R/plot_variantROCCurve.R @@ -1,4 +1,4 @@ -#!/broad/tools/apps/R-2.6.0/bin/Rscript +#!/bin/env Rscript args <- commandArgs(TRUE) verbose = TRUE @@ -18,4 +18,4 @@ for(iii in 1:numCurves) { points(data[,iii*3],data[,(iii-1)*3+2],lwd=3,type="l",col=iii) } legend("bottomright", names(data)[(0:(numCurves-1))*3+1], col=1:numCurves,lwd=3) -dev.off() \ No newline at end of file +dev.off() diff --git a/R/plotting_library.R b/R/plotting_library.R index 363a89b57..45a16d10a 100644 --- a/R/plotting_library.R +++ b/R/plotting_library.R @@ -1,4 +1,4 @@ -#!/broad/tools/apps/R-2.6.0/bin/Rscript +#!/bin/env Rscript args <- commandArgs(TRUE) fileToRead <- args[1] @@ -94,4 +94,4 @@ PlotHeatmap <- function(inFile,args) { PlotHeatmap(fileToRead,functionSpecificArgs) -} \ No newline at end of file +} diff --git a/R/titvFPEst.R b/R/titvFPEst.R index 19d6d2f65..09c0774e3 100755 --- a/R/titvFPEst.R +++ b/R/titvFPEst.R @@ -41,3 +41,7 @@ cumhist <- function(d) { h <- hist(d) #plot(h$mids, cumsum(h$count), type="b", col="orange", lwd=2) } + +revcumsum <- function(x) { + return(rev(cumsum(rev(x)))) +}