view filter-kmers.xml @ 1:4f5b7b30ed7d draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/meryl commit 6935ad9dddbbb913817552d682d0b2208481dc7f
author iuc
date Sun, 09 Nov 2025 18:34:21 +0000
parents 956142499a02
children
line wrap: on
line source

<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 -xmf $input_meryldb_02 --use-compress-program="pigz -p \${GALAXY_SLOTS:-1}" -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=$filter_type.distinct
    #end if
    tmp.meryl
    output read-db.meryl &&
    tar -cf read-db.meryldb --use-compress-program="pigz -p \${GALAXY_SLOTS:-1}" 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="type" value="times"/>
                <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="32382" delta="3000"/>
                    <expand macro="meryldb_archive_assumptions"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="filter_type">
                <param name="type" value="times"/>
                <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="50850" delta="3000"/>
                    <expand macro="meryldb_archive_assumptions"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="filter_type">
                <param name="type" value="frequency"/>
                <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="1880" delta="1000"/>
                    <expand macro="meryldb_archive_assumptions"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="filter_type">
                <param name="type" value="times"/>
                <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="3073" delta="1000"/>
                    <expand macro="meryldb_archive_assumptions"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="filter_type">
                <param name="type" value="times"/>
                <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="59719" delta="3000"/>
                    <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>