view brew3r_r.xml @ 2:05f8e9d1e8b8 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/brew3r_r commit 934f4b672e4f21e211a530281a973b61c20035c5
author iuc
date Thu, 27 Jun 2024 07:31:23 +0000
parents 3198f52bffaa
children d3b0390f325f
line wrap: on
line source

<tool id="brew3r_r" name="BREW3R.r" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01" license="MIT">
    <description>Extend GTF</description>
    <macros>
        <token name="@TOOL_VERSION@">1.0.2</token>
        <token name="@VERSION_SUFFIX@">0</token>
    </macros>
    <xrefs>
        <xref type="bio.tools">brew3r.r</xref>
        <xref type="bioconductor">BREW3R.r</xref>
    </xrefs>
    <requirements>
        <!-- <requirement type="package" version="@TOOL_VERSION@">bioconductor-brew3r.r</requirement>
        <requirement type="package" version="1.64.0">bioconductor-rtracklayer</requirement>
        <requirement type="package" version="1.20.4">r-getopt</requirement> -->
        <container type="docker">lldelisle/brew3r:v2</container>
    </requirements>
    <required_files>
        <include path="brew3r.r_script.R" />
    </required_files>
    <version_command><![CDATA[
echo $(R --version | grep version | grep -v GNU)", BREW3R.r version" $(R --vanilla --slave -e "library(BREW3R.r); cat(sessionInfo()\$otherPkgs\$BREW3R.r\$Version)" 2> /dev/null | grep -v -i "WARNING: ")
    ]]></version_command>
    <command detect_errors="exit_code"><![CDATA[
Rscript '${__tool_directory__}/brew3r.r_script.R'
    --gtf_to_extend '$gtf_to_extend'
    --gtf_to_overlap '$gtf_to_overlap'
    #if '$sup_output' == 'true':
        --sup_output '$output_table'
    #end if
    #if str($no_add) != '':
        '$no_add'
    #end if
    #if str($exclude_pattern) != '':
        --exclude_pattern '$exclude_pattern'
    #end if
    #if str($filter_unstranded) != '':
        '$filter_unstranded'
    #end if
    -o output.gtf

    ]]></command>
    <inputs>
        <param argument="--gtf_to_extend" type="data" format="gtf" label="Input gtf file to be extended on 3'" help="Usually coming from public resource." />
        <param argument="--gtf_to_overlap" type="data" format="gtf" label="Input gtf file that will be used to extend" help="Coming from StringTie or another public resource." />
        <param argument="--sup_output" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Get a supplementary output table with resolution of overlaps" />
        <param argument="--no_add" type="boolean" truevalue="--no_add" falsevalue="" checked="false" label="Do not add new exons" />
        <param argument="--exclude_pattern" type="text" value="" label="Do not extend genes with names matching this pattern" help="Leave empty if you want to extend all genes.">
            <sanitizer>
              <valid initial="string.printable">
               <remove value="'"/>
               <remove value="\"/>
             </valid>
            </sanitizer>
        </param>
        <param argument="--filter_unstranded" type="boolean" truevalue="--filter_unstranded" falsevalue="" checked="false" label="Filter unstranded intervals that overlaps genes of both strands" help="Recommanded if you used StringTie on unstranded libraries." />
    </inputs>
    <outputs>
        <data name="output" format="gtf" from_work_dir="output.gtf" label="${tool.name} on ${gtf_to_extend.name} and ${gtf_to_overlap.name}: GTF" />
        <data name="output_table" format="tabular" label="${tool.name} on ${gtf_to_extend.name} and ${gtf_to_overlap.name}: overlap resolution">
            <filter>sup_output == True</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="gtf_to_extend" value="input.gtf"/>
            <param name="gtf_to_overlap" value="second_input.gtf"/>
            <output name="output" value="output.gtf" compare="diff" lines_diff="2"/>
        </test>
        <test expect_num_outputs="1">
            <param name="gtf_to_extend" value="input.gtf"/>
            <param name="gtf_to_overlap" value="second_input.gtf"/>
            <param name="no_add" value="true"/>
            <output name="output">
                <assert_contents>
                    <has_n_lines n="31"/>
                    <not_has_text text="BREW3R"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="gtf_to_extend" value="input.gtf"/>
            <param name="gtf_to_overlap" value="second_input.gtf"/>
            <param name="exclude_pattern" value="^Gm"/>
            <output name="output">
                <assert_contents>
                    <has_n_lines n="34"/>
                    <not_has_text text="exon111.ext"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="gtf_to_extend" value="input.gtf"/>
            <param name="gtf_to_overlap" value="second_input.gtf"/>
            <param name="exclude_pattern" value="Gm$"/>
            <output name="output" value="output.gtf" compare="diff" lines_diff="2"/>
            <assert_command>
                <has_text text="--exclude_pattern 'Gm$'"/>
            </assert_command>
        </test>
        <test expect_num_outputs="1">
            <param name="gtf_to_extend" value="input.gtf"/>
            <param name="gtf_to_overlap" value="second_input.gtf"/>
            <param name="filter_unstranded" value="true"/>
            <output name="output">
                <assert_contents>
                    <has_n_lines n="36"/>
                    <not_has_text text="exon121.ext"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="gtf_to_extend" value="input2.gtf"/>
            <param name="gtf_to_overlap" value="second_input2.gtf"/>
            <param name="filter_unstranded" value="true"/>
            <output name="output" value="output2.gtf" compare="diff" lines_diff="2"/>
        </test>
    </tests>
    <help><![CDATA[

.. class:: infomark

**What it does**

This tool extend the annotations existing in an input GTF file in the 3' end using annotations from another input GTF. During the process, it makes sure that there will not be new overlaps between different genes.

Usage
.....


**Input**

2 GTF files:
- First one to extend usually comes from a public resource.
- Second one that is used as template may come from a public resource or from StringTie.


**Output**

1 GTF file with all exons from the input GTF where some of them have been extended (the exon_id ends with '.ext') and potentially new exons (the exon_id contains BREW3R).

    ]]></help>
    <citations>
        <citation type="bibtex">
            @unpublished{None,
            author = {Lucille Lopez-Delisle},
            title = {None},
            year = {None},
            eprint = {None},
            url = {https://github.com/lldelisle/BREW3R.r}
        }</citation>
    </citations>
</tool>