changeset 0:c04bee391baa draft

Uploaded
author devteam
date Wed, 18 Mar 2015 16:43:50 -0400
parents
children 8c3472790020
files macros.xml samtools_bedcov.xml test-data/eboVir3.1.bed test-data/eboVir3.2.bam test-data/eboVir3.2.bed test-data/eboVir3.bam test-data/samtools_bedcov_out1.tab test-data/samtools_bedcov_out2.tab tool_dependencies.xml
diffstat 9 files changed, 96 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Wed Mar 18 16:43:50 2015 -0400
@@ -0,0 +1,21 @@
+<macros>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="1.2">samtools</requirement>
+            <yield/>
+        </requirements>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1093/bioinformatics/btp352</citation>
+        </citations>
+    </xml>
+    <xml name="version_command">
+        <version_command>samtools --version | head -n 1 | awk '{ print $2 }'</version_command>
+    </xml>
+    <xml name="stdio">
+        <stdio>
+            <exit_code range="1:" level="fatal" description="Error" />
+        </stdio>
+    </xml>
+</macros>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/samtools_bedcov.xml	Wed Mar 18 16:43:50 2015 -0400
@@ -0,0 +1,57 @@
+<tool id="samtools_bedcov" name="Calculate read depth" version="1.0.1">
+  <description>on BAM files</description>
+  <macros>
+    <import>macros.xml</import>
+  </macros>
+  <expand macro="requirements"></expand>
+    <expand macro="version_command"></expand>
+    <expand macro="stdio"></expand>
+    <command><![CDATA[
+        for bamfile in 
+        #for dataset in $input_bams:
+            "${dataset}"
+        #end for
+        ; do
+            if [ ! -f \$bamfile.bai ] ; then
+                ln -s \$bamfile && samtools index `basename \$bamfile` ;
+            else
+                ln -s \$bamfile && ln -s \$bamfile.bai ;
+            fi ;
+        done ;
+        samtools bedcov "${input_bed}"
+        #for dataset in $input_bams:
+            `basename "${dataset}"`
+        #end for
+        > "${output}"
+        ]]>
+    </command>
+    <inputs>
+        <param name="input_bed" type="data" format="bed" label="BED file" />
+        <param name="input_bams" type="data" format="bam" label="BAM file" multiple="true" />
+    </inputs>
+    <outputs>
+        <data format="tabular" name="output" label="${tool.name} on ${on_string}" />
+    </outputs>
+    <tests>
+        <test>
+            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
+            <param name="input_bams" value="eboVir3.bam" ftype="bam" />
+            <output name="output" file="samtools_bedcov_out1.tab" />
+        </test>
+        <test>
+            <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
+            <param name="input_bams" value="eboVir3.bam,eboVir3.2.bam" ftype="bam" />
+            <output name="output" file="samtools_bedcov_out2.tab" />
+        </test>
+    </tests>
+    <help>
+**What it does**
+
+This tool runs the ``samtools bedcov`` command in the SAMtools toolkit.
+
+Show read depth per BED region.
+
+    </help>
+    <expand macro="citations"></expand>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/eboVir3.1.bed	Wed Mar 18 16:43:50 2015 -0400
@@ -0,0 +1,3 @@
+eboVir3	500	1500
+eboVir3	1500	2000
+eboVir3	1500	3000
Binary file test-data/eboVir3.2.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/eboVir3.2.bed	Wed Mar 18 16:43:50 2015 -0400
@@ -0,0 +1,3 @@
+eboVir3	500	1500
+eboVir3	1500	2000
+eboVir3	1500	3000
Binary file test-data/eboVir3.bam has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/samtools_bedcov_out1.tab	Wed Mar 18 16:43:50 2015 -0400
@@ -0,0 +1,3 @@
+eboVir3	500	1500	7919
+eboVir3	1500	2000	3009
+eboVir3	1500	3000	9986
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/samtools_bedcov_out2.tab	Wed Mar 18 16:43:50 2015 -0400
@@ -0,0 +1,3 @@
+eboVir3	500	1500	7919	2094
+eboVir3	1500	2000	3009	1064
+eboVir3	1500	3000	9986	3455
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Wed Mar 18 16:43:50 2015 -0400
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <package name="samtools" version="1.2">
+        <repository changeset_revision="6eea04363026" name="package_samtools_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+</tool_dependency>