changeset 2:3cd89604dffd draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/kma commit f040316174672d9e3ce53b1873ab07cff1128940
author iuc
date Mon, 15 Dec 2025 21:59:27 +0000
parents 4b3fca68379b
children
files kma_map.xml macros.xml test-data/ERR884056_ecoli_b0842.mapped_R1.fastq.gz
diffstat 3 files changed, 136 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/kma_map.xml	Sat Nov 27 09:35:27 2021 +0000
+++ b/kma_map.xml	Mon Dec 15 21:59:27 2025 +0000
@@ -1,4 +1,4 @@
-<tool id="kma_map" name="Map with KMA" version="@TOOL_VERSION@+galaxy1">
+<tool id="kma_map" name="Map with KMA" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
     <description></description>
     <macros>
         <import>macros.xml</import>
@@ -10,11 +10,9 @@
     <command detect_errors="exit_code">
         <![CDATA[
         kma
-            -t \${GALAXY_SLOTS:-1}
+            -t "\${GALAXY_SLOTS:-1}"
             -t_db '${kma_index.fields.path}'
-            #if $single_paired.single_paired_selector == 'paired'
-                -ipe '${single_paired.forward_input}' '${single_paired.reverse_input}'
-            #elif $single_paired.single_paired_selector == "paired_collection":
+            #if $single_paired.single_paired_selector == "paired_collection":
                 -ipe '${single_paired.input_pair.forward}' '${single_paired.input_pair.reverse}'
             #else:
                 -i '${single_paired.input_sequences}'
@@ -76,15 +74,10 @@
         <conditional name="single_paired">
             <param name="single_paired_selector" type="select" label="Single or paired reads" help="--paired">
                 <option value="paired_collection">Paired collection</option>
-                <option value="paired">Paired-end data</option>
                 <option selected="True" value="single">Single-end data</option>
             </param>
             <when value="paired_collection">
-                <param argument="-ipe" format="@INTYPES@" name="input_pair" type="data_collection" collection_type="paired" label="Collection of paired reads" help="FASTQ datasets" />
-            </when>
-            <when value="paired">
-                <param argument="-ipe" format="@INTYPES@" name="forward_input" type="data" label="Forward strand" help="FASTQ dataset"/>
-                <param argument="-ipe" format="@INTYPES@" name="reverse_input" type="data" label="Reverse strand" help="FASTQ dataset"/>
+                <param argument="-ipe" format="@INTYPES@" name="input_pair" type="data_collection" collection_type="paired" label="Paired reads" help="FASTQ datasets" />
             </when>
             <when value="single">
                 <param argument="-i" format="@INTYPES@" label="Input sequences" name="input_sequences" type="data" help="FASTQ datasets"/>
@@ -107,9 +100,9 @@
                 <param argument="-p" name="p_value" type="float" min="0.0" value="0.05" max="1.0" label="p-value"/>
                 <param argument="-ex_mode" name="exhaustive_mode" type="boolean" truevalue="-ex_mode" falsevalue="" label="Exhaustive Mode" />
                 <param argument="-deCon" name="decontaminate" type="boolean" truevalue="-deCon" falsevalue="" label="Decontaminate" />
-                <param argument="-dense" name="dense" type="boolean" truevalue="-dense" falsevalue="" label="Do not allow insertions in assembly" />
-                <param argument="-ref_fsa" name="ref_fsa" type="boolean" truevalue="-ref_fsa" falsevalue="" label="Consensus sequence has 'n' instead of gaps" />
-                <param argument="-matrix" name="matrix" type="boolean" truevalue="-matrix" falsevalue="" label="Output assembly matrix" />
+                <param argument="-dense" type="boolean" truevalue="-dense" falsevalue="" label="Do not allow insertions in assembly" />
+                <param argument="-ref_fsa" type="boolean" truevalue="-ref_fsa" falsevalue="" label="Consensus sequence has 'n' instead of gaps" />
+                <param argument="-matrix" type="boolean" truevalue="-matrix" falsevalue="" label="Output assembly matrix" />
                 <param argument="-a" name="all_best_mappings" type="boolean" truevalue="-a" falsevalue="" label="Print all best mappings" />
                 <param argument="-mp" name="minimum_phred_score" type="integer" min="0" value="20" max="60" label="Minimum phred score" />
                 <param argument="-5p" name="cut_5_prime" type="integer" min="0" value="0" max="64" label="Cut a constant number of nucleotides from the 5 prime" />
@@ -118,64 +111,149 @@
                 <param argument="-1t1" name="force_end_to_end" type="boolean" truevalue="-1t1" falsevalue="" label="Force end to end mapping" />
                 <param argument="-bcd" name="base_call_depth" type="integer" min="1" value="1" max="1000" label="Minimum depth at base" />
                 <param argument="-mq" name="minimum_mapping_quality" type="integer" min="0" value="0" max="100" label="Minimum mapping quality" />
-                <param argument="-reward" name="reward" type="integer" min="1" value="1" max="100" label="Score for match" />
-                <param argument="-penalty" name="penalty" type="integer" min="-100" value="-2" max="0" label="Penalty for mismatch" />
-                <param argument="-gapopen " name="gapopen" type="integer" min="-100" value="-3" max="0" label="Penalty for gap opening" />
-                <param argument="-gapextend" name="gapextend" type="integer" min="-100" value="-1" max="0" label="Penalty for gap extension" />
+                <param argument="-reward" type="integer" min="1" value="1" max="100" label="Score for match" />
+                <param argument="-penalty" type="integer" min="-100" value="-2" max="0" label="Penalty for mismatch" />
+                <param argument="-gapopen" type="integer" min="-100" value="-3" max="0" label="Penalty for gap opening" />
+                <param argument="-gapextend"  type="integer" min="-100" value="-1" max="0" label="Penalty for gap extension" />
                 <param argument="-per" name="pairing_reward" type="integer" min="1" value="7" max="100" label="Reward for pairing reads" />
                 <param argument="-cge" name="set_cge_penalties_and_rewards" type="boolean" truevalue="-cge" falsevalue="" label="Set CGE penalties and rewards" />
             </when>
         </conditional>
     </inputs>
     <outputs>
-        <data name="result_overview" label="Result overview" format="tabular" from_work_dir="output.res" />
-        <data name="consensus_alignment" label="Consensus alignment" format="fasta" from_work_dir="output.aln" />
-        <data name="consensus_sequences" label="Consensus sequences" format="fasta" from_work_dir="output.fsa" />
-        <data name="read_mapping" label="Read mapping info" format="tabular" from_work_dir="output.frag" />
-        <data name="assembly_matrix" label="Assembly matrix" format="txt" from_work_dir="output.mat">
+        <data name="result_overview" label="${tool.name} on ${on_string}: Result overview" format="tabular" from_work_dir="output.res" />
+        <data name="consensus_alignment" label="${tool.name} on ${on_string}: Consensus alignment" format="txt" from_work_dir="output.aln" />
+        <data name="consensus_sequences" label="${tool.name} on ${on_string}: Consensus sequences" format="fasta" from_work_dir="output.fsa" />
+        <data name="read_mapping" label="${tool.name} on ${on_string}: Read mapping info" format="tabular" from_work_dir="output.frag" />
+        <data name="assembly_matrix" label="${tool.name} on ${on_string}: Assembly matrix" format="tabular" from_work_dir="output.mat">
             <filter>settings['matrix']</filter>
         </data>
     </outputs>
     <tests>
-        <test>
-            <param name="single_paired_selector" value="single"/>
-            <param name="input_sequences" value="ERR884056_ecoli_b0842.mapped_R1.fastq" ftype="fastq"/>
-            <param name="advanced" value="advanced"/>
-            <param name="kmer_size" value="8"/>
+        <test expect_num_outputs="4">
+            <conditional name="single_paired">
+                <param name="single_paired_selector" value="single"/>
+                <param name="input_sequences" value="ERR884056_ecoli_b0842.mapped_R1.fastq" ftype="fastq"/>
+            </conditional>
+            <conditional name="settings">
+                <param name="advanced" value="advanced"/>
+                <param name="kmer_size" value="8"/>
+            </conditional>
+            <param name="kma_index" value="test_index"/>
+            <output name="result_overview" ftype="tabular">
+                <assert_contents>
+                    <has_n_lines n="3"/>
+                    <has_n_columns n="11"/>
+                    <has_text text="#Template"/>
+                    <has_text text="b0842_1"/>
+                </assert_contents>
+            </output>
+            <output name="consensus_alignment" ftype="txt">
+                <assert_contents>
+                    <has_n_lines n="170"/>
+                    <has_text text="b0842_1"/>
+                    <has_text text="query" n="42"/>
+                    <has_text text="template" n="42"/>
+                </assert_contents>
+            </output>
+            <output name="consensus_sequences" ftype="fasta">
+                <assert_contents>
+                    <has_line_matching expression="^>.*" n="2"/>
+                    <has_line_matching expression="^>b0842_1"/>
+                </assert_contents>
+            </output>
+            <output name="read_mapping" ftype="tabular">
+                <assert_contents>
+                    <has_n_lines n="513"/>
+                    <has_n_columns n="7"/>
+                    <has_text text="b0842_1"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="5">
+            <conditional name="single_paired">
+                <param name="single_paired_selector" value="single"/>
+                <param name="input_sequences" value="ERR884056_ecoli_b0842.mapped_R1.fastq" ftype="fastq"/>
+            </conditional>
+            <conditional name="settings">
+                <param name="advanced" value="advanced"/>
+                <param name="kmer_size" value="8"/>
+                <param name="matrix" value="true"/>
+            </conditional>
             <param name="kma_index" value="test_index"/>
-            <output name="result_overview" file="ERR884056.res" ftype="tabular"/>
-            <output name="consensus_alignment" file="ERR884056.aln" ftype="fasta"/>
-            <output name="consensus_sequences" file="ERR884056.fsa" ftype="fasta"/>
-            <output name="read_mapping" file="ERR884056.frag" ftype="tabular"/>
+            <output name="assembly_matrix" ftype="tabular">
+                <assert_contents>
+                    <has_n_lines n="2578"/>
+                    <has_n_columns n="7" comment="#"/>
+                    <has_line_matching expression="^A&#009;.*"/>
+                    <has_line_matching expression="^T&#009;.*"/>
+                    <has_line_matching expression="^C&#009;.*"/>
+                    <has_line_matching expression="^G&#009;.*"/>
+                </assert_contents>
+            </output>
         </test>
-        <test>
-            <param name="single_paired_selector" value="single"/>
-            <param name="input_sequences" value="ERR884056_ecoli_b0842.mapped_R1.fastq" ftype="fastq"/>
-            <param name="advanced" value="advanced"/>
-            <param name="kmer_size" value="8"/>
-            <param name="matrix" value="true"/>
+        <test expect_num_outputs="4">
+            <conditional name="single_paired">
+                <param name="single_paired_selector" value="paired_collection"/>
+                <param name="input_pair">
+                    <collection type="paired">
+                        <element name="forward" value="ERR884056_ecoli_b0842.mapped_R1.fastq.gz"/>
+                        <element name="reverse" value="ERR884056_ecoli_b0842.mapped_R1.fastq.gz"/>
+                    </collection>
+                </param>
+            </conditional>
+            <conditional name="settings">
+                <param name="advanced" value="advanced"/>
+                <param name="kmer_size" value="8"/>
+            </conditional>
             <param name="kma_index" value="test_index"/>
-            <output name="assembly_matrix" file="ERR884056.mat" ftype="txt"/>
+            <output name="result_overview" ftype="tabular">
+                <assert_contents>
+                    <has_n_lines n="4"/>
+                    <has_n_columns n="11"/>
+                    <has_text text="#Template"/>
+                    <has_text text="b0842_1"/>
+                </assert_contents>
+            </output>
+            <output name="consensus_alignment" ftype="txt">
+                <assert_contents>
+                    <has_n_lines n="255"/>
+                    <has_text text="b0842_1"/>
+                    <has_text text="query" n="63"/>
+                    <has_text text="template" n="63"/>
+                </assert_contents>
+            </output>
+            <output name="consensus_sequences" ftype="fasta">
+                <assert_contents>
+                    <has_line_matching expression="^>.*" n="3"/>
+                    <has_line_matching expression="^>b0842_1"/>
+                </assert_contents>
+            </output>
+            <output name="read_mapping" ftype="tabular">
+                <assert_contents>
+                    <has_n_lines n="1048"/>
+                    <has_n_columns n="7"/>
+                    <has_text text="b0842_1"/>
+                </assert_contents>
+            </output>
         </test>
     </tests>
-    <help>
-      <![CDATA[
+    <help><![CDATA[
 
 When the mapping is done KMA will produce the following files:
 
-    *.res A result overview giving the most common statistics for each mapped template.
-    *.fsa The consensus sequences drawn from the alignments.
-    *.aln The consensus alignment of the reads against their template.
-    *.frag Mapping information on each mapped read, columns are: 
-        1. read
-        2. number of equally well mapping templates
-        3. mapping score
-        4. start position
-        5. end position (w.r.t. template)
-        6. the choosen template.
-    *.mat Base counts on each position in each template, (only if “-matrix” is enabled)
+* .res A result overview giving the most common statistics for each mapped template.
+* .fsa The consensus sequences drawn from the alignments.
+* .aln The consensus alignment of the reads against their template.
+* .frag Mapping information on each mapped read, columns are: 
+    1. read
+    2. number of equally well mapping templates
+    3. mapping score
+    4. start position
+    5. end position (w.r.t. template)
+    6. the choosen template.
 
-      ]]>
-    </help>
+* .mat Base counts on each position in each template, (only if `-matrix` is enabled)
+]]></help>
     <expand macro="citations" />
 </tool>
--- a/macros.xml	Sat Nov 27 09:35:27 2021 +0000
+++ b/macros.xml	Mon Dec 15 21:59:27 2025 +0000
@@ -1,8 +1,8 @@
 <macros>
-    <token name="@TOOL_VERSION@">1.2.21</token>
-    <token name="@INTYPES@">
-        fastq,fastq.gz,fastqsanger,fastqsanger.gz
-    </token>
+    <token name="@TOOL_VERSION@">1.6.8</token>
+    <token name="@VERSION_SUFFIX@">0</token>
+    <token name="@PROFILE@">23.0</token>
+    <token name="@INTYPES@">fastq,fastq.gz,fastqsanger,fastqsanger.gz</token>
     <xml name="kma_index">
         <param label="Select a KMA index" name="kma_index" type="select">
             <options from_data_table="kma_index">
Binary file test-data/ERR884056_ecoli_b0842.mapped_R1.fastq.gz has changed