Mercurial > repos > devteam > vcftools_slice
diff vcftools_slice.xml @ 0:fb25b685d590 draft
Initial wrapper upload.
author | devteam |
---|---|
date | Sat, 23 Nov 2013 16:12:29 -0500 |
parents | |
children | e88ac3aabdc4 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vcftools_slice.xml Sat Nov 23 16:12:29 2013 -0500 @@ -0,0 +1,49 @@ +<tool id="vcftools_slice" name="Slice VCF" version="0.1"> + <description>to get data from selected regions</description> + + <requirements> + <requirement type="package">vcftools</requirement> + </requirements> + + <command> + ## Only works if input is sorted. + vcf-sort ${input} > sorted.vcf + + ## As of v0.1.10, the first line of a BED file is assumed to be a header and ignored, + ## so add a dummy header line if necessary. + #set first_line = open( str($regions) ).readline() + #if first_line.startswith( '#' ): + ## Header already exists, so just link. + ; ln -s $regions regions.bed + #else: + ## Add dummy header. + ; echo '#dummy header' | cat - $regions > regions.bed + #end if + + ## Slice VCF. + ; vcftools --vcf sorted.vcf --out output --bed regions.bed --recode + </command> + + <inputs> + <param name="input" label="Input dataset" type="data" format="vcf"/> + <param name="regions" label="Regions" type="data" format="bed"/> + </inputs> + + <outputs> + <data name="output" format="vcf" from_work_dir="output.recode.vcf"/> + </outputs> + + <tests> + <test> + <param name="input" value="slice_in.vcf"/> + <param name="regions" value="regions.bed"/> + <output name="output" file="slice_out.vcf"/> + </test> + </tests> + + <help> + Please see the VCFtools `documentation`__ for help and further information. + + .. __: http://vcftools.sourceforge.net/docs.html + </help> +</tool>