diff cmscan.xml @ 20:b10f7688d14c draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/infernal commit 09c1d4ab75f5cd057ed57bf694217f0e355f785e
author bgruening
date Mon, 11 Nov 2024 10:26:56 +0000
parents 94cc7ef25867
children
line wrap: on
line diff
--- a/cmscan.xml	Thu Sep 23 19:38:15 2021 +0000
+++ b/cmscan.xml	Mon Nov 11 10:26:56 2024 +0000
@@ -3,19 +3,21 @@
     <macros>
         <import>macros.xml</import>
     </macros>
+    <expand macro="xrefs"/>
     <expand macro="requirements"/>
     <expand macro="stdio"/>
-    <expand macro="xrefs"/>
-    <command>
+    <command detect_errors="aggressive">
 <![CDATA[
     ## a temp file is needed, because the standard tabular output from infernal is not usefull in Galaxy
     ## it will be converted to a tab delimited file and piped to Galaxy
     temp_tabular_output=\$(mktemp) &&
 
     #if str($cm_opts.cm_opts_selector) == "histdb":
-        ln -s '$cm_opts.cmfile' cmdb.cm &&
+        ln -s '$cm_opts.cmfile' cmdb.cm
+    #else:
+        ln -s '$cm_opts.database.fields.path' cmdb.cm
     #end if
-
+    &&
     tar xvf '$aux_files' &&
     ln -s `find *.i1f` cmdb.cm.i1f &&
     ln -s `find *.i1i` cmdb.cm.i1i &&
@@ -66,12 +68,7 @@
             #end if
         #end if
         ## CM file from the history or stored as database on disc
-        #if str($cm_opts.cm_opts_selector) == "db":
-            '$cm_opts.database.fields.path'
-        #else:
-            ##'$cm_opts.cmfile'
-            cmdb.cm
-        #end if
+        cmdb.cm
         ## sequence file
         '$seqdb'
         ######### Parse the output file in order to fix a problem reported in https://help.galaxyproject.org/t/messy-infernal-cmscan-output/5984
@@ -92,25 +89,7 @@
     </command>
     <inputs>
         <param name="seqdb" type="data" format="fasta" label="Sequence database &lt;seqfile&gt;"/>
-
-        <conditional name="cm_opts">
-            <param name="cm_opts_selector" type="select" label="Subject covariance models &lt;cmdb&gt; ">
-                <option value="db" >Locally installed covariance models</option>
-                <option value="histdb" selected="True">Covariance model from your history</option>
-            </param>
-            <when value="db">
-                <param name="database" type="select" label="Covariance models">
-                    <options from_file="infernal.loc">
-                        <column name="value" index="0"/>
-                        <column name="name" index="1"/>
-                        <column name="path" index="2"/>
-                    </options>
-                </param>
-            </when>
-            <when value="histdb">
-                <param name="cmfile" type="data" format="cm" label="Covariance models file from the history."/>
-            </when>
-        </conditional>
+        <expand macro="DB" />
         <param name="aux_files" type="data" format="tar" label="Auxillury files" help="A tar file contains the four auxillury files suffixed .i1{fimp}. These files are generated after pressing the cm files using cmpress"/>
 
         <param argument="-g" truevalue="-g" falsevalue="" checked="False" type="boolean"
@@ -258,6 +237,20 @@
                 </assert_contents>
             </output>
         </test>
+        <test>
+            <conditional name="cm_opts">
+                <param name="cm_opts_selector" value="db"/>
+                <param name="database" value="minifam.cm" />
+            </conditional>
+            <param name="aux_files" value="minifam.tar" ftype="tar"/>
+            <param name="seqdb" value="metag-example.fa"/>
+            <output name="outfile" file="test_cmscan.tabular" ftype="tabular" lines_diff="8">
+                <assert_contents>
+                    <has_n_lines n="15"/>
+                    <has_text text="AAGA01015927.1"/>
+                </assert_contents>
+            </output>
+        </test>
 
     </tests>
     <help>