changeset 4:d5d68989caec draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/meryl commit 51618128e9d1a23f1f3a8c9df7f2b23a2ba3f3c2"
author iuc
date Fri, 30 Apr 2021 06:40:29 +0000
parents 9f7a227436d6
children d63739222f68
files macros.xml meryl.xml test-data/maternal.meryldb test-data/output_25.read-db.tabular
diffstat 4 files changed, 81 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Thu Apr 15 11:52:39 2021 +0000
+++ b/macros.xml	Fri Apr 30 06:40:29 2021 +0000
@@ -1,6 +1,6 @@
 <macros>
-    <token name="@TOOL_VERSION@">1.2</token>
-    <token name="@GALAXY_TOOL_VERSION@">galaxy1</token>
+    <token name="@TOOL_VERSION@">1.3</token>
+    <token name="@GALAXY_TOOL_VERSION@">galaxy0</token>
     <xml name="edam_ontology">
         <edam_topics>                                                                                  
             <edam_topic>topic_0196</edam_topic>
@@ -12,7 +12,7 @@
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="1.1">merqury</requirement>
-            <requirement type="package" version="1.3">meryl</requirement>
+            <requirement type="package" version="@TOOL_VERSION@">meryl</requirement>
             <requirement type="package" version="1.34">tar</requirement>
         </requirements>
     </xml>
