view chira_merge.xml @ 2:cfd572ff72aa draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/chira commit 485f27ab64a1b312c1022abb18edb89a772d6e3c"
author iuc
date Wed, 11 Mar 2020 03:37:56 -0400
parents ce26b5a859ba
children 0170de5072d4
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            
        -ao '$alignment_overlap'
        -so '$segment_overlap'
        -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="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"/>
        <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"/>
    </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: Map 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\t6|1|4,ENSMUST00000160533,69,82,+,42S13M\t0\t+" />
                </assert_contents>
            </output>
            <output name="merged_bed" >
                <assert_contents>
                    <has_text_matching expression="ENSMUST00000182010\t19\t74\t+\t6|1|1,ENSMUST00000182010,19,68,+,5S49M1S;7|9|1,ENSMUST00000182010,24,74,+,5S50M" />
                </assert_contents>
            </output>
        </test>
        <!-- Test: Map 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\t6|1|4,ENSMUST00000160533,69,82,+,42S13M\t0\t-" />
                </assert_contents>
            </output>
            <output name="merged_bed" >
                <assert_contents>
                    <has_text_matching expression="17\t39846976\t39847031\t+\t6|1|1,ENSMUST00000182010,19,68,+,5S49M1S;7|9|1,ENSMUST00000182010,24,74,+,5S50M" />
                </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>