view bcftools_plugin_counts.xml @ 15:8d5d8355559b draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit af43d9cf6824f88726900857116f333ff4cdd336"
author iuc
date Sat, 15 Jan 2022 13:24:52 +0000
parents 28b35180900b
children f7879f1e77f9
line wrap: on
line source

<?xml version='1.0' encoding='utf-8'?>
<tool name="bcftools @EXECUTABLE@" id="bcftools_plugin_@PLUGIN_ID@" version="@TOOL_VERSION@+galaxy1">
    <description>plugin  counts number of samples, SNPs, INDELs, MNPs and total sites</description>
    <macros>
        <token name="@EXECUTABLE@">counts</token>
        <token name="@PLUGIN_ID@">counts</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools" />
    <expand macro="requirements">
        <requirement type="package" version="3.7">python</requirement>
    </expand>
    <expand macro="version_command" />
    <command detect_errors="aggressive"><![CDATA[
@PREPARE_ENV@
@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@

## Primary Input/Outputs
@INPUT_FILE@ | tee counts_file.txt  
&& sed 's/^.* \([a-zA-Z]*\):[ ]*\([0-9]*\)$/\1 \2/' counts_file.txt | python $transform > '$output_file'
]]>
    </command>
    <configfiles>
        <configfile name="transform"><![CDATA[
from __future__ import print_function
import sys
header = []
value = []
for line in sys.stdin:
  h,v = line.strip().split()
  header.append(h)
  value.append(v)
print( '#%s' % '\t'.join(header) )
print( '%s' % '\t'.join(value) )
]]>
        </configfile>
    </configfiles>
    <inputs>
        <expand macro="macro_input" />
        <section name="sec_restrict" expanded="false" title="Restrict to">
            <expand macro="macro_restrict" />
            <expand macro="macro_restrict" type="target" label_type="Target" />
            <expand macro="macro_include" />
            <expand macro="macro_exclude" />
        </section>
    </inputs>
    <outputs>
        <data name="output_file" format="tabular"/>
    </outputs>
    <tests>
        <test>
            <param name="input_file" ftype="vcf" value="view.vcf" />
            <output name="output_file">
                <assert_contents>
                    <has_text text="SNPs"/>
                    <has_text text="11"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
=====================================
 bcftools @EXECUTABLE@ plugin
=====================================

Counts number of samples, SNPs, INDELs, MNPs and total number of sites.

@REGIONS_HELP@
@TARGETS_HELP@
@EXPRESSIONS_HELP@



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