view scatter.xml @ 5:64960243c9e1 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cnvkit commit fc1282ec68b346988203ead860e9b9d6a47e9efb
author iuc
date Sat, 01 Mar 2025 12:04:46 +0000
parents 02446206f574
children
line wrap: on
line source

<tool id="cnvkit_scatter" name="CNVkit Scatter" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
    <description>Plot bin-level log2 coverages and segmentation calls together</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
        #if $advanced_settings.range_list
            ln -s '$advanced_settings.range_list' ./list.bed &&
        #end if
        #if $advanced_settings.additional_SNP_allelic_process.vcf
            ln -s '$advanced_settings.additional_SNP_allelic_process.vcf' ./vcf_file.vcf &&
        #end if
        cnvkit.py scatter
            ./tumor.cnr
            --output sample-scatter.pdf
            #if $advanced_settings.segment
                --segment ./segment.cns
            #end if
            #if $advanced_settings.chromosome
                --chromosome '$advanced_settings.chromosome'
            #end if
            #if $advanced_settings.gene
                --gene '$advanced_settings.gene'
            #end if
            #if $advanced_settings.range_list
                --range-list ./list.bed
            #end if
            #if str($advanced_settings.width)
                --width  $advanced_settings.width
            #end if
            #if $advanced_settings.plot_aesthetics.antitarget_marker
                --antitarget-marker '$advanced_settings.plot_aesthetics.antitarget_marker'
            #end if
            $advanced_settings.plot_aesthetics.by_bin
            #if $advanced_settings.plot_aesthetics.segment_color
                --segment-color '$advanced_settings.plot_aesthetics.segment_color'
            #end if
            #if $advanced_settings.plot_aesthetics.title
                --title '$advanced_settings.plot_aesthetics.title'
            #end if
            $advanced_settings.plot_aesthetics.trend
            #if str($advanced_settings.plot_aesthetics.y_max)
                --y-max $advanced_settings.plot_aesthetics.y_max
            #end if
            #if str($advanced_settings.plot_aesthetics.y_min)
                --y-min $advanced_settings.plot_aesthetics.y_min
            #end if
            #if str($advanced_settings.plot_aesthetics.fig_size)
                --fig-size $advanced_settings.plot_aesthetics.fig_size
            #end if
            #if $advanced_settings.additional_SNP_allelic_process.vcf
                --vcf ./vcf_file.vcf
            #end if
            #if $advanced_settings.additional_SNP_allelic_process.sample_id
                --sample-id '$advanced_settings.additional_SNP_allelic_process.sample_id'
            #end if
            #if $advanced_settings.additional_SNP_allelic_process.normal_id
                --normal-id '$advanced_settings.additional_SNP_allelic_process.normal_id'
            #end if
            #if str($advanced_settings.additional_SNP_allelic_process.min_variant_depth)
                --min-variant-depth $advanced_settings.additional_SNP_allelic_process.min_variant_depth
            #end if
            #if str($advanced_settings.additional_SNP_allelic_process.zygosity_freq)
                --zygosity-freq $advanced_settings.additional_SNP_allelic_process.zygosity_freq
            #end if
    ]]></command>
    <inputs>
        <param name="input_cnr_file" type="data" format="cnr" label="Bin-Level log2 Ratios/Coverages cnr file" help="" />
        <section name="advanced_settings" title="Advanced settings" expanded="false">
            <expand macro="scatter_optional" />
            <section name="plot_aesthetics" title="Plot aesthetics" expanded="false">
              <expand macro="scatter_plot" />
            </section>
            <section name="additional_SNP_allelic_process" title="Plot aesthetics" expanded="false">
              <expand macro="additionally_SNP_process" />
            </section>
        </section>   
    </inputs>
    <outputs>
        <data name="out_scatter_file" format="pdf" label="${tool.name} on ${on_string}: Sample Scatter pdf file" from_work_dir="sample-scatter.pdf" />
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_cnr_file" ftype="cnr" value="tumor.cnr" />
            <section name="advanced_settings">
                <section name="additional_SNP_allelic_process">
                    <param name="zygosity_freq" value="0.25" />
                </section>
                <section name="plot_aesthetics">
                    <param name="by_bin" value="1" />
                </section>
            </section>
            <output name="out_scatter_file" file="sample-scatter.pdf" ftype="pdf" compare="sim_size">
                <assert_contents><has_size value="12000" delta="5000" /></assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
        Plot bin-level log2 coverages and segmentation calls together. Without any further arguments,
        this plots the genome-wide copy number in a form familiar to those who have used array CGH.

-----

**Bin-level log2 ratios (.cnr)**

Tabular file containing normalized log2 ratios for small genomic bins (divided regions of the genome). Used to detect raw copy number variations (CNVs) before segmentation.

.. csv-table::
   :header-rows: 0

    "chromosome","Genomic chromosome (e.g., chr1, chrX)"
    "start","Start position of the bin."
    "end","End position of the bin."
    "gene","Gene name(s) overlapping the bin (if applicable)."
    "log2","Normalized log2 ratio (sample coverage / reference coverage)."
    "depth","Average read depth in the bin."
    "weight","Reliability weight of the bin (higher = more reliable)."

-----

**Segmented log2 ratios (.cns)**

Tabular file with smoothed, merged segments of stable copy number, derived from the .cnr file. Represents final CNV calls.

.. csv-table::
   :header-rows: 0

    "chromosome","start, end: Genomic coordinates of the segment"
    "gene","Gene(s) overlapping the segment."
    "log2","Mean log2 ratio of the segment."
    "probes","Mean log2 ratio of the segment."
    "depth","Average read depth."
    "weight","Reliability weight."
    "p_value","Statistical confidence (lower = more significant)."

    ]]></help>
    <expand macro="citations" />
</tool>