view hicNormalize.xml @ 4:e24802b3bbad draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit db84cc85222518217286b42262935edd3a49c98e"
author iuc
date Fri, 14 Aug 2020 06:10:11 -0400
parents 483e507c8d42
children 05257e5d5016
line wrap: on
line source

<tool id="hicexplorer_hicnormalize" name="@BINARY@" version="@WRAPPER_VERSION@.0">
    <description>normalizes a matrix to norm range or smallest read count</description>
    <macros>
        <token name="@BINARY@">hicNormalize</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        #import re

        mkdir output &&
        #for $counter, $m in enumerate($matrix_h5_cooler_multiple):
            ln -s '$m' '${counter}_matrix.$m.ext' &&
        #end for
        #set $m = ' '.join([ '\'%s_matrix.%s\'' % ($counter, $matrix.ext) for $counter, $matrix in enumerate($matrix_h5_cooler_multiple) ])
        #set $m_out = ' '.join([ "'output/%s_norm_%s'" % ($counter, @ESCAPE_IDENTIFIER_MATRIX@) for $counter, $matrix in enumerate($matrix_h5_cooler_multiple) ])

        @BINARY@ --matrices $m
        #if $normalize_conditional.normalize == 'multiplicative':
            --multiplicativeValue $normalize_conditional.multiplicativeValue
        #end if
        --normalize $normalize_conditional.normalize
        #if $zero_threshold_value:
            --setToZeroThreshold $zero_threshold_value
        #end if

        --outFileName $m_out
]]>
    </command>
    <inputs>
        <expand macro='matrix_h5_cooler_multiple_macro'/>
        <conditional name="normalize_conditional">
            <param name='normalize' type='select' label='Normalize matrices'>
                <option value='norm_range'>0 to 1 range</option>
                <option value='smallest'>Smallest read count</option>
                <option value='multiplicative'>Multiply by value</option>
            </param>
            <when value='norm_range'/>
            <when value='smallest'/>
            <when value='multiplicative'>
                <param name="multiplicativeValue" type="float" value="1.0" label="Multiplicative value"/>
            </when>
        </conditional>
        <param name="zero_threshold_value" type="float" value="1.0" optional='True' label="Set values below this threshold to zero"/>
    </inputs>
    <outputs>
        <data format='cool' name="normalize_matrix">
            <discover_datasets pattern="__name_and_ext__" directory="output"  visible="true"/>
            <change_format>
                <when input_dataset="matrix_h5_cooler_multiple" attribute="ext" value="h5" format="h5"/>
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="matrix_h5_cooler_multiple" value="small_test_matrix.cool"/>
            <param name='normalize' value='norm_range'/>
            <output name="normalize_matrix">
                <discovered_dataset designation="0_norm_small_test_matrix" ftype="cool">
                    <assert_contents><has_h5_keys keys="bins,chroms,indexes,pixels"/></assert_contents>
                </discovered_dataset>
            </output>
        </test>
        <test>
            <param name="matrix_h5_cooler_multiple" value="small_test_matrix.cool,small_test_matrix.cool"/>
            <param name='normalize' value='smallest'/>
            <output name="normalize_matrix">
                <discovered_dataset designation="0_norm_small_test_matrix" ftype="cool">
                    <assert_contents><has_h5_keys keys="bins,chroms,indexes,pixels"/></assert_contents>
                </discovered_dataset>
                <discovered_dataset designation="1_norm_small_test_matrix" ftype="cool">
                    <assert_contents><has_h5_keys keys="bins,chroms,indexes,pixels"/></assert_contents>
                </discovered_dataset>
            </output>
        </test>
        <test>
            <param name="matrix_h5_cooler_multiple" value="small_test_matrix.h5,small_test_matrix.h5"/>
            <param name='normalize' value='smallest'/>
            <output name="normalize_matrix">
                <discovered_dataset designation="0_norm_small_test_matrix" ftype="h5">
                    <assert_contents><has_h5_keys keys="intervals,matrix"/></assert_contents>
                </discovered_dataset>
                <discovered_dataset designation="1_norm_small_test_matrix" ftype="h5">
                    <assert_contents><has_h5_keys keys="intervals,matrix"/></assert_contents>
                </discovered_dataset>
            </output>
        </test>
    </tests>
    <help><![CDATA[
Normalization of matrices
=========================

**hicNormalize** normalizes either each matrix to a 0 - 1 value range, to the smallest read coverage or with a user given factor.

_________________

Output
------

The normalized matrices.

_________________

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

.. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
.. _`Lieberman-Aiden et al. (2009)`: https://doi.org/10.1126%2Fscience.1181369
]]></help>
    <expand macro="citations" />
</tool>