changeset 1:1f18d80df2a5 draft

Uploaded
author devteam
date Wed, 11 Feb 2015 17:41:13 -0500
parents a7a49d31c5cf
children 1977f1637890
files sam_merge.xml test-data/sam_merge_out1.bam test-data/sam_merge_out1.log test-data/sam_merge_out2.log tool_dependencies.xml tool_test_output.json
diffstat 6 files changed, 50 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/sam_merge.xml	Mon Aug 26 14:20:22 2013 -0400
+++ b/sam_merge.xml	Wed Feb 11 17:41:13 2015 -0500
@@ -1,62 +1,56 @@
-<tool id="sam_merge2" name="Merge BAM Files" version="1.1.2">
-  <description>merges BAM files together</description>
-  <requirements>
-    <requirement type="package" version="1.56.0">picard</requirement>
-  </requirements>
-  <command>
-java -Xmx2G -jar \$JAVA_JAR_PATH/MergeSamFiles.jar MSD=$mergeSD VALIDATION_STRINGENCY=LENIENT O=$output1 I=$input1 I=$input2 TMP_DIR=$__new_file_path__
-      #for $i in $inputs
-        I=${i.input}
-      #end for 
-    2&gt; $outlog
-    || echo "Error running Picard MergeSamFiles" >&amp;2
-  </command>
-  <inputs>
-    <param name="title" label="Name for the output merged bam file" type="text" default="Merged.bam"
-       help="This name will appear in your history so use it to remember what the new file in your history contains" />
-    <param name="mergeSD" value="true" type="boolean"  label="Merge all component bam file headers into the merged bam file"
-      truevalue="true" falsevalue="false" checked="yes" 
-      help="Control the MERGE_SEQUENCE_DICTIONARIES flag for Picard MergeSamFiles. Default (true) correctly propagates read groups and other important metadata" />
-    <param name="input1" label="First file" type="data" format="bam,sam" />
-    <param name="input2" label="with file" type="data" format="bam,sam" help="Need to add more files? Use controls below." />
-    <repeat name="inputs" title="Input Files">
-      <param name="input" label="Add file" type="data" format="bam,sam" />
-    </repeat>
-  </inputs>
-  <outputs>
-    <data format="bam" name="output1" label="${title}.bam" />
-    <data format="txt" name="outlog" label="${title}_${tool.name}.log" />
-  </outputs>
-  <tests>
-    <!-- TODO: add ability to test framework to test without at least 
-         one repeat element value
-    -->
-    <test>
-      <param name="title" value="test1" />
-      <param name="mergeSD" value="true" />
-      <param name="input1" value="sam_merge_in1.bam" ftype="bam" /> 
-      <param name="input2" value="sam_merge_in2.bam" ftype="bam" />
-      <output name="output1" file="sam_merge_out1.bam" ftype="bam" />
-      <output name="outlog" file="sam_merge_out1.log" ftype="txt" lines_diff="11"/>
-    </test>
-    <test>
-      <param name="title" value="test2" />
-      <param name="mergeSD" value="true" />
-      <param name="input1" value="sam_merge_in1.bam" ftype="bam" /> 
-      <param name="input2" value="sam_merge_in2.bam" ftype="bam" />
-      <param name="input" value="sam_merge_in3.bam" ftype="bam" />
-      <output name="output1" file="sam_merge_out2.bam" ftype="bam" />
-      <output name="outlog" file="sam_merge_out2.log" ftype="txt" lines_diff="11"/>
-    </test>
+<tool id="sam_merge2" name="Merge BAM Files" version="1.2.0">
+    <description>merges BAM files together</description>
+    <requirements>
+        <requirement type="package" version="1.56.0">picard</requirement>
+    </requirements>
+    <stdio>
+        <exit_code range="1:" />
+        <exit_code range=":-1" />
+        <regex match="Error:" />
+        <regex match="Exception:" />
+    </stdio>
+    <command>
+<![CDATA[
+        java -Xmx2G
+            -jar \$JAVA_JAR_PATH/MergeSamFiles.jar
+            MSD=$mergeSD
+            VALIDATION_STRINGENCY=LENIENT
+            O="$output1"
+            TMP_DIR=$__new_file_path__
+            #for $input in $inputs
+                I="${input}"
+            #end for
+]]>
+    </command>
+    <inputs>
+        <param name="inputs" type="data" format="bam,sam" multiple="True" label="Files to merge" />
+        <param name="mergeSD" type="boolean" label="Merge all component bam file headers into the merged bam file"
+            truevalue="true" falsevalue="false" checked="yes" 
+            help="Control the MERGE_SEQUENCE_DICTIONARIES flag for Picard MergeSamFiles. Default (true) correctly propagates read groups and other important metadata" />
+    </inputs>
+    <outputs>
+        <data format="bam" name="output1" />
+    </outputs>
+    <tests>
+        <test>
+            <param name="mergeSD" value="true" />
+            <param name="inputs" value="sam_merge_in1.bam,sam_merge_in2.bam" ftype="bam" /> 
+            <output name="output1" file="sam_merge_out1.bam" ftype="bam" />
+        </test>
+        <test>
+            <param name="mergeSD" value="true" />
+            <param name="inputs" value="sam_merge_in1.bam,sam_merge_in2.bam,sam_merge_in3.bam" ftype="bam" /> 
+            <output name="output1" file="sam_merge_out2.bam" ftype="bam" />
+        </test>
   </tests>
   <help>
