changeset 3:4f744d3aaf0b draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/probecoverage commit 8159fa0b4667a953c05aca50d412c33e619b5080
author artbio
date Sun, 24 Sep 2017 14:47:11 -0400
parents 35d2db3753d9
children daec4df60281
files probecoverage.r probecoverage.xml test-data/graph_pysam.pdf
diffstat 3 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/probecoverage.r	Sun Sep 24 13:34:16 2017 -0400
+++ b/probecoverage.r	Sun Sep 24 14:47:11 2017 -0400
@@ -12,6 +12,7 @@
     make_option("--xlab", type = "character", help="X-axis legend"),
     make_option("--ylab", type = "character", help="Y-axis legend"),
     make_option("--sample", type = "character", help="a space separated of sample labels"),
+    make_option("--method", type = "character", help="bedtools or pysam"),
     make_option(c("-o", "--output"), type = "character", help="path to the pdf plot")
     )
  
@@ -30,8 +31,11 @@
 }
 
 ## function
-
-cumul <- function(x,y) sum(Table[,y]/(Table$end-Table$start) > x)/length(Table$chromosome)
+if (args$method == 'bedtools') {
+    cumul <- function(x,y) sum(Table[,y]/(Table$end-Table$start) > x)/length(Table$chromosome)
+    } else {
+    cumul <- function(x,y) sum(Table[,y] > x)/length(Table$chromosome)
+    }
 scaleFUN <- function(x) sprintf("%.3f", x)
 
 ## end of function
--- a/probecoverage.xml	Sun Sep 24 13:34:16 2017 -0400
+++ b/probecoverage.xml	Sun Sep 24 14:47:11 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="probecoverage" name="Probe Coverage" version="0.3.0">
+<tool id="probecoverage" name="Probe Coverage" version="0.4.0">
   <description></description>
   <requirements>
         <requirement type="package" version="1.4.1">samtools</requirement>
@@ -26,6 +26,7 @@
               #end for
           -bed '$bed' > $coverage_dataframe &&
       Rscript '$__tool_directory__'/probecoverage.r
+          --method '$method'
           --input '$coverage_dataframe' 
           --title 'Probe coverage depth (cumulative distribution)'
           --xlab
Binary file test-data/graph_pysam.pdf has changed