view hicCompartmentalization.xml @ 8:3a6a5381db36 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 07802a6bd441d9da888cfb8283f8c2135704f7c9
author iuc
date Wed, 18 Oct 2023 10:51:18 +0000
parents bd6e26c47853
children 4401ed529d2c
line wrap: on
line source

<tool id="hicexplorer_hiccompartmentspolarization" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>compute pairwise correlations between multiple Hi-C contact matrices</description>
    <macros>
        <token name="@BINARY@">hicCompartmentalization</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[

        #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) ])
       
        @BINARY@
            --obsexp_matrices $m
            --pca '$pca'
            --quantile $quantile

            #if $set_offset_value:
                #set $offset_array = $set_offset_value.split(' ')
                #set $offset = ' '.join([ '%s' % int($value) for $value in $offset_array ])
                --offset $offset
            #end if
            --outliers $outliers
            --outputFileName plot.$image_file_format
            #if $matrix:
                --outputMatrix output_matrix.npz
            #end if
        && mv plot.$image_file_format plot
]]>
    </command>
    <inputs>
        <expand macro="matrix_h5_cooler_multiple_macro" />
        <param name="pca" type="data" format="bedgraph" label="Eigenvector file" help="A PCA vector as a bedgraph file with no header. In case of several matrices with 
                    different conditions, ie. control treatment, the PCA of control can be 
                    used. Note that only one PCA can be provided." />
        <param name="quantile" type="integer" value="30" label="Quantile" help="The number of to be used quantiles." />
        <param name="outliers" type="float" value="0.0" label="Outliers" help="The number of outliers to be removed." />
        <param name="set_offset_value" type="text" optional="True" value="" label="Offset values">
            <validator type="expression" message="Only numeric characters and the a space as seperator are allowed.">value.replace(' ', '').isnumeric()</validator>
        </param>

        <param name="image_file_format" type="select" label="Image output format">
            <option value="png" selected="True">png</option>
            <option value="svg">svg</option>
            <option value="pdf">pdf</option>
        </param>
        <param name="matrix" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Output matrix?"/>
    </inputs>
    <outputs>
        <data name="outFileName" format="png" from_work_dir="plot" label="${tool.name} [${on_string}]: Plot">
            <change_format>
                <when input="image_file_format" value="svg" format="svg" />
                <when input="image_file_format" value="pdf" format="pdf" />
            </change_format>
        </data>
        <data name="output_matrix" from_work_dir="output_matrix.npz" format="npz" label="Output .npz file includes all the generated matrices">
            <filter>matrix</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="matrix_h5_cooler_multiple" value="hicTransform/obs_exp_norm.h5" />
            <param name="pca" value="hicCompartmentsPolarization/pca1.bedgraph" ftype="bedgraph" />
            <output name="outFileName" file="hicCompartmentsPolarization/compartmentsPolarizationRatio.png" ftype="png" compare="sim_size" />
        </test>
        <test expect_num_outputs="1">
            <param name="matrix_h5_cooler_multiple" value="hicTransform/obs_exp_norm.h5" />
            <param name="pca" value="hicCompartmentsPolarization/pca1.bedgraph" ftype="bedgraph" />
            <param name="quantile" value="30" />
            <output name="outFileName" file="hicCompartmentsPolarization/compartmentsPolarizationRatio.png" ftype="png" compare="sim_size" />
        </test>
        <test expect_num_outputs="1">
            <param name="matrix_h5_cooler_multiple" value="hicTransform/obs_exp_norm.h5" />
            <param name="pca" value="hicCompartmentsPolarization/pca1.bedgraph" ftype="bedgraph" />
            <param name="outliers" value="1.0" />
            <output name="outFileName" file="hicCompartmentsPolarization/compartmentsPolarizationRatio.png" ftype="png" compare="sim_size" />
        </test>
        <test expect_num_outputs="2">
            <param name="matrix_h5_cooler_multiple" value="hicTransform/obs_exp_norm.h5" />
            <param name="pca" value="hicCompartmentsPolarization/pca1.bedgraph" ftype="bedgraph" />
            <param name="matrix" value="True" />
            <output name="outFileName" file="hicCompartmentsPolarization/compartmentsPolarizationRatio.png" ftype="png" compare="sim_size" />
            <output name="output_matrix" file="hicCompartmentsPolarization/output_matrix.npz" ftype="npz" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[

Comparmentalization
===================

**hicCompartmentalization** rearranges the average interaction frequencies using the first PC values to represent the global compartmentalization signal.
To our knowledge this has been first introduced and implemented by Wibke Schwarzer et al. 2017 (Nature. 2017 Nov 2; 551(7678): 51–56)


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>