comparison vsnp_add_zero_coverage.xml @ 3:2e863710a2f0 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 2e312886647244b416c64eca91e1a61dd1be939b"
author iuc
date Thu, 10 Dec 2020 15:26:25 +0000
parents 0ad85e7db2fc
children e12ccc57875c
comparison
equal deleted inserted replaced
2:4cc004985e27 3:2e863710a2f0
1 <tool id="vsnp_add_zero_coverage" name="vSNP: add zero coverage" version="@WRAPPER_VERSION@.0" profile="@PROFILE@"> 1 <tool id="vsnp_add_zero_coverage" name="vSNP: add zero coverage" version="@WRAPPER_VERSION@.1" profile="@PROFILE@">
2 <description></description> 2 <description></description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <requirements> 6 <requirements>
7 <requirement type="package" version="1.76">biopython</requirement> 7 <requirement type="package" version="1.76">biopython</requirement>
8 <requirement type="package" version="0.25.3">pandas</requirement> 8 <requirement type="package" version="0.25.3">pandas</requirement>
9 <requirement type="package" version="0.15.4">pysam</requirement> 9 <requirement type="package" version="0.15.4">pysam</requirement>
10 </requirements> 10 </requirements>
11 <command detect_errors="exit_code"><![CDATA[ 11 <command detect_errors="exit_code"><![CDATA[
12 #import os
13 #import re 12 #import re
14 #set input_type = $input_type_cond.input_type 13
15 #set input_bam_dir = 'input_bam_dir' 14 ## The identifer for both of the following files is likely the same
16 #set input_vcf_dir = 'input_vcf_dir' 15 ## string, so we append a file extension to allow for both links.
17 #set output_vcf_dir = 'output_vcf_dir' 16 #set bam_identifier = re.sub('[^\s\w\-]', '_', str($bam_input.element_identifier)) + '.bam'
18 #set output_metrics_dir = 'output_metrics_dir' 17 ln -s '${bam_input}' '${bam_identifier}' &&
19 mkdir -p $input_bam_dir && 18 #set vcf_identifier = re.sub('[^\s\w\-]', '_', str($vcf_input.element_identifier)) + '.vcf'
20 mkdir -p $input_vcf_dir && 19 ln -s '${vcf_input}' '${vcf_identifier}' &&
21 mkdir -p $output_vcf_dir && 20
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' 21 python '$__tool_directory__/vsnp_add_zero_coverage.py'
45 --processes \${GALAXY_SLOTS:-4} 22 --bam_input '$bam_identifier'
46 #if str($reference_cond.reference_source) == "cached" 23 --vcf_input '$vcf_identifier'
24 #if str($reference_cond.reference_source) == 'cached'
47 --reference '$reference_cond.reference.fields.path' 25 --reference '$reference_cond.reference.fields.path'
48 #else: 26 #else:
49 --reference '$reference_cond.reference' 27 --reference '$reference_cond.reference'
50 #end if 28 #end if
51 #if str($input_type) == "single": 29 --output_metrics '$output_metrics'
52 --output_metrics '$output_metrics' 30 --output_vcf '$output_vcf'
53 --output_vcf '$output_vcf'
54 #end if
55 ]]></command> 31 ]]></command>
56 <inputs> 32 <inputs>
57 <conditional name="input_type_cond"> 33 <param name="bam_input" type="data" format="bam" label="BAM file"/>
58 <expand macro="param_input_type"/> 34 <param name="vcf_input" type="data" format="vcf" label="VCF file"/>
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"> 35 <conditional name="reference_cond">
77 <expand macro="param_reference_source"/> 36 <expand macro="param_reference_source"/>
78 <when value="cached"> 37 <when value="cached">
79 <param name="reference" type="select" label="Using reference genome"> 38 <param name="reference" type="select" label="Using reference genome">
80 <options from_data_table="fasta_indexes"/> 39 <options from_data_table="fasta_indexes">
81 <!-- No <filter> tag here! --> 40 <filter type="data_meta" column="dbkey" key="dbkey" ref="bam_input"/>
82 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected BAM file"/> 41 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected BAM file"/>
42 </options>
83 </param> 43 </param>
84 </when> 44 </when>
85 <when value="history"> 45 <when value="history">
86 <param name="reference" type="data" format="fasta" label="Using reference genome"> 46 <param name="reference" type="data" format="fasta,fasta.gz" label="Using reference genome">
87 <validator type="no_options" message="The current history does not include a fasta dataset"/> 47 <validator type="no_options" message="The current history does not include a fasta dataset"/>
88 </param> 48 </param>
89 </when> 49 </when>
90 </conditional> 50 </conditional>
91 </inputs> 51 </inputs>
92 <outputs> 52 <outputs>
93 <data name="output_vcf" format="vcf" label="${tool.name} (filtered VCF) on ${on_string}"> 53 <data name="output_vcf" format="vcf" label="${tool.name} on ${on_string} (filtered VCF)"/>
94 <filter>input_type_cond['input_type'] == 'single'</filter> 54 <data name="output_metrics" format="tabular" label="${tool.name} on ${on_string} (metrics)"/>
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> 55 </outputs>
108 <tests> 56 <tests>
109 <test> 57 <test expect_num_outputs="2">
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"/> 58 <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"/> 59 <param name="vcf_input" value="vcf_input.vcf" ftype="vcf" dbkey="89"/>
137 <param name="reference_source" value="history"/> 60 <param name="reference_source" value="history"/>
138 <param name="reference" value="NC_002945v4.fasta" ftype="fasta"/> 61 <param name="reference" value="NC_002945v4.fasta" ftype="fasta"/>
139 <output name="output_vcf" value="output_vcf.vcf" ftype="vcf" compare="contains"/> 62 <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"/> 63 <output name="output_metrics" file="output_metrics.tabular" ftype="tabular"/>
141 </test> 64 </test>
142 <test> 65 <test expect_num_outputs="2">
143 <param name="bam_input" value="bam_input.bam" ftype="bam" dbkey="89"/> 66 <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"/> 67 <param name="vcf_input" value="vcf_input.vcf" ftype="vcf" dbkey="89"/>
145 <param name="reference_source" value="cached"/> 68 <param name="reference_source" value="cached"/>
146 <output name="output_vcf" value="output_vcf.vcf" ftype="vcf" compare="contains"/> 69 <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"/> 70 <output name="output_metrics" file="output_metrics.tabular" ftype="tabular" compare="contains"/>
157 A metrics file is produced for each combination which provides the number of good SNPs, the average coverage and the genome 80 A metrics file is produced for each combination which provides the number of good SNPs, the average coverage and the genome
158 coverage percentage. 81 coverage percentage.
159 82
160 **Required Options** 83 **Required Options**
161 84
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. 85 * **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> 86 </help>
165 <expand macro="citations" /> 87 <expand macro="citations" />
166 </tool> 88 </tool>
167 89