-
+<![CDATA[
 **What it does**
 
 This tool uses the Picard_ merge command to merge any number of BAM files together into one BAM file while preserving the BAM
-metadata such as read groups
+metadata such as read groups.
 
-.. _Picard: http://picard.sourceforge.net/command-line-overview.shtml#MergeSamFiles
-
+.. _Picard: http://broadinstitute.github.io/picard/
+]]>
   </help>
 </tool>
Binary file test-data/sam_merge_out1.bam has changed
--- a/test-data/sam_merge_out1.log	Mon Aug 26 14:20:22 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-[Thu Aug 04 13:48:49 EST 2011] net.sf.picard.sam.MergeSamFiles INPUT=[/data/tmp/tmpjnE9mC/database/files/000/dataset_1.dat, /data/tmp/tmpjnE9mC/database/files/000/dataset_2.dat, /data/tmp/tmpjnE9mC/database/files/000/dataset_2.dat] OUTPUT=/data/tmp/tmpjnE9mC/database/files/000/dataset_3.dat MERGE_SEQUENCE_DICTIONARIES=true VALIDATION_STRINGENCY=LENIENT    SORT_ORDER=coordinate ASSUME_SORTED=false USE_THREADING=false TMP_DIR=/tmp/rlazarus VERBOSITY=INFO QUIET=false COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
-INFO	2011-08-04 13:48:49	MergeSamFiles	Sorting input files using temp directory /tmp/rlazarus
-INFO	2011-08-04 13:48:49	MergeSamFiles	Finished reading inputs.
-[Thu Aug 04 13:48:49 EST 2011] net.sf.picard.sam.MergeSamFiles done.
-Runtime.totalMemory()=2028732416
--- a/test-data/sam_merge_out2.log	Mon Aug 26 14:20:22 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-[Thu Aug 04 13:49:53 EST 2011] net.sf.picard.sam.MergeSamFiles INPUT=[/data/tmp/tmpjnE9mC/database/files/000/dataset_5.dat, /data/tmp/tmpjnE9mC/database/files/000/dataset_6.dat, /data/tmp/tmpjnE9mC/database/files/000/dataset_7.dat] OUTPUT=/data/tmp/tmpjnE9mC/database/files/000/dataset_8.dat MERGE_SEQUENCE_DICTIONARIES=true VALIDATION_STRINGENCY=LENIENT    SORT_ORDER=coordinate ASSUME_SORTED=false USE_THREADING=false TMP_DIR=/tmp/rlazarus VERBOSITY=INFO QUIET=false COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
-INFO	2011-08-04 13:49:54	MergeSamFiles	Sorting input files using temp directory /tmp/rlazarus
-INFO	2011-08-04 13:49:54	MergeSamFiles	Finished reading inputs.
-[Thu Aug 04 13:49:54 EST 2011] net.sf.picard.sam.MergeSamFiles done.
-Runtime.totalMemory()=2028732416
--- a/tool_dependencies.xml	Mon Aug 26 14:20:22 2013 -0400
+++ b/tool_dependencies.xml	Wed Feb 11 17:41:13 2015 -0500
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <tool_dependency>
     <package name="picard" version="1.56.0">
-        <repository changeset_revision="61e41d21cb6f" name="package_picard_1_56_0" owner="devteam" toolshed="http://toolshed.g2.bx.psu.edu" />
+        <repository changeset_revision="99a28567c3a3" name="package_picard_1_56_0" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_test_output.json	Wed Feb 11 17:41:13 2015 -0500
@@ -0,0 +1,1 @@
+{"tests": [{"data": null, "id": "functional.test_toolbox.TestForTool_sam_merge2.test_tool_000000", "has_data": false}, {"data": null, "id": "functional.test_toolbox.TestForTool_sam_merge2.test_tool_000001", "has_data": false}], "version": "0.1", "summary": {"num_skips": 0, "num_errors": 2, "num_failures": 0, "num_tests": 2}}
\ No newline at end of file