changeset 12:e79965d0351c draft

planemo upload commit 6358ce7c332f42526423d365f06516983ca677a0
author iuc
date Sat, 03 Dec 2022 10:38:40 +0000
parents 2a89f630fa85
children 820f68ad34a7
files blat.xml test-data/mini-db.fa.gz test-data/mini-query.fa.gz
diffstat 3 files changed, 41 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/blat.xml	Fri Dec 02 09:35:54 2022 +0000
+++ b/blat.xml	Sat Dec 03 10:38:40 2022 +0000
@@ -2,7 +2,7 @@
     <description>BLAST-like sequence alignment tool</description>
     <macros>
         <token name="@TOOL_VERSION@">377</token>
-        <token name="@VERSION_SUFFIX@">0</token>
+        <token name="@VERSION_SUFFIX@">1</token>
 
         <xml name="mask_cond" tokens="maskarg,label,help">
             <conditional name="@MASKARG@_type">
@@ -30,7 +30,9 @@
     <command detect_errors="exit_code"><![CDATA[
     #if str($reference_source.reference_source_selector) == "history":
         ## blat depends on file extension
-        #if $reference_source.database.is_of_type("fasta"):
+        #if $reference_source.database.is_of_type("fasta.gz"):
+            #set $reference_fasta_filename = "localref.fa.gz"
+        #elif $reference_source.database.is_of_type("fasta"):
             #set $reference_fasta_filename = "localref.fa"
         #elif $reference_source.database.is_of_type("twobit"):
             #set $reference_fasta_filename = "localref.2bit"
@@ -42,6 +44,18 @@
         #set $reference_fasta_filename = str($reference_source.database.fields.path)
     #end if
 
+    ## blat depends on file extension
+    #if $query.is_of_type("fasta.gz"):
+        #set $query_filename = "query.fa.gz"
+    #elif $query.is_of_type("fasta"):
+        #set $query_filename = "query.fa"
+    #elif $query.is_of_type("twobit"):
+        #set $query_filename = "query.2bit"
+    #else
+        #set $query_filename = "query"
+    #end if
+    ln -s '$query' '$query_filename' &&
+
     blat
         -q=$query_type
         -t=$database_type
@@ -100,7 +114,7 @@
             -dots=$dots
         #end if
         '$reference_fasta_filename'
-        '$query'
+        '$query_filename'
         -out=$out
         '$output'
     ]]></command>
@@ -121,10 +135,10 @@
                 </param>
             </when>
             <when value="history">
-                <param name="database" type="data" format="fasta,twobit" label="Using database file, either a .fa, .nib or .2bit file" />
+                <param name="database" type="data" format="fasta,fasta.gz,twobit" label="Using database file, either a fasta, fasta.gz or twobit dataset" />
             </when>
         </conditional>
-        <param name="query" type="data" format="fasta, twobit" label="Query data, either a .fa, .nib or .2bit file"/>
+        <param name="query" type="data" format="fasta,fasta.gz,twobit" label="Query data, either a fasta, fasta.gz or twobit dataset"/>
         <param argument="-t" name="database_type" type="select" format="txt" multiple="false" label="database type" help="Choose your database type, the default is dnax">
             <option value="dna" selected="true">dna - DNA sequence</option>
             <option value="prot">prot - protein sequence</option>
@@ -259,7 +273,28 @@
                 <has_text text="-mask='/"/>
             </assert_command>
         </test>
-    </tests>
+        <!-- tiny test data from https://davetang.org/muse/2012/05/15/using-blat/ -->
+        <test>
+            <conditional name="reference_source">
+                <param name="reference_source_selector" value="history" />
+                <param name="database" value="mini-db.fa.gz" ftype="fasta.gz" />
+            </conditional>
+            <param name="query" value="mini-query.fa.gz" ftype="fasta.gz"/>
+            <param name="minScore" value="0" />
+            <section name="adv_align">
+                <param name="stepSize" value="1"/>
+            </section>
+            <param name="out" value="psl" ftype="tabular" />
+            <output name="output">
+                <assert_contents>
+                    <has_n_lines n="7"/>
+                </assert_contents>
+            </output>
+            <assert_command>
+                <has_text text="-minScore=0"/>
+                <has_text text="-stepSize=1"/>
+            </assert_command>
+        </test> </tests>
     <help>
         <![CDATA[
 BLAT
Binary file test-data/mini-db.fa.gz has changed
Binary file test-data/mini-query.fa.gz has changed