view subtract.xml @ 6:0427ca314f3d draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/subtract commit d7b1a60c0aecc46b7f625c3e32f882562b512fd9
author devteam
date Mon, 13 Jun 2022 16:24:31 +0000
parents 0145969324c4
children
line wrap: on
line source

<tool id="gops_subtract_1" name="Subtract" version="1.0.0">
    <description>the intervals of two datasets</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <code file="operation_filter.py"/>
    <command><![CDATA[
python '$__tool_directory__/gops_subtract.py'
'$input1'
'$input2'
'$output'

#if $input1.is_of_type('gff')
    -1 1,4,5,7 --gff1
#else:
    -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
#end if

#if $input2.is_of_type('gff')
    -2 1,4,5,7 --gff2
#else:
    -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol}
#end if

-m $min
$returntype
    ]]></command>
    <inputs>
        <param name="input2" type="data" format="interval,gff" label="Subtract" help="Second dataset" />
        <param name="input1" type="data" format="interval,gff" label="from" help="First dataset" />
        <param name="returntype" type="select" label="Return" help="of the first dataset (see figure below)">
            <option value="">Intervals with no overlap</option>
            <option value="-p">Non-overlapping pieces of intervals</option>
        </param>
        <param name="min" type="integer" value="1" min="1" label="where minimal overlap is" help="(bp)" />
    </inputs>
    <outputs>
        <data name="output" format_source="input1" metadata_source="input1"/>
    </outputs>
    <tests>
        <test>
            <param name="input1" value="1.bed" />
            <param name="input2" value="2.bed" />
            <param name="min" value="1" />
            <param name="returntype" value="" />
            <output name="output" file="gops-subtract.dat" />
        </test>
        <test>
            <param name="input1" value="1.bed" />
            <param name="input2" value="2_mod.bed" ftype="interval"/>
            <param name="min" value="1" />
            <param name="returntype" value="" />
            <output name="output" file="gops_subtract_diffCols.dat" />
        </test>
        <test>
            <param name="input1" value="gops_subtract_bigint.bed" />
            <param name="input2" value="2.bed" />
            <param name="min" value="1" />
            <param name="returntype" value="" />
            <output name="output" file="gops-subtract.dat" />
        </test>
        <test>
            <param name="input1" value="1.bed" />
            <param name="input2" value="2.bed" />
            <param name="min" value="10" />
            <param name="returntype" value="Non-overlapping pieces of intervals" />
            <output name="output" file="gops-subtract-p.dat" />
        </test>
        <!-- Subtract two GFF files. -->
        <test>
            <param name="input1" value="gops_subtract_in1.gff" />
            <param name="input2" value="gops_subtract_in2.gff" />
            <param name="min" value="1" />
            <param name="returntype" value="" />
            <output name="output" file="gops_subtract_out1.gff" />
        </test>
        <!-- Subtract BED file from GFF file. -->
        <test>
            <param name="input1" value="gops_subtract_in1.gff" />
            <param name="input2" value="gops_subtract_in2.bed" />
            <param name="min" value="1" />
            <param name="returntype" value="" />
            <output name="output" file="gops_subtract_out1.gff" />
        </test>
    </tests>
    <help><![CDATA[
.. class:: infomark

**TIP:** If your dataset does not appear in the pulldown menu, it means that it is not in interval format. Use "edit attributes" to set chromosome, start, end, and strand columns.

@SCREENCASTS@

**Syntax**

- **Where overlap is at least** sets the minimum length (in base pairs) of overlap between elements of the two datasets.
- **Intervals with no overlap** returns entire intervals from the first dataset that do not overlap the second dataset.  The returned intervals are completely unchanged, and this option only filters out intervals that overlap with the second dataset.
- **Non-overlapping pieces of intervals** returns intervals from the first dataset that have the intervals from the second dataset removed.  Any overlapping base pairs are removed from the range of the interval.  All fields besides start and end are guaranteed to remain unchanged.

-----

**Example**

Intervals with no overlap:

.. image:: gops_subtractOverlappingIntervals.gif

Non-overlapping pieces of intervals:

.. image:: gops_subtractOverlappingPieces.gif
    ]]></help>
</tool>