view hicAdjustMatrix.xml @ 1:dfefa10b9603 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 4b602d427e0fc0da5353a4510798349de98e4ae4"
author iuc
date Wed, 11 Mar 2020 09:30:04 +0000
parents ac2a7ed2de5e
children c90eeab97d9a
line wrap: on
line source

<tool id="hicexplorer_hicadjustmatrix" name="@BINARY@" version="@WRAPPER_VERSION@.0">
    <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

        && 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>
    </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>
            <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>
            <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>