changeset 5:b8e3c0a52f33 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fastq_to_fasta commit 415a5c5de30530910f3039e5fc66aa15103c6f20
author iuc
date Tue, 27 Jun 2023 17:37:16 +0000
parents 5dbca5fbdc45
children 0a759fe3fd43
files fastq_to_fasta.xml macros.xml test-data/fastq_to_fasta-in2.fastq.gz test-data/fastq_to_fasta-out2.out.gz
diffstat 4 files changed, 52 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/fastq_to_fasta.xml	Thu Jan 30 18:26:18 2020 +0000
+++ b/fastq_to_fasta.xml	Tue Jun 27 17:37:16 2023 +0000
@@ -9,7 +9,11 @@
 $SKIPN
 $RENAMESEQ
 -v @FQQUAL@
-@GZIP@ > '$output'
+#if $compress_output == 'yes' or ($compress_output == 'infer' and ($input.ext.endswith('.gz') or $input.ext.endswith('.bz2'))):
+    | gzip -c  > '$output_gz'
+#else:
+    > '$output'
+#end if
     ]]></command>
     <inputs>
         <expand macro="fastq_input" />
@@ -21,32 +25,70 @@
             <option value="-r">yes</option>
             <option value="">no</option>
         </param>
+        <param name="compress_output" type="select" label="Compress output FASTA">
+            <option value="infer" selected="true">Infer from input data</option>
+            <option value="yes">Yes</option>
+            <option value="no">No</option>
+        </param>
     </inputs>
     <outputs>
-        <data name="output" format="fasta" metadata_source="input" />
+        <data name="output" format="fasta" metadata_source="input" label="${tool.name} on ${on_string}: FASTA">
+            <filter>
+                compress_output == 'no' or compress_output == 'infer' and not (input.ext.endswith('.gz') or input.ext.endswith('.bz2'))
+            </filter>
+        </data>
+        <data name="output_gz" format="fasta.gz" metadata_source="input" label="${tool.name} on ${on_string}: FASTA.gz">
+            <filter>
+                compress_output == 'yes' or compress_output == 'infer' and input.ext.endswith('.gz') or input.ext.endswith('.bz2')
+            </filter>
+        </data>
     </outputs>
     <tests>
-        <test>
-            <!-- FASTQ-To-FASTA, keep N, don't rename -->
+        <test expect_num_outputs="1" >
+            <!-- 1 FASTQ-To-FASTA, keep N, don't rename -->
             <param name="input" value="fastq_to_fasta1.fastq" ftype="fastqsolexa" />
             <param name="SKIPN" value=""/>
             <param name="RENAMESEQ" value=""/>
             <output name="output" file="fastq_to_fasta1a.out" />
         </test>
-        <test>
-            <!-- FASTQ-To-FASTA, discard N, rename -->
+        <test expect_num_outputs="1" >
+            <!-- 2 FASTQ-To-FASTA, discard N, rename -->
             <param name="input" value="fastq_to_fasta1.fastq" ftype="fastqsolexa" />
             <param name="SKIPN" value="no"/>
             <param name="RENAMESEQ" value="yes"/>
             <output name="output" file="fastq_to_fasta1b.out" />
         </test>
-        <test>
-            <!-- FASTQ-To-FASTA, discard N, rename -->
+        <test expect_num_outputs="1" >
+            <!-- 3 FASTQ-To-FASTA, discard N, rename -->
             <param name="input" value="fastq_to_fasta-in2.fastq" ftype="fastqsanger" />
             <param name="SKIPN" value="no"/>
             <param name="RENAMESEQ" value="yes"/>
             <output name="output" file="fastq_to_fasta-out2.out" />
         </test>
+        <test expect_num_outputs="1" >
+            <!-- 4 Infer FASTQ.GZ-To-FASTA.GZ -->
+            <param name="input" value="fastq_to_fasta-in2.fastq.gz" ftype="fastqsanger.gz" />
+            <param name="SKIPN" value="no"/>
+            <param name="RENAMESEQ" value="yes"/>
+            <param name="compress_output" value="infer"/>
+            <output name="output" file="fastq_to_fasta-out2.out.gz" compare="sim_size" delta="50" />
+        </test>
+        <test expect_num_outputs="1" >
+            <!-- 5 Force FASTQ.GZ-To-FASTA -->
+            <param name="input" value="fastq_to_fasta-in2.fastq.gz" ftype="fastqsanger.gz" />
+            <param name="SKIPN" value="no"/>
+            <param name="RENAMESEQ" value="yes"/>
+            <param name="compress_output" value="no"/>
+            <output name="output" file="fastq_to_fasta-out2.out"/>
+        </test>
+        <test expect_num_outputs="1" >
+            <!-- 6 Force FASTQ-To-FASTA.GZ -->
+            <param name="input" value="fastq_to_fasta-in2.fastq" ftype="fastqsanger" />
+            <param name="SKIPN" value="no"/>
+            <param name="RENAMESEQ" value="yes"/>
+            <param name="compress_output" value="yes"/>
+            <output name="output" file="fastq_to_fasta-out2.out.gz" compare="sim_size" delta="50" />
+        </test>
     </tests>
     <help><![CDATA[
 **What it does**
--- a/macros.xml	Thu Jan 30 18:26:18 2020 +0000
+++ b/macros.xml	Tue Jun 27 17:37:16 2023 +0000
@@ -11,22 +11,13 @@
     </token>
     <token name="@FQQUAL@">
         <![CDATA[
-            #if $input.is_of_type('fastqsanger', 'fastqsanger.gz', 'fastqsanger.bz2'):
+            #if 'fastqsanger' in $input.ext:
                 -Q 33
-            #elif $input.is_of_type('fastqsolexa', 'fastqsolexa.gz', 'fastqsolexa.bz2', 'fastqillumina', 'fastqillumina.gz', 'fastqillumina.bz2'):
+            #elif 'fastqsolexa' in $input.ext or 'fastqillumina' in $input.ext:
                 -Q 64
             #end if
         ]]>
     </token>
-    <token name="@GZIP@">
-        <![CDATA[
-            #if $input.is_of_type('fasta.gz', 'fastqsanger.gz', 'fastqsolexa.gz', 'fastqillumina.gz'):
-                | gzip -c
-            #elif $input.is_of_type('fastqsanger.bz2', 'fastqsolexa.bz2', 'fastqillumina.bz2'):
-                | bzip2 -c
-            #end if
-        ]]>
-    </token>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@VERSION@">fastx_toolkit</requirement>
@@ -51,13 +42,7 @@
             </citation>
         </citations>
     </xml>
-    <xml name="fasta_input">
-        <param name="input" type="data" format="@FASTAS@" label="Input FASTA file" />
-    </xml>
     <xml name="fastq_input">
         <param name="input" type="data" format="@FASTQS@" label="Input FASTQ file" />
     </xml>
-    <xml name="fastx_input">
-        <param name="input" type="data" format="@FASTAS@,@FASTQS@" label="Input file in FASTA or FASTQ format" />
-    </xml>
 </macros>
Binary file test-data/fastq_to_fasta-in2.fastq.gz has changed
Binary file test-data/fastq_to_fasta-out2.out.gz has changed