changeset 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
files macros.xml samtools_markdup.xml test-data/10_markdup.expected.cram test-data/11_markdup.expected.cram test-data/1_markdup.qname_sorted.bam
diffstat 5 files changed, 32 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Fri Apr 07 21:47:07 2023 +0000
+++ b/macros.xml	Mon Nov 20 22:15:54 2023 +0000
@@ -5,7 +5,14 @@
             <yield/>
         </requirements>
     </xml>
+    <!-- NOTE: for some tools only the version of the requirement but not the
+        tool's version is controlled by the TOOL_VERSION token 
+        (because their version is ahead of the requirement version .. 
+         please only bump the minor version in order to let the requirement
+         version catch up eventually). To find the tools check:
+        `grep "<tool" . -r | grep -v VERSION_SUFFIX | cut -d":" -f 1` -->
     <token name="@TOOL_VERSION@">1.15.1</token>
+    <token name="@VERSION_SUFFIX@">2</token>
     <token name="@PROFILE@">20.05</token>
     <token name="@FLAGS@"><![CDATA[
         #set $flags = 0
@@ -212,37 +219,7 @@
 
     <xml name="citations">
         <citations>
-            <citation type="bibtex">
-                @misc{SAM_def,
-                title={Definition of SAM/BAM format},
-                url = {https://samtools.github.io/hts-specs/},}
-            </citation>
-            <citation type="doi">10.1093/bioinformatics/btp352</citation>
-            <citation type="doi">10.1093/bioinformatics/btr076</citation>
-            <citation type="doi">10.1093/bioinformatics/btr509</citation>
-            <citation type="bibtex">
-                @misc{Danecek_et_al,
-                Author={Danecek, P., Schiffels, S., Durbin, R.},
-                title={Multiallelic calling model in bcftools (-m)},
-                url = {http://samtools.github.io/bcftools/call-m.pdf},}
-            </citation>
-            <citation type="bibtex">
-                @misc{Durbin_VCQC,
-                Author={Durbin, R.},
-                title={Segregation based metric for variant call QC},
-                url = {http://samtools.github.io/bcftools/rd-SegBias.pdf},}
-            </citation>
-            <citation type="bibtex">
-                @misc{Li_SamMath,
-                Author={Li, H.},
-                title={Mathematical Notes on SAMtools Algorithms},
-                url = {http://www.broadinstitute.org/gatk/media/docs/Samtools.pdf},}
-            </citation>
-            <citation type="bibtex">
-                @misc{SamTools_github,
-                title={SAMTools GitHub page},
-                url = {https://github.com/samtools/samtools},}
-            </citation>
+            <citation type="doi">10.1093/gigascience/giab008</citation>
         </citations>
     </xml>
     <xml name="version_command">
--- 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>
Binary file test-data/10_markdup.expected.cram has changed
Binary file test-data/11_markdup.expected.cram has changed
Binary file test-data/1_markdup.qname_sorted.bam has changed