comparison vsnp_add_zero_coverage.xml @ 0:0ad85e7db2fc draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 6a0c9a857c1f4638ef18e106b1f8c0681303acc5"
author iuc
date Sun, 27 Sep 2020 10:07:44 +0000
parents
children 2e863710a2f0
comparison
equal deleted inserted replaced
-1:000000000000 0:0ad85e7db2fc
1 <tool id="vsnp_add_zero_coverage" name="vSNP: add zero coverage" version="@WRAPPER_VERSION@.0" profile="@PROFILE@">
2 <description></description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <requirements>
7 <requirement type="package" version="1.76">biopython</requirement>
8 <requirement type="package" version="0.25.3">pandas</requirement>
9 <requirement type="package" version="0.15.4">pysam</requirement>
10 </requirements>
11 <command detect_errors="exit_code"><![CDATA[
12 #import os
13 #import re
14 #set input_type = $input_type_cond.input_type
15 #set input_bam_dir = 'input_bam_dir'
16 #set input_vcf_dir = 'input_vcf_dir'
17 #set output_vcf_dir = 'output_vcf_dir'
18 #set output_metrics_dir = 'output_metrics_dir'
19 mkdir -p $input_bam_dir &&
20 mkdir -p $input_vcf_dir &&
21 mkdir -p $output_vcf_dir &&
22 mkdir -p $output_metrics_dir &&
23 #if str($input_type) == "single":
24 #set bam_input = $input_type_cond.bam_input
25 #set file_name = $bam_input.file_name
26 #set file_name_base = $os.path.basename($file_name)
27 ln -s '$file_name' '$input_bam_dir/$file_name_base' &&
28 #set vcf_input = $input_type_cond.vcf_input
29 #set file_name = $vcf_input.file_name
30 #set file_name_base = $os.path.basename($file_name)
31 ln -s '$file_name' '$input_vcf_dir/$file_name_base' &&
32 #else:
33 #for $i in $input_type_cond.bam_input_collection:
34 #set filename = $i.file_name
35 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
36 ln -s '$filename' '$input_bam_dir/$identifier' &&
37 #end for
38 #for $i in $input_type_cond.vcf_input_collection:
39 #set filename = $i.file_name
40 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
41 ln -s '$filename' '$input_vcf_dir/$identifier' &&
42 #end for
43 #end if
44 python '$__tool_directory__/vsnp_add_zero_coverage.py'
45 --processes \${GALAXY_SLOTS:-4}
46 #if str($reference_cond.reference_source) == "cached"
47 --reference '$reference_cond.reference.fields.path'
48 #else:
49 --reference '$reference_cond.reference'
50 #end if
51 #if str($input_type) == "single":
52 --output_metrics '$output_metrics'
53 --output_vcf '$output_vcf'
54 #end if
55 ]]></command>
56 <inputs>
57 <conditional name="input_type_cond">
58 <expand macro="param_input_type"/>
59 <when value="single">
60 <param name="bam_input" type="data" format="bam" label="BAM file">
61 <validator type="unspecified_build"/>
62 </param>
63 <param name="vcf_input" type="data" format="vcf" label="VCF file">
64 <validator type="unspecified_build"/>
65 </param>
66 </when>
67 <when value="collection">
68 <param name="bam_input_collection" type="data_collection" format="bam" collection_type="list" label="Collection of BAM files">
69 <validator type="unspecified_build"/>
70 </param>
71 <param name="vcf_input_collection" type="data_collection" format="vcf" collection_type="list" label="Collection of VCF files">
72 <validator type="unspecified_build"/>
73 </param>
74 </when>
75 </conditional>
76 <conditional name="reference_cond">
77 <expand macro="param_reference_source"/>
78 <when value="cached">
79 <param name="reference" type="select" label="Using reference genome">
80 <options from_data_table="fasta_indexes"/>
81 <!-- No <filter> tag here! -->
82 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected BAM file"/>
83 </param>
84 </when>
85 <when value="history">
86 <param name="reference" type="data" format="fasta" label="Using reference genome">
87 <validator type="no_options" message="The current history does not include a fasta dataset"/>
88 </param>
89 </when>
90 </conditional>
91 </inputs>
92 <outputs>
93 <data name="output_vcf" format="vcf" label="${tool.name} (filtered VCF) on ${on_string}">
94 <filter>input_type_cond['input_type'] == 'single'</filter>
95 </data>
96 <collection name="output_vcf_collection" type="list" label="${tool.name} (filtered VCFs) on ${on_string}">
97 <discover_datasets pattern="__name__" directory="output_vcf_dir" format="vcf" />
98 <filter>input_type_cond['input_type'] == 'collection'</filter>
99 </collection>
100 <data name="output_metrics" format="tabular" label="${tool.name} (metrics) on ${on_string}">
101 <filter>input_type_cond['input_type'] == 'single'</filter>
102 </data>
103 <collection name="output_metrics_collection" type="list" label="${tool.name} (metrics) on ${on_string}">
104 <discover_datasets pattern="__name__" directory="output_metrics_dir" format="tabular" />
105 <filter>input_type_cond['input_type'] == 'collection'</filter>
106 </collection>
107 </outputs>
108 <tests>
109 <test>
110 <param name="input_type" value="collection"/>
111 <param name="bam_input_collection">
112 <collection type="list">
113 <element name="bam_input.bam" value="bam_input.bam" dbkey="89"/>
114 <element name="bam_input2.bam" value="bam_input.bam" dbkey="89"/>
115 </collection>
116 </param>
117 <param name="vcf_input_collection">
118 <collection type="list">
119 <element name="vcf_input.vcf" value="vcf_input.vcf" dbkey="89"/>
120 <element name="vcf_input2.vcf" value="vcf_input.vcf" dbkey="89"/>
121 </collection>
122 </param>
123 <param name="reference_source" value="history"/>
124 <param name="reference" value="NC_002945v4.fasta" ftype="fasta"/>
125 <output_collection name="output_vcf_collection" type="list">
126 <element name="vcf_input.vcf" file="output_vcf.vcf" ftype="vcf" compare="contains"/>
127 <element name="vcf_input2.vcf" file="output_vcf.vcf" ftype="vcf" compare="contains"/>
128 </output_collection>
129 <output_collection name="output_metrics_collection" type="list">
130 <element name="vcf_input.tabular" file="output_metrics.tabular" ftype="tabular" compare="contains"/>
131 <element name="vcf_input2.tabular" file="output_metrics.tabular" ftype="tabular" compare="contains"/>
132 </output_collection>
133 </test>
134 <test>
135 <param name="bam_input" value="bam_input.bam" ftype="bam" dbkey="89"/>
136 <param name="vcf_input" value="vcf_input.vcf" ftype="vcf" dbkey="89"/>
137 <param name="reference_source" value="history"/>
138 <param name="reference" value="NC_002945v4.fasta" ftype="fasta"/>
139 <output name="output_vcf" value="output_vcf.vcf" ftype="vcf" compare="contains"/>
140 <output name="output_metrics" file="output_metrics.tabular" ftype="tabular" compare="contains"/>
141 </test>
142 <test>
143 <param name="bam_input" value="bam_input.bam" ftype="bam" dbkey="89"/>
144 <param name="vcf_input" value="vcf_input.vcf" ftype="vcf" dbkey="89"/>
145 <param name="reference_source" value="cached"/>
146 <output name="output_vcf" value="output_vcf.vcf" ftype="vcf" compare="contains"/>
147 <output name="output_metrics" file="output_metrics.tabular" ftype="tabular" compare="contains"/>
148 </test>
149 </tests>
150 <help>
151 **What it does**
152
153 Accepts a combination of single BAM and associated VCF files (or associated collections of each) to produce a VCF file for each
154 combination whose positions with no coverage are represented as "N". These outputs are restricted to SNPs and those regions
155 along the reference with no coverage.
156
157 A metrics file is produced for each combination which provides the number of good SNPs, the average coverage and the genome
158 coverage percentage.
159
160 **Required Options**
161
162 * **Choose the category of the files to be analyzed** - select "Single files" or "Collections of files", then select the appropriate history items (single BAM and VCF files or collections of BAM and VCF files) based on the selected option.
163 * **Choose the source for the reference genome** - select "locally cached" if the reference associated with the BAM and VCF files is available within the Galaxy environment or "from history" to select the reference from the current history.
164 </help>
165 <expand macro="citations" />
166 </tool>
167