view diagram.xml @ 3:27ecb3477d34 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cnvkit commit 9d922676808c5f57e9c01b148eec6cc0a63c53e5
author iuc
date Fri, 13 Dec 2024 23:56:18 +0000
parents 697c61206f5f
children
line wrap: on
line source

<tool id="cnvkit_diagram" name="CNVkit Diagram" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
    <description>Draw copy number on chromosomes as a diagram</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="xrefs"/>
    <expand macro="creators"/>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[  
        ln -s '$input_cnr_file' ./tumor.cnr &&
        #if $advanced_settings.segment
            ln -s '$advanced_settings.segment' ./segment.cns &&
        #end if
        cnvkit.py diagram
            ./tumor.cnr
            --output sample-diagram.pdf
            #if $advanced_settings.segment
                --segment ./segment.cns
            #end if
            #if str($advanced_settings.threshold)
                --threshold $advanced_settings.threshold
            #end if
            #if str($advanced_settings.min_probes)
                --min-probes $advanced_settings.min_probes
            #end if
            $advanced_settings.male_reference
            #if str($advanced_settings.Sample_sex.sex) == "yes":
                #if '$advanced_settings.Sample_sex.sample_sex' == "Male"
                    #set $sample_sex_val = "Male"
                    --sample-sex '$segment_method_val'
                #else
                    --sample-sex '$advanced_settings.Sample_sex.sample_sex'
                #end if
            #end if
            $advanced_settings.no_shift_xy
            #if $plot_aesthetics.title
                --title '$plot_aesthetics.title'
            #end if
            #if $advanced_settings.chromosome
                --chromosome '$advanced_settings.chromosome'
            #end if
            $plot_aesthetics.no_gene_labels
    ]]></command>
    <inputs>
        <param name="input_cnr_file" type="data" format="tabular" label="Bin-Level log2 Ratios/Coverages cnr file" help="" />
        <section name="advanced_settings" title="Advanced settings" expanded="false">
            <expand macro="diagram_optional" />
            <expand macro="sample_sex_condition" />
        </section>    
        <section name="plot_aesthetics" title="Plot aesthetics" expanded="false">
            <expand macro="diagram_plot" />
        </section>
    </inputs>
    <outputs>
        <data name="out_diagram_file" format="pdf" label="${tool.name} on ${on_string}: diagram pdf file" from_work_dir="sample-diagram.pdf" />
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_cnr_file" ftype="tabular" value="tumor.cnr" />
            <section name="advanced_settings">
                <param name="segment" ftype="tabular" value="sample.cns" />
                <param name="threshold" value="10" />
                <param name="male_reference" value="1" />
            </section>
            <output name="out_diagram_file" file="sample-diagram.pdf" ftype="pdf" compare="sim_size" > 
                <assert_contents><has_size value="6000" delta="2000" /></assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="input_cnr_file" ftype="tabular" value="tumor.cnr" />
            <section name="advanced_settings">
                <conditional name="Sample_sex">
                    <param name="sex" value="yes" />
                </conditional>
                <param name="segment" ftype="tabular" value="sample.cns" />
                <param name="threshold" value="10" />
                <param name="male_reference" value="1" />
            </section>
            <output name="out_diagram_file" file="sample-diagram.pdf" ftype="pdf" compare="sim_size" > 
                <assert_contents><has_size value="6000" delta="2000" /></assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
         Draw copy number (log2 coverages, segments) on chromosomes as a diagram. If both the raw probes and
         segments are given, show them side-by-side on each chromosome (segments on the left side, probes on the
         right side).
    ]]></help>
    <expand macro="citations" />
</tool>