view chicQualityControl.xml @ 7:fadd03fbc4f5 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit fa140a9f660eab2459e21b0b637b129d7de24c02
author iuc
date Tue, 10 Jan 2023 19:10:45 +0000
parents db4a82804126
children b892fa1fcaec
line wrap: on
line source

<tool id="hicexplorer_chicqualitycontrol" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>generates an estimate of the quality of each viewpoint</description>
    <macros>
        <token name="@BINARY@">chicQualityControl</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@
            --matrices $m
            --referencePoints '$referencePoints'
            --sparsity $sparsity
            --fixateRange $fixateRange
            --dpi $dpi
            --threads @THREADS@
            --outFileName reference_points
            --outFileNameHistogram histogram.$image_file_format
            --outFileNameSparsity sparsity.$image_file_format

            && mv histogram.$image_file_format histogram
            && mv sparsity.$image_file_format sparsity
    ]]>    </command>
    <inputs>
        <expand macro="matrix_h5_cooler_multiple_macro" />
        <param argument="--referencePoints" type="data" format='interval' label="Reference points" help="Bed file contains all reference points which should be used to build the background model." />
        <param argument="--sparsity" type="float" value="0.05" label="Sparsity threshold" help='Viewpoints with a sparsity less than given are considered of bad quality. If multiple matrices are given, the viewpoint is removed as soon as it is of bad quality in at least one matrix.' />
        <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='dpi' type='integer' value='300' min="100" max="2000" optional='true' label='DPI for image' help='Change the default resolution of the plot.' />
        <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>

    </inputs>
    <outputs>
        <data name="raw_reference_points" from_work_dir="reference_points_raw_filter" format="interval" label="${tool.name} on [${on_string}]: Reference points raw" />
        <data name="rejected_reference_points" from_work_dir="reference_points_rejected_filter" format="interval" label="${tool.name} on [${on_string}]: Reference points rejected" />
        <data name="accepted_reference_points" from_work_dir="reference_points" format="interval" label="${tool.name} on [${on_string}]: Reference points accepted" />
        <data name="failed_reference_points" from_work_dir="reference_points_failed_reference_points" format="interval" label="${tool.name} on [${on_string}]: Reference points failed" />

        <data name="report" from_work_dir="reference_points_report" format="txt" label="${tool.name} on [${on_string}]: Report" />

        <data name="plot_histrogram" from_work_dir="histogram" format="png" label="${tool.name} on [${on_string}]: Histrogram 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="plot_sparsity" from_work_dir="sparsity" format="png" label="${tool.name} on [${on_string}]: Sparsity plot">
            <change_format>
                <when input="image_file_format" value="svg" format="svg" />
                <when input="image_file_format" value="pdf" format="pdf" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="matrix_h5_cooler_multiple" value="cHi-C/FL-E13-5_chr1.cool,cHi-C/MB-E10-5_chr1.cool" />
            <param name="referencePoints" value="cHi-C/referencePoints.bed" />
            <param name='sparsity' value='0.05' />

            <output name="accepted_reference_points" file="cHi-C/chicQualityControl/new_referencepoints.bed" ftype="interval" />
            <output name="raw_reference_points" file="cHi-C/chicQualityControl/new_referencepoints.bed_raw_filter" ftype="interval" />
            <output name="rejected_reference_points" file="cHi-C/chicQualityControl/new_referencepoints.bed_rejected_filter" ftype="interval" />
            <output name="failed_reference_points" file="cHi-C/chicQualityControl/new_referencepoints.bed_failed_reference_points" ftype="interval" />
            <output name="report" file="cHi-C/chicQualityControl/new_referencepoints.bed_report" ftype="txt" />

            <output name="plot_histrogram" file="cHi-C/chicQualityControl/histogram.png" ftype="png" compare='sim_size' />
            <output name="plot_sparsity" file="cHi-C/chicQualityControl/sparsity.png" ftype="png" compare="sim_size" />

        </test>
    </tests>
    <help><![CDATA[

Compute the quality of viewpoints
=================================

Computes the sparsity of each viewpoint to determine their quality. A viewpoint is considered of bad quality if it is too sparse i.e. there are too many locations with no interactions recorded.

This script outputs five files: A plot with the sparsity distribution per matrix, a plot with the sparsity distribution as histograms and a filtered reference points file. Additional, the raw filter data and the rejected viewpoints are returned.

An example usage is:

`$ chicQualityControl -m matrix1.h5 matrix2.h5 -rp referencePointsFile.txt --range 20000 40000 --sparsity 0.01 -o referencePointFile_QC_passed.txt`

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>