diff filter-kmers.xml @ 0:c373ea894cfb draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/meryl commit a95f5b04b1219489a327a622184633a561fe5ac0
author iuc
date Thu, 25 Apr 2024 21:01:48 +0000
parents
children fa43288f637c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filter-kmers.xml	Thu Apr 25 21:01:48 2024 +0000
@@ -0,0 +1,134 @@
+<tool id="meryl_filter_kmers" name="Meryl" version="@TOOL_VERSION@+@GALAXY_TOOL_VERSION@@SUFFIX_VERSION@" profile="@PROFILE@">
+    <description>filter k-mers</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="edam_ontology"/>
+    <xrefs>
+        <xref type="bio.tools">meryl</xref>
+    </xrefs>
+    <expand macro="requirements"/>
+    <version_command>meryl --version</version_command>
+    <command detect_errors="exit_code"><![CDATA[
+    export GALAXY_MEMORY_GB=\$((\${GALAXY_MEMORY_MB:-8192}/1024)) &&
+    mkdir  -p ./temp_db/ &&
+    tar -zxf $input_meryldb_02 -C ./temp_db/ &&
+    mv ./temp_db/* tmp.meryl &&
+    meryl
+    $filter_operations
+    #if $filter_type.type == 'times'
+        $filter_type.N
+    #elif $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
+    ]]></command>
+    <inputs>
+        <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 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"/>
+        <conditional name="filter_type">
+            <param name="type" type="select" label="Type of filtering">
+                <option value="times">Return k-mers that occur N times in the input</option>
+                <option value="frequency">Return k-mers 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 k-mers 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 k-mers that at specific frequency (e.g. frequency = 0.9998 returns top 0.02% most frequent)"/>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="read_db" format="meryldb" from_work_dir="read-db.meryldb"/>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="1">
+            <conditional name="filter_type">
+                <param name="N" value="100"/>
+            </conditional>
+            <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb"/>
+            <param name="filter_operations" value="less-than"/>
+            <output name="read_db" ftype="meryldb">
+                <assert_contents>
+                    <has_size value="32077" delta="1000"/>
+                    <expand macro="meryldb_archive_assumptions"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="filter_type">
+                <param name="N" value="80"/>
+            </conditional>
+            <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb"/>
+            <param name="filter_operations" value="greater-than"/>
+            <output name="read_db" ftype="meryldb">
+                <assert_contents>
+                    <has_size value="49643" delta="1000"/>
+                    <expand macro="meryldb_archive_assumptions"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="filter_type">
+                <param name="distinct" value="0.9998"/>
+            </conditional>
+            <param name="input_meryldb_02" value="maternal.meryldb" ftype="meryldb"/>
+            <param name="filter_operations" value="greater-than"/>
+            <output name="read_db" ftype="meryldb">
+                <assert_contents>
+                    <has_size value="1634" delta="1000"/>
+                    <expand macro="meryldb_archive_assumptions"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="filter_type">
+                <param name="N" value="100"/>
+            </conditional>
+            <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb"/>
+            <param name="filter_operations" value="equal-to"/>
+            <output name="read_db" ftype="meryldb">
+                <assert_contents>
+                    <has_size value="2621" delta="1000"/>
+                    <expand macro="meryldb_archive_assumptions"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="filter_type">
+                <param name="N" value="100"/>
+            </conditional>
+            <param name="input_meryldb_02" value="read-db.meryldb" ftype="meryldb"/>
+            <param name="filter_operations" value="not-equal-to"/>
+            <output name="read_db" ftype="meryldb">
+                <assert_contents>
+                    <has_size value="59100" delta="1000"/>
+                    <expand macro="meryldb_archive_assumptions"/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
+    <help>
+
+.. class:: infomark
+
+**Purpose**
+
+Meryl is the k-mer counter. This tool can be used to filter k-mers.
+
+- Less-than: return k-mers that occur fewer than N times in the input
+- Greater-than: return k-mers that occur more than N times in the input
+- Equal-to: return k-mers that occur exactly N times in the input
+- Not-equal-to: return k-mers that do not occur exactly N times in the input
+
+        </help>
+    <expand macro="citations"/>
+</tool>