Source code

Download source archive ↓

upstream-extended/iuc/tools/bcftools/bcftools_plugin_counts.xml

1<tool name="bcftools @EXECUTABLE@" id="bcftools_plugin_@PLUGIN_ID@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2    <description>plugin  counts number of samples, SNPs, INDELs, MNPs and total sites</description>
3    <macros>
4        <token name="@EXECUTABLE@">counts</token>
5        <token name="@PLUGIN_ID@">counts</token>
6        <import>macros.xml</import>
7    </macros>
8    <expand macro="bio_tools" />
9    <expand macro="requirements">
10        <requirement type="package" version="3.7">python</requirement>
11    </expand>
12    <expand macro="version_command" />
13    <command detect_errors="aggressive"><![CDATA[
14@PREPARE_INPUT_FILE@
15#set $section = $sec_restrict
16@PREPARE_TARGETS_FILE@
17@PREPARE_REGIONS_FILE@
18
19bcftools plugin @EXECUTABLE@
20
21## VCF input section
22#set $section = $sec_restrict
23@INCLUDE@
24@EXCLUDE@
25@REGIONS@
26@TARGETS@
27
28## Primary Input/Outputs
29@INPUT_FILE@ | tee counts_file.txt  
30&& sed 's/^.* \([a-zA-Z]*\):[ ]*\([0-9]*\)$/\1 \2/' counts_file.txt | python $transform > '$output_file'
31]]>
32    </command>
33    <configfiles>
34        <configfile name="transform"><![CDATA[
35from __future__ import print_function
36import sys
37header = []
38value = []
39for line in sys.stdin:
40  h,v = line.strip().split()
41  header.append(h)
42  value.append(v)
43print( '#%s' % '\t'.join(header) )
44print( '%s' % '\t'.join(value) )
45]]>
46        </configfile>
47    </configfiles>
48    <inputs>
49        <expand macro="macro_input" />
50        <section name="sec_restrict" expanded="false" title="Restrict to">
51            <expand macro="macro_region_restrict" />
52            <expand macro="macro_target_restrict" />
53            <expand macro="macro_include" />
54            <expand macro="macro_exclude" />
55        </section>
56    </inputs>
57    <outputs>
58        <data name="output_file" format="tabular"/>
59    </outputs>
60    <tests>
61        <test>
62            <param name="input_file" ftype="vcf" value="view.vcf" />
63            <output name="output_file">
64                <assert_contents>
65                    <has_text text="SNPs"/>
66                    <has_text text="11"/>
67                </assert_contents>
68            </output>
69        </test>
70    </tests>
71    <help><![CDATA[
72=====================================
73 bcftools @EXECUTABLE@ plugin
74=====================================
75
76Counts number of samples, SNPs, INDELs, MNPs and total number of sites.
77
78@REGIONS_HELP@
79@TARGETS_HELP@
80@EXPRESSIONS_HELP@
81
82
83
84    ]]></help>
85    <expand macro="citations" />
86</tool>