view pretext_map.xml @ 8:79b48f02db49 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/pretext commit c03782a5d213b2d272c0cbe9af2b7196fab2dc1c
author iuc
date Tue, 13 Feb 2024 21:59:50 +0000
parents 511e5e3cd55e
children
line wrap: on
line source

<tool id="pretext_map" name="PretextMap" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01">
    <description>converts SAM or BAM files into genome contact maps</description>
    <macros>
        <token name="@TOOL_VERSION@">0.1.9</token>
        <token name="@VERSION_SUFFIX@">1</token>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">pretextmap</requirement>
        <requirement type="package" version="1.14">samtools</requirement>
    </requirements>
    <version_command>PretextMap --version</version_command>
    <command detect_errors="exit_code"><![CDATA[
        #if $input.is_of_type("bam"):
            samtools view -h '${input}' |
        #else
            cat '${input}' |
        #end if
        PretextMap
        #if $sorting.sortby == "length":
            --sortby length
            --sortorder $sorting.sortorder
        #elif $sorting.sortby == "name":
            --sortby name
            --sortorder $sorting.sortorder
        #end if
        #if str($map_qual):
            --mapq $map_qual
        #end if
        #if $filter.filter_type == "in":
            --filterInclude '$filter.filter_list'
        #elif $filter.filter_type == "out":
            --filterExclude '$filter.filter_list'
        #end if 
        -o output.pretext
    ]]></command>
    <inputs>
        <param name="input" type="data" format="sam,bam" label="Input dataset in SAM or BAM format"/>
        <conditional name="sorting">
            <param argument="--sortby" type="select" label="Sort by" help="Sort the genome by length or name of the scaffolds">
                <option value="nosort">Don't sort</option>
                <option value="length" selected="true">Length</option>
                <option value="name">Name</option>
            </param>
            <when value="nosort"/>
            <when value="length">
                <param argument="--sortorder" type="select" label="Sort order: ">
                    <option value="ascend">Ascending</option>
                    <option value="descend">Descending</option>
                </param>
            </when>
            <when value="name">
                <param argument="--sortorder" type="select" label="Sort order: ">
                    <option value="ascend">Ascending</option>
                    <option value="descend">Descending</option>
                </param>
            </when>
        </conditional>
        <param name="map_qual" argument="--mapq" type="integer" label="Minimum mapping quality:" min="0" value="10" optional="true" help=" Filter mapped read by minimum MAPQ. Useful to remove spurious contacts from multimapping reads"/>
        <conditional name="filter">
            <param name="filter_type" type="select" label="How to filter: " help="Subset the output excluding a list of scaffolds">
                <option value="" selected="true">No filter</option>
                <option value="in">Filter to include only specified sequence names</option>
                <option value="out">Filter to exclude specified sequence names</option>
            </param>
            <when value=""/>
            <when value="in">
                <param name="filter_list" type="text" label="Filter list" help="Comma separated list of sequence names to use as a filter" value="seq_1,seq_2">
                    <sanitizer>
                        <valid initial="string.ascii_letters,string.digits">
                            <add value="_"/>
                            <add value=","/>
                        </valid>
                    </sanitizer>
                </param>
            </when>
            <when value="out">
                <param name="filter_list" type="text" label="Filter list" help="Comma separated list of sequence names to use as a filter" value="seq_1,seq_2">
                    <sanitizer>
                        <valid initial="string.ascii_letters,string.digits">
                            <add value="_"/>
                            <add value=","/>
                        </valid>
                    </sanitizer>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data format="pretext" name="pretext_map_out" from_work_dir="output.pretext" label="${tool.name} on ${on_string}"/>
    </outputs>
    <tests>
        <test>
            <param name="input" ftype="bam" value="test.bam"/>
            <conditional name="sorting">
                <param name="sortby" value="length"/>
                <param name="sortorder" value="ascend"/>
            </conditional>
            <conditional name="filter">
                <param name="filter_type" value="in"/>
                <param name="filter_list" value="ref"/>
            </conditional>
            <param name="map_qual" value="10"/>
            <output name="pretext_map_out" file="output_1.pretext"/>
        </test>
        <test>
            <param name="input" ftype="sam" value="test.sam"/>
            <conditional name="sorting">
                <param name="sortby" value="name"/>
                <param name="sortorder" value="descend"/>
            </conditional>
            <conditional name="filter">
                <param name="filter_type" value="out"/>
                <param name="filter_list" value="chrM,chr8,chr9"/>
            </conditional>
            <output name="pretext_map_out" file="output_2.pretext"/>
        </test>
    </tests>
    <help><![CDATA[

**What is does**

PretextMap (Paired REad TEXTure Mapper) converts SAM/BAM/CRAM or `pairs files <https://github.com/4dn-dcic/pairix/blob/master/pairs_format_specification.md>`_ into `genome contact maps <https://genome.ucsc.edu/goldenPath/help/hic.html>`_.

    ]]></help>
    <citations>
        <citation type="bibtex">
            @misc{Harry_et_al,
            Author={Harry, E},
            title={Paired REad TEXTure Snapshot: Command line image generator for Pretext contact maps.},
            url = {https://github.com/wtsi-hpag/PretextSnapshot},}
        </citation>
    </citations>
</tool>