changeset 2:a312a0fdaf31 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_markdup commit e33502c1fc025859ccbcd2a273f837fac9d322e0"
author iuc
date Thu, 22 Apr 2021 12:58:55 +0000
parents 83b8e36e9cbe
children d0a568e1904b
files macros.xml samtools_markdup.xml test-data/7_two_read_mapped.sam
diffstat 3 files changed, 51 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Fri Sep 06 06:35:26 2019 -0400
+++ b/macros.xml	Thu Apr 22 12:58:55 2021 +0000
@@ -77,18 +77,18 @@
        <param name="seed" type="integer" optional="True" label="Seed for random number generator" help="If empty a random seed is used." /> 
     </xml>
     <xml name="flag_options">
-        <option value="1">read is paired</option>
-        <option value="2">read is mapped in a proper pair</option>
-        <option value="4">read is unmapped</option>
-        <option value="8">mate is unmapped</option>
-        <option value="16">read reverse strand</option>
-        <option value="32">mate reverse strand</option>
-        <option value="64">read is the first in a pair</option>
-        <option value="128">read is the second in a pair</option>
-        <option value="256">alignment or read is not primary</option>
-        <option value="512">read fails platform/vendor quality checks</option>
-        <option value="1024">read is a PCR or optical duplicate</option>
-        <option value="2048">supplementary alignment</option>
+        <option value="1">Read is paired</option>
+        <option value="2">Read is mapped in a proper pair</option>
+        <option value="4">Read is unmapped</option>
+        <option value="8">Mate is unmapped</option>
+        <option value="16">Read is mapped to the reverse strand of the reference</option>
+        <option value="32">Mate is mapped to the reverse strand of the reference</option>
+        <option value="64">Read is the first in a pair</option>
+        <option value="128">Read is the second in a pair</option>
+        <option value="256">Alignment of the read is not primary</option>
+        <option value="512">Read fails platform/vendor quality checks</option>
+        <option value="1024">Read is a PCR or optical duplicate</option>
+        <option value="2048">Alignment is supplementary</option>
     </xml>
 
     <!-- region specification macros and tokens for tools that allow the specification 
--- a/samtools_markdup.xml	Fri Sep 06 06:35:26 2019 -0400
+++ b/samtools_markdup.xml	Thu Apr 22 12:58:55 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="samtools_markdup" name="Samtools markdup" version="@TOOL_VERSION@+galaxy2">
+<tool id="samtools_markdup" name="Samtools markdup" version="@TOOL_VERSION@+galaxy3">
     <description>marks duplicate alignments</description>
     <macros>
         <import>macros.xml</import>
@@ -31,7 +31,7 @@
 coordsort.sam 
 '$output'
 #if $stats
-    2> '$stats_output'
+    2> >(tee -a '$stats_output' >&2)
 #end if
     ]]></command>
     <inputs>
@@ -44,7 +44,7 @@
     <outputs>
         <!-- output bam, if input was name sorted then restore this sorting order -->
         <data name="output" format="bam"/>
-        <data name="stats_output" format="txt">
+        <data name="stats_output" format="txt" label="${tool.name} on ${on_string}: statistics">
             <filter>stats</filter>
         </data>
     </outputs>
@@ -81,6 +81,20 @@
             <output name="output" file="5_markdup.expected.bam" />
             <output name="stats_output" file="stats.txt" />
         </test>
+        <!-- check that stderr is not swallowed w test data from fixmate  -->
+        <test expect_num_outputs="2" expect_exit_code="1" expect_failure="true">
+            <param name="bamfile" value="7_two_read_mapped.sam" />
+            <param name="stats" value="true"/>
+            <!-- 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>
+        </test>
     </tests>
     <help>
 Mark duplicate alignments from a coordinate sorted file that has been run through fixmate with the -m option. This program relies on the MC and ms tags that fixmate provides. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/7_two_read_mapped.sam	Thu Apr 22 12:58:55 2021 +0000
@@ -0,0 +1,22 @@
+@HD	VN:1.4	SO:queryname
+@SQ	SN:ref1	LN:45
+@SQ	SN:ref2	LN:40
+of1	99	ref1	10	30	23M	=	8	2	AAGTCGGCAGCGTCAGATGTGTA	???????????????????????
+of1	147	ref1	8	30	23M	=	10	-2	CTGTCTCTTATACACATCTCCTT	???????????????????????
+r001	83	ref1	37	30	9M	=	7	-39	CAGCGCCAT	*
+r001	163	ref1	7	30	8M4I4M1D3M	=	37	39	TTAGATAAAGAGGATACTG	*	XX:B:S,12561,2,20,112	YY:i:100
+r002	0	ref1	9	30	1S2I6M1P1I1P1I4M2I	*	0	0	AAAAGATAAGGGATAAA	*	XA:Z:abc	XB:i:-10
+r003	0	ref1	9	30	5H6M	*	0	0	AGCTAA	*
+r003	16	ref1	29	30	6H5M	*	0	0	TAGGC	*
+r004	0	ref1	16	30	6M14N1I5M	*	0	0	ATAGCTCTCAGC	*
+r007	8	ref1	9	30	5H6M	*	0	0	AGCTAA	*
+r007	4	ref1	9	30	*	*	0	0	GGGGGG	*
+r008	12	ref1	9	30	5H6M	*	0	0	AGCTAA	*
+r008	4	ref1	9	30	*	*	0	0	GGGGGG	*
+uu1	4	*	0	30	*	*	0	0	TAATTGGGTCTTCAGAGCACCTA	???????????????????????
+x1	0	ref2	1	30	20M	*	0	0	AGGTTTTATAAAACAAATAA	*
+x2	0	ref2	2	30	21M	*	0	0	GGTTTTATAAAACAAATAATT	?????????????????????
+x3	0	ref2	6	30	9M4I13M	*	0	0	TTATAAAACAAATAATTAAGTCTACA	??????????????????????????
+x4	0	ref2	10	30	25M	*	0	0	CAAATAATTAAGTCTACAGAGCAAC	?????????????????????????
+x5	0	ref2	12	30	24M	*	0	0	AATAATTAAGTCTACAGAGCAACT	????????????????????????
+x6	0	ref2	14	30	23M	*	0	0	TAATTAAGTCTACAGAGCAACTA	???????????????????????