changeset 6:9038311ed624 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_fastx commit c508c3af0f4121dcc38e0be63db00a604e997b8a
author iuc
date Thu, 19 Jun 2025 12:59:30 +0000
parents b906586a6596
children
files macros.xml samtools_fastx.xml test-data/rebuild_output_files.sh
diffstat 3 files changed, 87 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Sun Sep 08 03:25:53 2024 +0000
+++ b/macros.xml	Thu Jun 19 12:59:30 2025 +0000
@@ -11,8 +11,8 @@
          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.20</token>
-    <token name="@VERSION_SUFFIX@">2</token>
+    <token name="@TOOL_VERSION@">1.21</token>
+    <token name="@VERSION_SUFFIX@">0</token>
     <token name="@PROFILE@">22.05</token>
     <token name="@FLAGS@"><![CDATA[
         #set $flags = 0
@@ -220,6 +220,7 @@
     <xml name="citations">
         <citations>
             <citation type="doi">10.1093/gigascience/giab008</citation>
+            <citation type="doi">10.1093/bioinformatics/btr076</citation>
         </citations>
     </xml>
     <xml name="version_command">
--- a/samtools_fastx.xml	Sun Sep 08 03:25:53 2024 +0000
+++ b/samtools_fastx.xml	Thu Jun 19 12:59:30 2025 +0000
@@ -236,6 +236,7 @@
     </outputs>
     <tests>
         <!-- tests from original Galaxy tool -->
+        <!-- 1 -->
         <test expect_num_outputs="1">
             <param name="input" value="samtools_fastx-in1.bam" ftype="bam" />
             <conditional name="output_fmt_cond">
@@ -244,6 +245,7 @@
             <param name="outputs" value="other" />
             <output name="output" file="samtools_fastx-out1.fasta" ftype="fasta" />
         </test>
+        <!-- 2 -->
         <test expect_num_outputs="3">
             <param name="input" value="samtools_fastx-in2.bam" ftype="bam" />
             <conditional name="output_fmt_cond">
@@ -254,6 +256,7 @@
             <output name="forward" file="samtools_fastx-out2-2.fastq" ftype="fastqsanger" />
             <output name="reverse" file="samtools_fastx-out2-3.fastq" ftype="fastqsanger" />
         </test>
+        <!-- 3 -->
         <test expect_num_outputs="3">
             <param name="input" value="samtools_fastx-in3.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -267,6 +270,7 @@
         <!-- tests from original Galaxy tool with gz output. for some reason gzip (which is used
              for compressing stdout does not give exactly the same file contents .. the other
              compressed files seem to)-->
+        <!-- 4 -->
         <test expect_num_outputs="1">
             <param name="input" value="samtools_fastx-in1.bam" ftype="bam" />
             <conditional name="output_fmt_cond">
@@ -275,6 +279,7 @@
             <param name="outputs" value="other" />
             <output name="output" file="samtools_fastx-out1.fasta.gz" ftype="fasta.gz" decompress="true"/>
         </test>
+        <!-- 5 -->
         <test expect_num_outputs="3">
             <param name="input" value="samtools_fastx-in2.bam" ftype="bam" />
             <conditional name="output_fmt_cond">
@@ -285,6 +290,7 @@
             <output name="forward" file="samtools_fastx-out2-2.fastq.gz" ftype="fastqsanger.gz" decompress="true" />
             <output name="reverse" file="samtools_fastx-out2-3.fastq.gz" ftype="fastqsanger.gz" decompress="true" />
         </test>
+        <!-- 6 -->
         <test expect_num_outputs="3">
             <param name="input" value="samtools_fastx-in3.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -298,6 +304,7 @@
         <!-- tests from: https://github.com/samtools/samtools/blob/6d79411685d8f0fbb34e123f52d72b63271f4dcb/test/test.pl#L2313-->
         <!--# basic 2 output test without singleton tracking-->
         <!--test_cmd($opts, out=>'bam2fq/1.stdout.expected', out_map=>{'1.fq' => 'bam2fq/1.1.fq.expected', '2.fq' => 'bam2fq/1.2.fq.expected'},cmd=>"$$opts{bin}/samtools fastq @$threads -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.001.sam");-->
+        <!-- 7 -->
         <test expect_num_outputs="3">
             <param name="input" value="bam2fq.001.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -310,6 +317,7 @@
         </test>
         <!--# basic 2 output test with singleton tracking but no singleton-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/2.1.fq.expected', '2.fq' => 'bam2fq/2.2.fq.expected', 's.fq' => 'bam2fq/2.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.001.sam");-->
+        <!-- 8 -->
         <test expect_num_outputs="4">
             <param name="input" value="bam2fq.001.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -323,6 +331,7 @@
         </test>
         <!--# basic 2 output test with singleton tracking with a singleton in the middle-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/3.1.fq.expected', '2.fq' => 'bam2fq/3.2.fq.expected', 's.fq' => 'bam2fq/3.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.002.sam");-->
+        <!-- 9 -->
         <test expect_num_outputs="4">
             <param name="input" value="bam2fq.002.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -336,6 +345,7 @@
         </test>
         <!--# basic 2 output test with singleton tracking with a singleton as last read-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/4.1.fq.expected', '2.fq' => 'bam2fq/4.2.fq.expected', 's.fq' => 'bam2fq/4.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.003.sam");-->
+        <!-- 10 -->
         <test expect_num_outputs="4">
             <param name="input" value="bam2fq.003.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -349,6 +359,7 @@
         </test>
         <!--# tag output test with singleton tracking with a singleton as last read-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/4.1.fq.expected', '2.fq' => 'bam2fq/4.2.fq.expected', 's.fq' => 'bam2fq/4.s.fq.expected', 'bc.fq' => 'bam2fq/bc.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC \-\-index-format 'n2i2' \-\-i1 $$opts{path}/bc.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.004.sam");-->
+        <!-- 11 -->
         <test expect_num_outputs="5">
             <param name="input" value="bam2fq.004.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -370,11 +381,12 @@
         </test>
         <!--# test -O flag with no OQ tags-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/4.1.fq.expected', '2.fq' => 'bam2fq/4.2.fq.expected', 's.fq' => 'bam2fq/4.s.fq.expected', 'bc.fq' => 'bam2fq/bc.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -O \-\-index-format 'n2i2' \-\-i1 $$opts{path}/bc.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.004.sam");-->
+        <!-- 12 -->
         <test expect_num_outputs="5">
-            <param name="input" value="bam2fq.010.sam" ftype="sam" />
+            <param name="input" value="bam2fq.004.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
                 <param name="output_fmt_select" value="fastqsanger" />
-                <param name="output_quality" value="-O" />
+                <param name="output_quality" value="true" />
             </conditional>
             <param name="outputs" value="r1,r2,s,other" />
             <conditional name="idxout_cond">
@@ -384,19 +396,20 @@
                 <param name="barcode_tag" value="BC"/>
                 <param name="index_format" value="n2i2"/>
             </conditional>
-            <output name="forward" file="10.1.fq.expected" ftype="fastqsanger" />
-            <output name="reverse" file="10.2.fq.expected" ftype="fastqsanger" />
-            <output name="singletons" file="10.s.fq.expected" ftype="fastqsanger" />
-            <output name="output"  file="2.stdout.expected" ftype="fastqsanger" />
-            <output name="i1"  file="bc10.fq.expected" ftype="fastqsanger" />
+            <output name="forward" file="4.1.fq.expected" ftype="fastqsanger" />
+            <output name="reverse" file="4.2.fq.expected" ftype="fastqsanger" />
+            <output name="singletons" file="4.s.fq.expected" ftype="fastqsanger" />
+            <output name="output"  file="4.stdout.expected" ftype="fastqsanger" />
+            <output name="i1"  file="bc.fq.expected" ftype="fastqsanger" />
         </test>
         <!--# test -O flag with OQ tags-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/10.1.fq.expected', '2.fq' => 'bam2fq/10.2.fq.expected', 's.fq' => 'bam2fq/10.s.fq.expected', 'bc.fq' => 'bam2fq/bc10.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -O \-\-index-format 'n2i2' \-\-i1 $$opts{path}/bc.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.010.sam");-->
+        <!-- 13 -->
         <test expect_num_outputs="5">
             <param name="input" value="bam2fq.010.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
                 <param name="output_fmt_select" value="fastqsanger" />
-                <param name="output_quality" value="-O" />
+                <param name="output_quality" value="true" />
             </conditional>
             <param name="outputs" value="r1,r2,s,other" />
             <conditional name="idxout_cond">
@@ -414,6 +427,7 @@
         </test>
         <!--# tag output test with separators and -N flag-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/5.1.fq.expected', '2.fq' => 'bam2fq/5.2.fq.expected', 's.fq' => 'bam2fq/5.s.fq.expected', 'bc_split.fq' => 'bam2fq/bc_split.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -N \-\-index-format 'n*i*' \-\-i1 $$opts{path}/bc_split.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
+        <!-- 14 -->
         <test expect_num_outputs="5">
             <param name="input" value="bam2fq.005.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
@@ -436,13 +450,14 @@
         </test>
         <!--# -t flag-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/6.1.fq.expected', '2.fq' => 'bam2fq/6.2.fq.expected', 's.fq' => 'bam2fq/6.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -N -t -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
+        <!-- 15 -->
         <test expect_num_outputs="4">
             <param name="input" value="bam2fq.005.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
                 <param name="output_fmt_select" value="fastqsanger" />
             </conditional>
             <param name="outputs" value="r1,r2,s,other" />
-            <param name="copy_tags" value="-t" />
+            <param name="copy_tags" value="true" />
             <param name="read_numbering" value="-N"/>
             <output name="forward" file="6.1.fq.expected" ftype="fastqsanger" />
             <output name="reverse" file="6.2.fq.expected" ftype="fastqsanger" />
@@ -451,13 +466,14 @@
         </test>
         <!--# -T flag-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/7.1.fq.expected', '2.fq' => 'bam2fq/7.2.fq.expected', 's.fq' => 'bam2fq/7.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -N -t -T MD,ia -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
+        <!-- 16 -->
         <test expect_num_outputs="4">
             <param name="input" value="bam2fq.005.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
                 <param name="output_fmt_select" value="fastqsanger" />
             </conditional>
             <param name="outputs" value="r1,r2,s,other" />
-            <param name="copy_tags" value="-t" />
+            <param name="copy_tags" value="true" />
             <param name="copy_arb_tags" value="MD,ia" />
             <param name="read_numbering" value="-N"/>
             <output name="forward" file="7.1.fq.expected" ftype="fastqsanger" />
@@ -467,18 +483,19 @@
         </test>
         <!--# -i flag with no index-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/7.1.fq.expected', '2.fq' => 'bam2fq/7.2.fq.expected', 's.fq' => 'bam2fq/7.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -N -t -i -T MD,ia -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
+        <!-- 17 -->
         <test expect_num_outputs="6">
             <param name="input" value="bam2fq.005.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
                 <param name="output_fmt_select" value="fastqsanger" />
-                <param name="ilumina_casava" value="-i" />
+                <param name="ilumina_casava" value="true" />
             </conditional>
             <param name="outputs" value="r1,r2,s,other" />
             <conditional name="idxout_cond">
                 <param name="idxout_select" value="yes"/>
                 <param name="index_format" value="n2i2"/>
             </conditional>
-            <param name="copy_tags" value="-t" />
+            <param name="copy_tags" value="true" />
             <param name="copy_arb_tags" value="MD,ia" />
             <param name="read_numbering" value="-N"/>
             <output name="forward" file="11.1.fq.expected" ftype="fastqsanger" />
@@ -490,11 +507,12 @@
         </test>
         <!--# -i flag with index-->
         <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/8.1.fq.expected', '2.fq' => 'bam2fq/8.2.fq.expected', 's.fq' => 'bam2fq/8.s.fq.expected', 'i.fq' => 'bam2fq/8.i.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -i \-\-index-format 'n2i2' \-\-i1 $$opts{path}/i.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.004.sam");-->
+        <!-- 18 -->
         <test expect_num_outputs="6">
             <param name="input" value="bam2fq.004.sam" ftype="sam" />
             <conditional name="output_fmt_cond">
                 <param name="output_fmt_select" value="fastqsanger" />
-                <param name="ilumina_casava" value="-i" />
+                <param name="ilumina_casava" value="true" />
             </conditional>
             <param name="outputs" value="r1,r2,s,other" />
             <conditional name="idxout_cond">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/rebuild_output_files.sh	Thu Jun 19 12:59:30 2025 +0000
@@ -0,0 +1,53 @@
+# Test 1: Basic FASTA output from BAM
+samtools fasta -f 0 -F 2304 -G 0 <(samtools sort -n samtools_fastx-in1.bam) > samtools_fastx-out1.fasta
+
+# Test 2: FASTQ output with r0, r1, r2 splits from BAM
+samtools sort -n samtools_fastx-in2.bam | samtools fastq -0 samtools_fastx-out2-1.fastq -1 samtools_fastx-out2-2.fastq -2 samtools_fastx-out2-3.fastq -
+
+# Test 3: FASTA output with r0, r1, r2 splits from SAM
+samtools sort -n samtools_fastx-in3.sam | samtools fasta -0 samtools_fastx-out3-1.fasta -1 samtools_fastx-out3-2.fasta -2 samtools_fastx-out3-3.fasta -
+
+# Test 4: Compressed FASTA output from BAM
+samtools fasta samtools_fastx-in1.bam | gzip > samtools_fastx-out1.fasta.gz
+
+# Test 5: Compressed FASTQ output with r0, r1, r2 splits from BAM
+samtools sort -n samtools_fastx-in2.bam -T tmp | samtools fastq -0 >(gzip > samtools_fastx-out2-1.fastq.gz) -1 >(gzip > samtools_fastx-out2-2.fastq.gz) -2 >(gzip > samtools_fastx-out2-3.fastq.gz) -
+
+# Test 6: Compressed FASTA output with r0, r1, r2 splits from SAM
+samtools sort -n samtools_fastx-in3.sam -T tmp | samtools fasta -0 >(gzip > samtools_fastx-out3-1.fasta.gz) -1 >(gzip > samtools_fastx-out3-2.fasta.gz) -2 >(gzip > samtools_fastx-out3-3.fasta.gz) -
+
+# Test 7: Basic 2 output test without singleton tracking
+samtools fastq -1 1.1.fq.expected -2 1.2.fq.expected bam2fq.001.sam > 1.stdout.expected
+
+# Test 8: Basic 2 output test with singleton tracking but no singleton
+samtools fastq -s 2.s.fq.expected -1 2.1.fq.expected -2 2.2.fq.expected bam2fq.001.sam > 2.stdout.expected
+
+# Test 9: Basic 2 output test with singleton tracking with a singleton in the middle
+samtools fastq -s 3.s.fq.expected -1 3.1.fq.expected -2 3.2.fq.expected bam2fq.002.sam > 3.stdout.expected
+
+# Test 10: Basic 2 output test with singleton tracking with a singleton as last read
+samtools fastq -s 4.s.fq.expected -1 4.1.fq.expected -2 4.2.fq.expected bam2fq.003.sam > 4.stdout.expected
+
+# Test 11: Tag output test with barcode index
+samtools fastq --barcode-tag BC --index-format 'n2i2' --i1 bc.fq.expected -s 4.s.fq.expected -1 4.1.fq.expected -2 4.2.fq.expected bam2fq.004.sam > 4.stdout.expected
+
+# Test 12: Test -O flag with no OQ tags
+samtools fastq -O --barcode-tag BC --index-format 'n2i2' --i1 bc.fq.expected -s 4.s.fq.expected -1 4.1.fq.expected -2 4.2.fq.expected bam2fq.004.sam > 4.stdout.expected
+
+# Test 13: Test -O flag with OQ tags
+samtools fastq -O --barcode-tag BC --index-format 'n2i2' --i1 bc10.fq.expected -s 10.s.fq.expected -1 10.1.fq.expected -2 10.2.fq.expected bam2fq.010.sam > 2.stdout.expected
+
+# Test 14: Tag output test with separators and -N flag
+samtools fastq --barcode-tag BC -N --index-format 'n*i*' --i1 bc_split.fq.expected -s 5.s.fq.expected -1 5.1.fq.expected -2 5.2.fq.expected bam2fq.005.sam > 2.stdout.expected
+
+# Test 15: -t flag
+samtools fastq -N -t -s 6.s.fq.expected -1 6.1.fq.expected -2 6.2.fq.expected bam2fq.005.sam > 2.stdout.expected
+
+# Test 16: -T flag
+samtools fastq -N -t -T MD,ia -s 7.s.fq.expected -1 7.1.fq.expected -2 7.2.fq.expected bam2fq.005.sam > 2.stdout.expected
+
+# Test 17: -i flag with no index
+samtools fastq -N -t -i -T MD,ia --index-format 'n2i2' --i1 11.i.fq.expected --i2 11.i2.fq.expected -s 11.s.fq.expected -1 11.1.fq.expected -2 11.2.fq.expected bam2fq.005.sam > 2.stdout.expected
+
+# Test 18: -i flag with index
+samtools fastq --barcode-tag BC -i --index-format 'n2i2' --i1 8.i.fq.expected --i2 8.i2.fq.expected -s 8.s.fq.expected -1 8.1.fq.expected -2 8.2.fq.expected bam2fq.004.sam > 2.stdout.expected
\ No newline at end of file