view bcftools_plugin_mendelian.xml @ 25:6294f7c049f0 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/bcftools commit f6efda26965eb73c9107d367fd5ffdf246ed0dbc
author iuc
date Tue, 02 Dec 2025 07:50:43 +0000
parents 2776dd881da8
children
line wrap: on
line source

<tool name="bcftools @EXECUTABLE@" id="bcftools_plugin_@PLUGIN_ID@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>plugin Count Mendelian consistent / inconsistent genotypes</description>
    <macros>
        <token name="@EXECUTABLE@">mendelian2</token>
        <token name="@PLUGIN_ID@">mendelian</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools" />
    <expand macro="requirements" />
    <expand macro="version_command" />
    <command detect_errors="aggressive"><![CDATA[
@PREPARE_INPUT_FILE@
#set $section = $sec_restrict
@PREPARE_TARGETS_FILE@
@PREPARE_REGIONS_FILE@

bcftools plugin @EXECUTABLE@

## VCF input section
#set $section = $sec_restrict
@INCLUDE@
@EXCLUDE@
@REGIONS@
@TARGETS@

@OUTPUT_TYPE@

## Primary Input/Outputs
@INPUT_FILE@

## Plugin section
#set $section = $sec_plugin
#if $section.trios.trios_src == 'trio':
  --pfm '${section.trios.num_x}:${section.trios.child},${section.trios.mother},${section.trios.father}'
#elif $section.trios.trios_src == 'trio_file':
  --ped '$section.trios.trio_file'
#end if
#set $modes =  "".join(str($section.mode).split(','))
-m $modes
2> tmp_stderr
> '$output_file'
&& cat tmp_stderr
]]>
</command>
    <inputs>
        <expand macro="macro_input" />
        <section name="sec_restrict" expanded="false" title="Restrict to">
            <expand macro="macro_region_restrict" />
            <expand macro="macro_target_restrict" />
            <expand macro="macro_include" />
            <expand macro="macro_exclude" />
        </section>
        <section name="sec_plugin" expanded="true" title="Plugin Options">
            <!-- trios -->
            <conditional name="trios">
                <param name="trios_src" type="select" label="Sample relationship">
                    <option value="trio">trio - mother,father,child (--pfm)</option>
                    <option value="trio_file">trios file - specify 1 or more trios in PED format (--ped)</option>
                </param>
                <when value="trio">
                   <param name="mother" type="text" value="" label="Mother sample name (as it appears in the input)"/>
                   <param name="father" type="text" value="" label="Father sample name (as it appears in the input)"/>
                   <param name="child" type="text" value="" label="Child sample name (as it appears in the input)"/>
                   <param name="num_x" type="boolean" truevalue="1X" falsevalue="2X" label="Male child?" help="This information is used to judge inheritance patterns of X-chromosomal mutations correctly."/>
                </when>
                <when value="trio_file">
                    <param name="trio_file" type="data" format="tabular" label="Sample information in PED format" help="This input dataset can describe one or several family trios. See the tool help below for more information on PED format." />
                </when>
            </conditional>
            <param name="mode" type="select" multiple="true" optional="false" label="Output mode" help="Output mode. Multiple modes can be combined and the drop modes take precedence.">
                <option value="a" selected="true">add INFO -> MERR annotation with the number of inconsistent trios (a)</option>
                <option value="d">delete (i.e., set to "./.") genotypes in inconsistent trios (d)</option>
                <option value="e">output sites with at least one erroneous trio (e)</option>
                <option value="E">drop sites with at least one erroneous trio (E)</option>
                <option value="g">output sites with at least one good (i.e. with non-missing and consistent genotypes) trio (g)</option>
                <option value="m">output sites with missing genotypes in at least one trio (m)</option>
                <option value="M">drop sites with missing genotypes in at least one trio (M)</option>
                <option value="S">drop sites skipped for various reasons when collecting stats (S)</option>
            </param>
        </section>
        <expand macro="macro_select_output_type" />
    </inputs>
    <outputs>
        <expand macro="macro_vcf_output" />
    </outputs>
    <tests>
        <test>
            <!-- This is just a test on a random file, should have a real test case -->
            <param name="input_file" ftype="vcf" value="convert.vcf" />
            <section name="sec_plugin">
                <conditional name="trios">
                    <param name="trios_src" value="trio" />
                    <param name="mother" value="NA00001" />
                    <param name="father" value="NA00002" />
                    <param name="child" value="NA00006" />
                </conditional>
                <param name="mode" value="d" />
            </section>
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <has_text_matching expression="X\t2698769\t.\tAAG\tA\t999\t.\t.\tGT:PL:GP\t./."/>
                </assert_contents>
            </output>
        </test>
        <test>
            <!-- This is just a test on a random file, should have a real test case -->
            <param name="input_file" ftype="vcf" value="convert.vcf" />
            <section name="sec_plugin">
                <conditional name="trios">
                    <param name="trios_src" value="trio" />
                    <param name="mother" value="NA00001" />
                    <param name="father" value="NA00002" />
                    <param name="child" value="NA00006" />
                </conditional>
                <param name="mode" value="e" />
            </section>
            <param name="output_type" value="v" />
            <output name="output_file">
                <assert_contents>
                    <not_has_text text="2698758" />
                    <has_text text="2698769" />
                </assert_contents>
            </output>
        </test>
    </tests>

    <help><![CDATA[
=====================================
 bcftools @EXECUTABLE@ plugin
=====================================


Describing sample relationships (family trios) in PED format
------------------------------------------------------------

A PED file is simply a tabular text file (columns can be separated by either
spaces or TABs, but not a mixture of the two within the same file) with the
header::

#family_id    name     paternal_id    maternal_id    sex

and optional additional columns. The actual column names in the header are not
fixed, but there have to be at least six columns that are interpreted as
detailed next.

Subsequent lines describe one sample from the VCF input dataset each, where

- *family_id* is an alphanumeric identifier of a family

  This column has to be present, but is ignored by this plugin

- *name* is the identifier of the sample described by the line

- *paternal_id* is the identifier of the sample's father

- *maternal_id* is the identifier of the sample's mother

- *sex* is a numeric code (1=male, 2=female) for the sample's sex

An example minimal PED file describing a single family-trio with a female child could look like this::

  #family_id    name    paternal_id    maternal_id    sex
  0             NA00001 0              0              1
  0             NA00002 0              0              2
  0             NA00003 NA00001        NA00002        2

where 0 is used as a placeholder for the paternal_id/maternal_id values in the records of the father and mother.

@REGIONS_HELP@
@TARGETS_HELP@
@EXPRESSIONS_HELP@

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