diff samtools_markdup.xml @ 8:a389f74c3630 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_markdup commit cd62639660bef041ba14ecff337fb98e84e75d8a
author iuc
date Mon, 20 Nov 2023 22:15:54 +0000
parents ce32171c6d44
children 40fa6c240105
line wrap: on
line diff
--- a/samtools_markdup.xml	Fri Apr 07 21:47:07 2023 +0000
+++ b/samtools_markdup.xml	Mon Nov 20 22:15:54 2023 +0000
@@ -1,4 +1,4 @@
-<tool id="samtools_markdup" name="Samtools markdup" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@" >
+<tool id="samtools_markdup" name="Samtools markdup" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" >
     <description>marks duplicate alignments</description>
     <macros>
         <import>macros.xml</import>
@@ -51,7 +51,7 @@
 '$output'
     ]]></command>
     <inputs>
-        <param name="bamfile" type="data" format="sam,bam,cram" optional="false" label="Alignment" />
+        <param name="bamfile" type="data" format="sam,unsorted.bam,cram" optional="false" label="Alignment" />
         <param name="remove" type="boolean" argument="-r" truevalue="-r" falsevalue="" label="Remove duplicate reads" />
         <param name="supp" type="boolean" argument="-S" truevalue="-S" falsevalue="" label="Mark supplementary reads of duplicates as duplicates" />
         <param name="existing_tags" type="boolean" argument="-c" truevalue="-c" falsevalue="" label="Clear previous duplicate settings and tags." />
@@ -108,9 +108,12 @@
         </test>
         <!-- 3) -->
         <test expect_num_outputs="1">
-            <param name="bamfile" value="3_mark_supp_dup.bam" ftype="bam"  />
+            <param name="bamfile" value="3_mark_supp_dup.bam" ftype="bam" />
             <param name="supp" value="-S" />
             <output name="output" file="3_mark_supp_dup.expected.bam" ftype="bam" lines_diff="4" />
+            <assert_command>
+                <has_text text="samtools sort" negate="true"/>
+            </assert_command>
         </test>
         <!-- 4) test stats output -->
         <test expect_num_outputs="2">
@@ -120,15 +123,9 @@
             <output name="stats_output" file="stats.txt" lines_diff="2" />
         </test>
         <!-- 5) check that stderr is not swallowed w test data from fixmate  -->
-        <test expect_num_outputs="2" expect_exit_code="1" expect_failure="true">
+        <test expect_exit_code="1" expect_failure="true">
             <param name="bamfile" value="3_two_read_mapped.sam" ftype="sam" />
             <param name="stats" value="yes"/>
-            <!-- for some reason this is not possible at the moment
-            <output name="stats_output">
-                <assert_contents>
-                    <has_line line="[markdup] error: no MC tag. Please run samtools fixmate on file first."/>
-                </assert_contents>
-            </output> -->
             <assert_stderr>
                 <has_line line="[markdup] error: no MC tag. Please run samtools fixmate on file first."/>
             </assert_stderr>
@@ -158,12 +155,27 @@
             <param name="select_oformat" value="SAM" />
             <output name="output" file="9_markdup.expected.sam" ftype="sam" lines_diff="4" />
         </test>
-        <!-- 10) test cram format -->
+        <!-- 10) essentially the same as test 9 (just converted input to sorted bam .. but telling Galaxy its qname sorted)
+                to test qname sorted bam format and ensure that sorting happens in the tool
+                ie. the qname_sorted bam is not converted implicitly -->
+        <test expect_num_outputs="1">
+            <param name="bamfile" value="1_markdup.qname_sorted.bam" ftype="qname_sorted.bam" />
+            <param name="select_oformat" value="SAM" />
+            <output name="output" file="9_markdup.expected.sam" lines_diff="4" />
+            <assert_command>
+                <has_text text="samtools sort"/>
+            </assert_command>
+        </test>
+
+        <!-- 11) test cram format -->
         <test expect_num_outputs="1">
             <param name="bamfile" value="10_markdup.sam" ftype="sam"/>
             <param name="select_oformat" value="CRAM" />
             <param name="ref_file" value="test.fa" />
-            <output name="output" file="10_markdup.expected.cram" ftype="cram" compare="sim_size" delta="250"/>
+            <output name="output" file="11_markdup.expected.cram" ftype="cram" compare="sim_size" delta="250"/>
+            <assert_command>
+                <has_text text="samtools sort"/>
+            </assert_command>
         </test>
     </tests>
     <help>