view calculate_contrast_threshold.xml @ 0:7371bb087d86 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/calculate_contrast_threshold commit 6ba8e678f8cedabaf9b4759cddb81b8b3cd9ec31"
author iuc
date Wed, 11 Sep 2019 09:28:55 -0400
parents
children
line wrap: on
line source

<tool id="calculate_contrast_threshold" name="Calculate Contrast threshold" version="1.0.0">
    <description>from tag pileup CDT
    </description>
    <requirements>
        <requirement type="package" version="1.15.4">numpy</requirement>
        <requirement type="package" version="3.7.4">python</requirement>
    </requirements>
    <command detect_errors="exit_code">
        <![CDATA[
      python '$__tool_directory__/calculate_contrast_threshold.py' -i '$input_file'

      ## Setting the quantile values properly.
      #if str($quantile_type.quantile_type_selector) == "b_option":
        -q '${quantile_type.quantile}'
        -m '${quantile_type.min_contrast}'
      #else if str($quantile_type.quantile_type_selector) == "t_option":
        -t '${quantile_type.quantile2}'
      #end if
      
      -d '$header' -s '$start_col' -r '$row_num' -l '$col_num'
    ]]>
    </command>

    <inputs>
        <param name="input_file" argument="-i" type="data" format="txt" label="Pileup Data Matrix "/>
        <param name="header" argument="-d" type="boolean" truevalue="T" falsevalue="F" checked="true" label="Does the input file have a Header ?" help="Standard CDT file have headers."/>
        <param name="start_col" argument="-s" type="integer" value="2" label="Valid Data Start Column" help="Valid data values start from this column"/>
        <param name="col_num" argument="-l" type="integer" value="300" label="Plot Width in pixels" help="Equal to the heatmap width you plan to create"/>
        <param name="row_num" argument="-r" type="integer" value="600" label="Plot Height in pixels" help="Equal to the heatmap height you plan to create"/>


        <conditional name="quantile_type">
            <param name="quantile_type_selector" type="select" display="radio" label="Choose the Contrast paramter">
                <option value="b_option" selected="true">Calculate thresholds from data (-b)</option>
                <option value="t_option">Enforce absolute thresholds (-t)
                </option>
            </param>

            <when value="b_option">
                <param name="quantile" argument="-b" type="float" min="0" max="100" value="95" label="Quantile" help="Enter your quantile value above."/>
                <param name="min_contrast" type="float" min="0" value="0" label="Minimum upper limit after Quantile calculation" help="This value will be used as the upper limit if the calculated quantile is below this value" argument="-m"/>
            </when>

            <when value="t_option">
                <param name="quantile2" argument="-t" type="float" min="0" value="0.0" label="Absolute tag threshold" help="Enter your custom tag threshold value above. takes real values (>= 0)"/>
            </when>
        </conditional>

    </inputs>

    <outputs>
        <data name="threshold_output" format="txt" from_work_dir="calcThreshold.txt"/>
    </outputs>

    <tests>
        <test>
            <param name="input_file" value="sample.tabular"/>
            <param name="header" value="T"/>
            <param name="start_col" value="2"/>
            <param name="col_num" value="300"/>
            <param name="row_num" value="600"/>
            <conditional name="quantile_type">
                <param name="quantile_type_selector" value="b_option"/>
                <param name="quantile" value="95"/>
                <param name="min_contrast" value="5"/>
            </conditional>
            <output name="threshold_output" file="calcThreshold_b.txt" />
        </test>
        <test>
            <param name="input_file" value="sample.tabular"/>
            <param name="header" value="T"/>
            <param name="start_col" value="2"/>
            <param name="col_num" value="300"/>
            <param name="row_num" value="600"/>
            <conditional name="quantile_type">
                <param name="quantile_type_selector" value="t_option"/>
                <param name="quantile2" value="10.0"/>
            </conditional>
            <output name="threshold_output" file="calcThreshold_t.txt" />
        </test>
    </tests>

    <help>
        <![CDATA[

**What it does**

----

Calculates a contrast threshold from the CDT file generated by ``tag_pileup_frequency``. The calculated values are then used to set a uniform contrast for all the heatmaps generated downstream.

**Choosing Plot Width & Height**

If your trying to create heatmaps with dimensions (Width x Height)px = (300 x 600)px. Use Plot width = 300, height = 600. This not only helps in generating unbiased heatmaps but also helps in reusing the calculated contrasts for heatmaps of same dimensions.

**Understanding contrast parameters**

`-b`

    Calculates a percentile value (for example 95th percentile) from the input CDT data matrix to report upper-limit and lower-limit for setting heatmap contrasts.

    Also can set a minimum upper-limit to fall-back, incase the calculated percentile is <= specified minimum.

`-t`

    Takes the absolute value entered and reports an upper_limit and lower_limit.

    ]]>
    </help>

    <citations>
        <citation type="bibtex">
            @unpublished{None,
            author = {Kuntala, Prashant Kumar and Lai, William KM },
            title = {None},
            year = {None},
            eprint = {None},
            url = {http://www.pughlab.psu.edu/}
        }</citation>
    </citations>

</tool>