view hicAdjustMatrix.xml @ 10:782bdcb775fb draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 79133bc3739fbcc6c2055d589679aae312161d03
author iuc
date Mon, 04 Nov 2024 23:57:38 +0000
parents 2dccb6bb0add
children
line wrap: on
line source

<tool id="hicexplorer_hicadjustmatrix" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>adjust the shape of a Hi-C matrix</description>
    <macros>
        <token name="@BINARY@">hicAdjustMatrix</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        #set matrix_name = 'matrix_in.' + str($matrix_h5_cooler.ext)
        #set matrix_file_out = 'matrix_out.' + str($matrix_h5_cooler.ext)

        ln -s '$matrix_h5_cooler' 'matrix_name.$matrix_h5_cooler.ext' &&
        @BINARY@ --matrix 'matrix_name.$matrix_h5_cooler.ext'
        --action $action_selector
        --outFileName '$matrix_file_out'
        #if $chromosomeOrRegionFile_conditional.chromosomeOrRegionFile_selector == "optionChromosomes":
            ## special: --chromosomeOrder is optional, but if given it needs at least one argument
            #set chroms = '\' \''.join([ str($var.chromosome) for $var in $chromosomeOrRegionFile_conditional.chromosomeOrder ])
            #if chroms:
                --chromosomes '$chroms'
            #end if
        #end if

        #if $chromosomeOrRegionFile_conditional.chromosomeOrRegionFile_selector == "optionRegionFile":
            --regions '$chromosomeOrRegionFile_conditional.regions'
        #end if

        #if not $interIntra_selector == 'keep':
            --interIntraHandling $interIntra_selector
        #end if
        && mv '$matrix_file_out' matrix

]]>
    </command>
    <inputs>
        <expand macro="matrix_h5_cooler_macro" />
        <param name="action_selector" type="select" label="Apply action">
            <option value="keep" selected="True">keep</option>
            <option value="remove">remove</option>
            <option value="mask">mask</option>
        </param>
        <conditional name="chromosomeOrRegionFile_conditional">
            <param name="chromosomeOrRegionFile_selector" type="select" label="List of chromosomes or a BED file containg regions">
                <option value="optionChromosomes">Chromosomes</option>
                <option value="optionRegionFile" selected="True">Region BED file</option>
            </param>
            <when value="optionChromosomes">
                <repeat name="chromosomeOrder" min="0" title="Chromosomes to keep / remove / mask" help="The selected option will be applied on the selected chromosomes.">
                    <param name="chromosome" type="text">
                        <validator type="empty_field" />
                    </param>
                </repeat>
            </when>
            <when value="optionRegionFile">
                <param argument="--regions" type="data" format="bed" optional="true" label="BED file with all regions to be considered" help="Should contain the regions which should be kept, removed or masked." />
            </when>
        </conditional>
        <param name="interIntra_selector" type="select" label="Remove inter- or intra chromosomal regions">
            <option value="keep" selected="True">Do not apply</option>
            <option value="inter">Remove inter-chromosomal contacts</option>
            <option value="intra">Remove intra-chromosomal contacts</option>
        </param>
    </inputs>
    <outputs>
        <data name="outFileName" from_work_dir="matrix" format="h5">
            <change_format>
                <when input="matrix_h5_cooler.ext" value="cool" format="cool" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="matrix_h5_cooler" value="small_test_matrix.h5" />
            <param name="action_selector" value="keep" />
            <conditional name="chromosomeOrRegionFile_conditional">
                <param name="chromosomeOrRegionFile_selector" value="optionChromosomes" />
                <repeat name="chromosomeOrder">
                    <param name="chromosome" value="chrX" />
                    <param name="chromosome" value="chr3R" />
                </repeat>
            </conditional>
            <output name="outFileName" ftype="h5">
                <assert_contents>
                    <has_h5_keys keys="intervals,matrix" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="matrix_h5_cooler" value="small_test_matrix.h5" />
            <param name="action_selector" value="mask" />
            <conditional name="chromosomeOrRegionFile_conditional">
                <param name="chromosomeOrRegionFile_selector" value="optionRegionFile" />
                <param name="regions" value="regions.bed" />
            </conditional>
            <output name="outFileName" ftype="h5">
                <assert_contents>
                    <has_h5_keys keys="intervals,matrix,nan_bins" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[

Adjust of the Hi-C matrix
=========================

This tool is able to remove, keep or mask given regions of a Hi-C interaction matrix, including entire chromosomes.

_________________

| For more information about HiCExplorer please consider our documentation on readthedocs.io_

.. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
]]>    </help>
    <expand macro="citations" />
</tool>