view chira_merge.xml @ 4:0170de5072d4 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/chira commit aafb8e5de9023eeddd7f4683909f418ef5aae086"
author iuc
date Fri, 20 Mar 2020 05:11:17 -0400
parents ce26b5a859ba
children 35f433d0bd7f
line wrap: on
line source

<tool id="chira_merge" name="ChiRA merge" version="@WRAPPER_VERSION@0">
    <description>merge aligned positions</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command><![CDATA[
        chira_merge.py
        -b '$alignments'
        #if str($annotation.choice) == "yes":
            -g '$annotation.gtf'
        #end if
        -so '$segment_overlap'
        #if str($merge.mode) == "blockbuster":
            -bb
            -d '$merge.distance'
            -mc '$merge.min_cluster_height'
            -mb '$merge.min_block_height'
            -sc '$merge.scale'
        #else:
            -ao '$merge.alignment_overlap'
        #end if
        -o ./
    ]]></command>

    <inputs>
        <param format="bed" name="alignments" type="data" label="Input BED file of alignments"/>
        <conditional name="annotation">
            <param name="choice" type="select" label="Do you have an annotation in GTF format?">
                <option value="yes">Yes</option>
                <option value="no">No</option>
            </param>
            <when value="yes">
                <param format="gtf,gff" name="gtf" type="data" label="Annotations in GTF format"/>
            </when>
            <when value="no">
                <!-- Do nothing -->
            </when>
        </conditional>
        <param name="segment_overlap" type="float" value="0.7" label="Overlap fraction for merging mapped read positions to segments" min="0" max="1"
            help="Matching read positions with greater than this fraction overlap are merged into a segment"/>
        <conditional name="merge">
            <param name="mode" type="select" label="Select the mode of merging">
                <option value="overlap">Overlap based</option>
                <option value="blockbuster">Gaussian based (blockbuster)</option>
            </param>
            <when value="overlap">
                <param name="alignment_overlap" type="float" value="0.7" label="Overlap fraction for merging alignments" min="0" max="1"
                    help="Minimum fraction of BED entries that must overlap inorder to merge"/>
            </when>
            <when value="blockbuster">
                <param name="distance" type="integer" value="30" label="Blockbuster parameter distance"
                    help="Minimum distance between two clusters"/>
                <param name="min_cluster_height" type="float" value="10" label="Blockbuster parameter minClusterHeight"
                    help="minimum height (readno) of a cluster"/>
                <param name="min_block_height" type="float" value="1" label="Blockbuster parameter minBlockHeight"
                    help="minimum height (readno) of a block"/>
                <param name="scale" type="float" value="0.4" label="Blockbuster parameter scale" min="0" max="1"
                    help="scale stddev for a single read"/>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data format="bed" name="segments_bed" from_work_dir="segments.bed" label="ChiRA aligned read segments on ${on_string}"/>
        <data format="tabular" name="merged_bed" from_work_dir="merged.bed" label="ChiRA merged alignments on ${on_string}"/>
    </outputs>

    <tests>
        <!-- Test: Merge without annotation -->
        <test expect_num_outputs="2">
            <param name="alignments" value="alignments.bed"/>
            <param name="choice" value="no" />
            <output name="segments_bed" >
                <assert_contents>
                    <has_text_matching expression="ENSMUST00000160533\t69\t82\t34\|1\|2,ENSMUST00000160533,69,82,\+,42S13M\t1\t\+" />
                </assert_contents>
            </output>
            <output name="merged_bed" >
                <assert_contents>
                    <has_text_matching expression="ENSMUST00000182010\t408\t477\t\+" />
                    <has_text_matching expression="mmu-miR-106a-3p\t4\t15\t\+" />
                </assert_contents>
            </output>
        </test>
        <!-- Test: Merge with annotation -->
        <test expect_num_outputs="2">
            <param name="alignments" value="alignments.bed" />
            <param name="choice" value="yes" />
            <param name="gtf" value="annotation.gtf" />
            <output name="segments_bed" >
                <assert_contents>
                    <has_text_matching expression="5\t137142331\t137142344\t34\|1\|2,ENSMUST00000160533,69,82,\+,42S13M\t1\t-" />
                </assert_contents>
            </output>
            <output name="merged_bed" >
                <assert_contents>
                    <has_text_matching expression="17\t39846957\t39847016\t\+" />
                    <has_text_matching expression="5\t137142331\t137142344\t-" />
                </assert_contents>
            </output>
        </test>
        <!-- Test: Merge using blockbuster -->
        <test expect_num_outputs="2">
            <param name="alignments" value="alignments.bed" />
            <param name="choice" value="yes" />
            <param name="gtf" value="annotation.gtf" />
            <param name="mode" value="blockbuster" />
            <param name="min_cluster_height" value="5" />
            <output name="segments_bed" >
                <assert_contents>
                    <has_text_matching expression="5\t137142331\t137142344\t34\|1\|2,ENSMUST00000160533,69,82,\+,42S13M\t1\t-" />
                </assert_contents>
            </output>
            <output name="merged_bed" >
                <assert_contents>
                    <has_text_matching expression="17\t39846957\t39847016\t\+" />
                </assert_contents>
            </output>
        </test>
    </tests>

    <help>

.. class:: infomark

**What it does**

This tool merges the overlapping aligned positions to define the read concentrated loci. If an annotation GTF file produced, the transcriptomic alignment positions are first converted to their corresponding genomic positions.

**Inputs**

* Alignments in BED format
* An annotation GTF file contaning reference genomic positions.

**Output**

* BED file containing the alignments with reads categorized into segments depending on which part of the read is aligned.
* Tabular file containing merged alignments. 4th column contains all the alignments merged into that location.

    </help>
    <expand macro="citations" />
</tool>