view filter_vcf.xml @ 1:b3fe10e4b93f draft

Deleted selected files
author ulfschaefer
date Fri, 11 Dec 2015 09:40:42 -0500
parents 834a312c0114
children 0ea6829e6998
line wrap: on
line source

<tool id="filter_vcf" name="Filter VCF" version="1.0">
  <description>filters a VCF file</description>
  <requirements>
    <requirement type="package" version="2.7.10">python</requirement>
    <requirement type="package" version="0.6.7">pyvcf</requirement>
    <requirement type="package" version="3.11">pyyaml</requirement>
  </requirements>
  <stdio>
    <!-- Assume anything other than zero is an error -->
    <exit_code range="1:" />
    <exit_code range=":-1" />
  </stdio>
  <command interpreter="bash">
    filter_vcf.sh
	$output
	$input
	#for $sf in $snp_filter:
		#for $name, $param in $sf.snp_filter_type.iteritems():
			#if $name not in [ "__current_case__", "snp_filter_type_selector" ]:
				${name}:"${param}"
			#end if
		#end for
	#end for
  </command>

  <inputs>
    <param name="input" type="data" format="vcf" label="VCF File to filter" />

    <repeat name="snp_filter" title="SNP Filter" help="">
        <conditional name="snp_filter_type">
			<param name="snp_filter_type_selector" type="select" label="SNP Filter Type">
				<option value="gq_score_option">GQ score</option>
				<option value="dp4_ratio_option">DP4 ratio</option>
				<option value="ad_ratio_option">AD ratio</option>
				<option value="mq_score_option">MQ score</option>
				<option value="min_depth_option">Minimum depth</option>
				<option value="uncall_gt_option">Uncall GT</option>
				<option value="mq0_ratio_option">MQ0 ratio</option>
				<option value="qual_score_option">Quality score</option>
				<option value="mq0f_ratio_option">MQ0F ratio</option>
            </param>
			<when value="gq_score_option">
				<param name="gq_score" type="integer" value="0" label="Minimum GC score" help="Type integer"/>
			</when>
			<when value="dp4_ratio_option">
				<param name="dp4_ratio" type="float" value="0.9" label="Minimum DP4 ratio" help="Type float"/>
			</when>
			<when value="ad_ratio_option">
				<param name="ad_ratio" type="float" value="0.9" label="Minimum AD ratio" help="Type float"/>
			</when>
			<when value="mq_score_option">
				<param name="mq_score" type="integer" value="30" label="Minimum MQ score" help="Type integer"/>
			</when>
			<when value="min_depth_option">
				<param name="min_depth" type="integer" value="5" label="Minimum depth" help="Type integer"/>
			</when>
			<when value="uncall_gt_option">
				<param name="uncall_gt" type="text" value="" hidden="True"/>
			</when>
			<when value="mq0_ratio_option">
				<param name="mq0_ratio" type="float" value="0.05" label="Minimim MQ0 ratio" help="Type float"/>
			</when>
			<when value="qual_score_option">
				<param name="qual_score" type="integer" value="30" label="Minimim quality score" help="Type integer"/>
			</when>
			<when value="mq0f_ratio_option">
				<param name="mq0f_ratio" type="float" value="0.05" label="Minimum MQ0F ratio" help="Type float"/>
			</when>
		</conditional>
    </repeat>

  </inputs>

  <outputs>
    <data format="vcf" name="output" label="${tool.name} on ${on_string}: filtered VCF" />
  </outputs>
    <tests>
        <test>
            <param name="input" value="test_input.vcf" ftype="vcf" />
            <param name="min_depth" value="100" />
            <output name="output" file="test_output.vcf" ftype="vcf" />
        </test>
    </tests>
  <help>

usage: filter_vcf.py [-h] \-\-vcf VCF \-\-filters FILTERS \-\-output OUTPUT

optional arguments:

-h, \-\-help            show this help message and exit

\-\-vcf VCF, -v VCF     VCF file to (re)filter.

\-\-filters FILTERS, -f FILTERS	Filter(s) to apply as key:threshold pairs, separated by comma.

\-\-output OUTPUT, -o OUTPUT	Location for filtered VCF to be written.

  </help>
</tool>