view hicPlotViewpoint.xml @ 15:58de3c7c8e89 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 07802a6bd441d9da888cfb8283f8c2135704f7c9
author iuc
date Wed, 18 Oct 2023 11:08:32 +0000
parents b637a1e3cb14
children
line wrap: on
line source

<tool id="hicexplorer_hicplotviewpoint" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>plot interactions around a viewpoint</description>
    <macros>
        <token name="@BINARY@">hicPlotViewpoint</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@ --matrix $m
        #if $interactionOutFileName:
            $interactionOutFileName interactions
        #end if
        --outFileName plot.$image_file_format
        --region $region
        --referencePoint '$referencePoint'
        && mv plot.$image_file_format plot

        #if $interactionOutFileName:
            && mkdir interaction
            #for $counter, $matrix in enumerate($m.split(' ')):
                && mv interactions_${matrix}.bedgraph interaction/${counter}_interactions.bedgraph
            #end for
        #end if
]]>
    </command>
    <inputs>
        <expand macro="matrix_h5_cooler_multiple_macro" />
        <expand macro="region" />
        <param name="referencePoint" type="text" label="Reference point" help="The format is chr:referencePoint or chr:regionStart-regionEnd.">
            <validator type="expression" message="Only alphanumeric characters, the colon or a dash are allowed.">not value or value.replace(':', '').replace('-', '').isalnum()</validator>
        </param>
        <param argument="--interactionOutFileName" type="boolean" truevalue="--interactionOutFileName" falsevalue="" checked="false" label="Create bedgraph file with interactions" />
        <param name="image_file_format" type="select" label="Image output format">
            <option value="png">png</option>
            <option value="svg">svg</option>
        </param>
    </inputs>
    <outputs>
        <data format="png" name="outFileName" from_work_dir="plot" label="${tool.name} [${on_string}]: Plot">
            <change_format>
                <when input="image_file_format" value="png" format="png" />
                <when input="image_file_format" value="svg" format="svg" />
            </change_format>
        </data>
        <data format="bedgraph" name="interactionFile">
            <filter>interactionOutFileName</filter>
            <discover_datasets pattern='__name_and_ext__' directory="interaction" visible="true" />
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="matrix_h5_cooler_multiple" value="Li_et_al_2015.cool" />
            <param name="image_file_format" value="png" />
            <param name="region" value="X:3000000-3500000" />
            <param name="referencePoint" value="X:3200000" />
            <output name="outFileName" file="li_viewpoint_32Mb.png" ftype="png" compare="sim_size" />
        </test>
        <test expect_num_outputs="2">
            <param name="matrix_h5_cooler_multiple" value="Li_et_al_2015.cool" />
            <param name="image_file_format" value="png" />
            <param name="region" value="X:3000000-3500000" />
            <param name="referencePoint" value="X:3200000-3300000" />
            <param name="interactionOutFileName" value="True" />
            <output name="outFileName" file="li_viewpoint_32-33Mb.png" ftype="png" compare="sim_size" />
            <output name="interactionFile">
                <discovered_dataset designation="0_interactions" file="li_32-33mb_interactions.bedgraph" />
            </output>
        </test>
    </tests>
    <help><![CDATA[

Plot Viewpoint
==============

**hicPlotViewpoint** plots the number of interactions around a specific reference point or region in the genome like a 4C analysis using Hi-C data.
This plotting method allows to make long-range interactions more visible.

_________________

Usage
-----

This tool must be used on Hi-C contact matrices corrected using ``hicCorrectMatrix``.

_________________

Output
------

**hicPlotViewpoint** outputs an image with the plotted interactions around the reference point in png or svg format, an example plot can be found bellow. An option allows to also output the interactions as a bedgraph file.

.. image:: $PATH_TO_IMAGES/pulication_plots_viewpoint.png
   :width: 50 %

_________________

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