view chicSignificantInteractions.xml @ 8:640e0e45518a 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 10:52:55 +0000
parents 6001400eed99
children
line wrap: on
line source

<tool id="hicexplorer_chicsignificantinteractions" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>computes viewpoints with the given reference points and a background model</description>
    <macros>
        <token name="@BINARY@">chicSignificantInteractions</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
        #import re
      
        @BINARY@
    
            --interactionFile '$interactionFile'
    
            --pValue $pvalue

            #if $filter_conditional.filter_selector == 'optionXfold':
                --xFoldBackground $filter_conditional.xfold
            #else:
                --loosePValue $filter_conditional.loosePvalue

            #end if
            --backgroundModelFile '$backgroundModelFile'
            --peakInteractionsThreshold $peakInteractionsThreshold
            --range $rangeUpstream $rangeDownstream
            --combinationMode $mode_selector
            --outFileNameSignificant significant.hdf5
            --outFileNameTarget target.hdf5
            $truncateZeroPvalues
            --fixateRange $fixateRange
            --threads @THREADS@

    ]]>    </command>
    <inputs>
        <param name="interactionFile" type="data" format="h5" label="The interaction data file created by chicViewpoint" />

        <param name="pvalue" type="float" value="0.05" label="P-value of interaction to be accepted as significant" />
        <conditional name="filter_conditional">
            <param name="filter_selector" type="select" label="List of chromosomes or a BED file containg regions">
                <option value="optionXfold">x-fold over mean background</option>
                <option value="optionLoosePvalue" selected="True">Loose p-value (NB background)</option>
            </param>
            <when value="optionXfold">
                <param name="xfold" type="float" value="2.0" label="X-fold over mean background to be accepted." help="Filter x-fold over background. 
                    Used to merge neighboring bins with a broader peak but less significant interactions to one peak with high significance. Used only for pValue option." />
            </when>
            <when value="optionLoosePvalue">
                <param name="loosePvalue" type="float" value="0.3" label="Loose p-value" help="loose p-value threshold value to filter target regions in a first round.
                    Used to merge neighboring bins with a broader peak but less significant interactions to one peak with high significance.
                    Used only for pValue option." />
            </when>
        </conditional>

        <param argument="--backgroundModelFile" type="data" format="tabular" label="Background model" help="The background file computed by chicViewpointBackgroundModel" />
        <param argument="--peakInteractionsThreshold" type="integer" value="5" label="Minimum interactions" help="The minimum number of interactions a detected peaks needs to have to be considered." />

        <param name="mode_selector" type="select" label="Process matrices independently or combine always two (for differential analysis preparation)">
                <option value="dual">Dual</option>
                <option value="single" selected="True">Single</option>
        </param>
        <param name="rangeUpstream" type="integer" value="500000" label="Upstream range" help="Defines the region upstream of a reference point which should be considered in the analysis." />
        <param name="rangeDownstream" type="integer" value="500000" label="Downstream range" help="Defines the region upstream of a reference point which should be considered in the analysis." />
        <param argument="--fixateRange" type="integer" value="500000" label="Clip background distance" help="Fixate score of background model starting at distance x. E.g. all values greater 500kb are set to the value of the 500kb bin." />
        <param name="truncateZeroPvalues" type="boolean" truevalue="--truncateZeroPvalues" falsevalue="" checked="false" label="Truncate zeros by setting them to one." help="Sets all p-values which are equal to zero to one. This has the effect that the associated positions are not part of the significance decision." />
    </inputs>

    <outputs>
        <data name="significantFile" from_work_dir="significant.hdf5" format="h5" label="${tool.name} significant file" />
        <data name="targetFile" from_work_dir="target.hdf5" format="h5" label="${tool.name} target file" />
    </outputs>
    <tests>
        <test>
            <param name="interactionFile" value="cHi-C/chicViewpoint/two_matrices.hdf5" />
            <param name="pvalue" value="0.2" />

            <conditional name="filter_conditional">
                <param name="filter_selector" value="optionLoosePvalue" />
                <param name="loosePvalue" value="0.5" />
            </conditional>
            <param name="mode_selector" value="dual" />
            <param name="backgroundModelFile" value="cHi-C/background.txt" />
            <param name="rangeUpstream" value="200000" />
            <param name="rangeDownstream" value="200000" />

            <output name="significantFile" ftype="h5">
                <assert_contents>
                    <has_h5_attribute key="combinationMode" value="dual" />
                    <has_h5_attribute key="mode_preselection" value="loosePValue" />
                    <has_h5_attribute key="type" value="significant" />
                </assert_contents>
            </output>

            <output name="targetFile" ftype="h5">
                <assert_contents>
                     <has_h5_attribute key="combinationMode" value="dual" />
                    <has_h5_attribute key="mode_preselection" value="loosePValue" />
                    <has_h5_attribute key="type" value="target" />
                </assert_contents>
            </output>
        </test>
      
    </tests>
    <help><![CDATA[

Significant interaction detection
=================================

Significant interactions are detected by this tool for each viewpoint based on the background model. chicSignificantInteractions outputs for each viewpoint a file containing all recorded significant interactions and
a target file. The target file is especially useful in the batch mode context, as it merges for two consecutive listed control and treatment viewpoint the significant interactions which can then be used
to test for a differential interaction scheme.

chicSignificantInteractions supports two modes to detect significant interactions, either by an x-fold over the average background or a loose p-value. In both cases neighboring significant peaks are merged together and an additional
p-value based on the sum of interactions for this neighborhood is computed. Only interactions with a higher p-value as specified by the threshold `--pValue` are accepted as a significant interaction.

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>