--- a/meryl.xml	Thu Apr 15 11:52:39 2021 +0000
+++ b/meryl.xml	Fri Apr 30 06:40:29 2021 +0000
@@ -29,7 +29,11 @@
             mv ./temp_db/* tmp.meryl &&
             meryl
             $operation_type.filter_operations
-            $operation_type.N
+            #if $operation_type.filter_type.type == 'times'
+                $operation_type.filter_type.N
+            #elif $operation_type.filter_type.type == 'frequency'
+                distinct=${operation_type.filter_type.distinct}
+            #end if
             tmp.meryl
             output read-db.meryl &&
             tar -zcf read-db.meryldb read-db.meryl
@@ -60,6 +64,11 @@
             tar -zxf $operation_type.input_meryldb_02 -C ./temp_db/ &&
             mv ./temp_db/* tmp.meryl &&
             meryl histogram tmp.meryl > read-db.hist
+        #elif $operation_type.command_type == 'print'
+            mkdir  -p ./temp_db/ &&
+            tar -zxf $operation_type.input_meryldb_02 -C ./temp_db/ &&
+            mv ./temp_db/* tmp.meryl &&
+            meryl print tmp.meryl > read-db.tabular
         #elif $operation_type.command_type == 'trio-mode'
             export MERQURY=\$(dirname \$(command -v merqury.sh))/../share/merqury/ &&
             #if $operation_type.options_kmer_size.kmer_size == 'estimate'
@@ -138,6 +147,7 @@
                 <option value="arithmetic-kmers">Arithmetic operations on kmer counts</option>
                 <option value="groups-kmers">Operations on sets of k-mers</option>
                 <option value="histogram-kmers">Generate histogram dataset</option>
+                <option value="print">Print kmer counts to a tabular file</option>
                 <option value="trio-mode">Build hap-mer dbs for trios</option>
             </param>
             <when value="count-kmers">
@@ -163,13 +173,25 @@
             </when>
             <when value="filter-kmers">
                 <param name="filter_operations" type="select" label="Filter operations" help="Select an operation to be executed">
-                    <option value="less-than">Less-than: return k-mers that occur fewer than N times in the input</option>
-                    <option value="greater-than">Greater-than: return k-mers that occur more than N times in the input</option>
-                    <option value="equal-to">Equal-to: return k-mers that occur exactly N times in the input</option>
-                    <option value="not-equal-to">Not-equal-to: return k-mers that do not occur exactly N times in the input</option>
+                    <option value="less-than">Less-than: return k-mers that occur fewer than a threshold value</option>
+                    <option value="greater-than">Greater-than: return k-mers that occur more than a threshold value</option>
+                    <option value="equal-to">Equal-to: return k-mers that occur exactly a threshold value</option>
+                    <option value="not-equal-to">Not-equal-to: return k-mers that do not occur exactly a threshold value</option>
                 </param>
                 <param name="input_meryldb_02" type="data" format="meryldb" label="Input meryldb" help="Select a meryldb dataset" />
-                <param name="N" type="integer" min="0" max="50000000000" value="" optional="true" label="Filter value" />
+                
+                <conditional name="filter_type">
+                    <param name="type" type="select" label="Type of filtering">
+                        <option value="times">Return kmers that occur N times in the input</option>
+                        <option value="frequency">Return kmers occurring at specific frequencies</option>
+                    </param>
+                    <when value="times">
+                        <param name="N" type="integer" min="0" max="50000000000" value="" optional="true" label="Number of times in the input" help="Return kmers that occur N times in the input."/>
+                    </when>
+                    <when value="frequency">
+                        <param name="distinct" type="float" min="0" max="1" value="0.9998" optional="true" label="Frequency" help="Return kmers that at specific frequency (e.g. frequency = 0.9998 returns top 0.02% most frequent)"/>
+                    </when>
+                </conditional>
             </when>
             <when value="arithmetic-kmers">
                 <param name="arithmetic_operations" type="select" label="Arithmetic operations" help="Select an operation to be executed">
@@ -203,6 +225,9 @@
             <when value="histogram-kmers">
                 <param name="input_meryldb_02" type="data" format="meryldb" label="Input meryldb" />
             </when>
+            <when value="print">
+                <param name="input_meryldb_02" type="data" format="meryldb" label="Input meryldb" />
+            </when>
             <when value="trio-mode">
                 <param name="child_reads" type="data" format="fastq,fasta" multiple="true" label="F1 reads" help="Select F1 reads used for generating the assembly" />
                 <param name="paternal_reads" type="data" format="fastq,fasta" multiple="true" optional="true" label="Paternal reads" help="Select the paternal reads used for generating the assembly" />
@@ -225,11 +250,14 @@
     </inputs>
     <outputs>
         <data name="read_db" format="meryldb" from_work_dir="read-db.meryldb" label="${tool.name} on ${on_string}: read-db.meryldb">
-            <filter>operation_type["command_type"] != "histogram-kmers"</filter>
+            <filter>operation_type["command_type"] != "histogram-kmers" and operation_type["command_type"] != "print"</filter>
         </data>
         <data name="read_db_hist" format="tabular" from_work_dir="read-db.hist" label="${tool.name} on ${on_string}: read-db histogram">
             <filter>operation_type["command_type"] == "histogram-kmers" or operation_type["command_type"] == "trio-mode"</filter>
         </data>
+        <data name="read_db_print" format="tabular" from_work_dir="read-db.tabular" label="${tool.name} on ${on_string}: kmer counts">
+            <filter>operation_type["command_type"] == "print"</filter>
+        </data>
         <data name="pat_db" format="meryldb" from_work_dir="pat.meryldb" label="${tool.name} on ${on_string}: pat.meryldb">
             <filter>operation_type["command_type"] == "trio-mode"</filter>
         </data>
@@ -268,7 +296,9 @@
                 <param name="command_type" value="filter-kmers" />
                 <param name="filter_operations" value="less-than" />
                 <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb" />
-                <param name="N" value="100" />
+                <conditional name="filter_type">
+                    <param name="N" value="100" />
+                </conditional>
             </conditional>
             <output name="read_db" ftype="meryldb">
                 <assert_contents>
@@ -281,7 +311,9 @@
                 <param name="command_type" value="filter-kmers" />
                 <param name="filter_operations" value="greater-than" />
                 <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb" />
-                <param name="N" value="80" />
+                <conditional name="filter_type">
+                    <param name="N" value="80" />
+                </conditional>
             </conditional>
             <output name="read_db" ftype="meryldb">
                 <assert_contents>
@@ -292,9 +324,26 @@
         <test expect_num_outputs="1">
             <conditional name="operation_type">
                 <param name="command_type" value="filter-kmers" />
+                <param name="filter_operations" value="greater-than" />
+                <param name="input_meryldb_02" value="maternal.meryldb" ftype="meryldb" />
+                <conditional name="filter_type">
+                    <param name="distinct" value="0.9998" />
+                </conditional>
+            </conditional>
+            <output name="read_db" ftype="meryldb" >
+                <assert_contents>
+                    <has_size value="1634" delta="300" />
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="operation_type">
+                <param name="command_type" value="filter-kmers" />
                 <param name="filter_operations" value="equal-to" />
                 <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb" />
-                <param name="N" value="100" />
+                <conditional name="filter_type">
+                    <param name="N" value="100" />
+                </conditional>
             </conditional>
             <output name="read_db" ftype="meryldb">
                 <assert_contents>
@@ -307,7 +356,9 @@
                 <param name="command_type" value="filter-kmers" />
                 <param name="filter_operations" value="not-equal-to" />
                 <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb" />
-                <param name="N" value="100" />
+                <conditional name="filter_type">
+                    <param name="N" value="100" />
+                </conditional>
             </conditional>
             <output name="read_db" ftype="meryldb">
                 <assert_contents>
@@ -575,6 +626,13 @@
             </conditional>
             <output name="read_db_hist" file="output_24.read-db.hist" />
         </test>
+        <test expect_num_outputs="1">
+            <conditional name="operation_type">
+                <param name="command_type" value="print" />
+                <param name="input_meryldb_02" value="maternal.meryldb" ftype="meryldb" />
+            </conditional>
+            <output name="read_db_print" file="output_25.read-db.tabular" sort="True"/>
+        </test>
     </tests>
     <help><![CDATA[
 
@@ -588,9 +646,9 @@
 In addition of generating count-databases, meryl can perform simple operations on it. 
 
 -----
-            
+
 .. class:: infomark
-            
+
 **Basic functions**
 
 The functions that meryl includes are described below: 
@@ -626,9 +684,9 @@
         - Symmetric-difference: return k-mers that occur in exactly one input
 
 -----
-            
+
 .. class:: infomark
-            
+
 **Additional function: build hap-mers dbs for trios**
 
 In addition of the basic operations, this wrapper allows to build the hap-mers databases for trios, in accordance
Binary file test-data/maternal.meryldb has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output_25.read-db.tabular	Fri Apr 30 06:40:29 2021 +0000
@@ -0,0 +1,5 @@
+ACTAGGG	14
+CTAGACG	19
+CTAGGTC	15
+CCTAGTC	10
+CCTAGGA	11