annotate vsnp_determine_ref_from_data.xml @ 2:ee6166a3edd8 draft

Uploaded
author greg
date Thu, 19 Nov 2020 21:50:54 +0000
parents bca267738b33
children 6116deacb2c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
1 <tool id="vsnp_determine_ref_from_data" name="vSNP: determine reference" version="1.0.0">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
2 <description>from input data</description>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
3 <requirements>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
4 <requirement type="package" version="1.76">biopython</requirement>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
5 <requirement type="package" version="5.3">pyyaml</requirement>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
6 </requirements>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
7 <command detect_errors="exit_code"><![CDATA[
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
8 #import os
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
9 #import re
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
10 #set gzipped = 'false'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
11 #set input_type = $input_type_cond.input_type
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
12 #set input_reads_dir = 'input_reads'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
13 #set output_dbkey_dir = 'output_dbkey'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
14 #set output_metrics_dir = 'output_metrics'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
15 mkdir -p $input_reads_dir &&
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
16 mkdir -p $output_dbkey_dir &&
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
17 mkdir -p $output_metrics_dir &&
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
18 #if str($input_type) == "single":
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
19 #set read_type_cond = $input_type_cond.read_type_cond
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
20 #set read1 = $read_type_cond.read1
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
21 #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
22 #if str($read_type_cond.read_type) == "single":
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
23 ln -s '${read1}' '${read1_identifier}' &&
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
24 #if $read1.is_of_type('fastqsanger.gz'):
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
25 #set gzipped = 'true'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
26 #end if
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
27 #else:
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
28 #set read2 = $read_type_cond.read2
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
29 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
30 ln -s '${read1}' '${read1_identifier}' &&
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
31 ln -s '${read2}' '${read2_identifier}' &&
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
32 #if $read1.is_of_type('fastqsanger.gz') and $read2.is_of_type('fastqsanger.gz'):
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
33 #set gzipped = 'true'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
34 #end if
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
35 #end if
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
36 #else:
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
37 #for $i in $input_type_cond.collection_type_cond.reads_collection:
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
38 #if $i.is_of_type('fastqsanger.gz'):
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
39 #set gzipped = 'true'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
40 #end if
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
41 #set filename = $i.file_name
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
42 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
43 ln -s '$filename' '$input_reads_dir/$identifier' &&
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
44 #end for
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
45 #end if
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
46 python '$__tool_directory__/vsnp_determine_ref_from_data.py'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
47 #if str($input_type) == "single":
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
48 #if str($read_type_cond.read_type) == "single":
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
49 --read1 '${read1_identifier}'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
50 #else:
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
51 --read1 '${read1_identifier}'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
52 --read2 '${read2_identifier}'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
53 #end if
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
54 --output_dbkey '$output_dbkey'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
55 --output_metrics '$output_metrics'
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
56 #end if
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
57 --gzipped $gzipped
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
58 --processes $processes
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
59 #if str($in_test_mode) == "false":
bca267738b33 Uploaded
greg
parents: 0
diff changeset
60 #set $dnaprint_fields = $__app__.tool_data_tables['vsnp_dnaprints'].get_fields()
bca267738b33 Uploaded
greg
parents: 0
diff changeset
61 #for $i in $dnaprint_fields:
bca267738b33 Uploaded
greg
parents: 0
diff changeset
62 --dnaprint_fields '${i[0]}' '${i[2]}'
bca267738b33 Uploaded
greg
parents: 0
diff changeset
63 #end for
bca267738b33 Uploaded
greg
parents: 0
diff changeset
64 #else:
bca267738b33 Uploaded
greg
parents: 0
diff changeset
65 --in_test_mode '$in_test_mode'
bca267738b33 Uploaded
greg
parents: 0
diff changeset
66 #end if
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
67 ]]></command>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
68 <inputs>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
69 <conditional name="input_type_cond">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
70 <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
71 <option value="single" selected="true">Single files</option>
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
72 <option value="collection">Collection of files</option>
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
73 </param>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
74 <when value="single">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
75 <conditional name="read_type_cond">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
76 <param name="read_type" type="select" label="Choose the read type">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
77 <option value="paired" selected="true">Paired</option>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
78 <option value="single">Single</option>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
79 </param>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
80 <when value="paired">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
81 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
82 <param name="read2" type="data" format="fastqsanger.gz,fastqsanger" label="Read2 fastq file"/>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
83 </when>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
84 <when value="single">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
85 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
86 </when>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
87 </conditional>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
88 </when>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
89 <when value="collection">
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
90 <conditional name="collection_type_cond">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
91 <param name="collection_type" type="select" label="Collection of single reads or paired reads?">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
92 <option value="single_reads" selected="true">Single reads</option>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
93 <option value="paired_reads">Paired reads</option>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
94 </param>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
95 <when value="single_reads">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
96 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="list" label="Collection of fastqsanger files"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
97 </when>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
98 <when value="paired_reads">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
99 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="paired" label="Collection of fastqsanger paired read files"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
100 </when>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
101 </conditional>
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
102 </when>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
103 </conditional>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
104 <param name="processes" type="integer" min="1" max="20" value="8" label="Number of processes for job splitting"/>
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
105 <!-- Functional testing -->
bca267738b33 Uploaded
greg
parents: 0
diff changeset
106 <param name="in_test_mode" type="hidden" value="false"/>
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
107 </inputs>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
108 <outputs>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
109 <data name="output_dbkey" format="txt" label="${tool.name} (dbkey) on ${on_string}">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
110 <filter>input_type_cond['input_type'] == 'single'</filter>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
111 </data>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
112 <data name="output_metrics" format="txt" label="${tool.name} (metrics) on ${on_string}">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
113 <filter>input_type_cond['input_type'] == 'single'</filter>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
114 </data>
2
ee6166a3edd8 Uploaded
greg
parents: 1
diff changeset
115 <collection name="output_dbkey_collection" type="list" label="${tool.name} (dbkey) on ${on_string}">
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
116 <discover_datasets pattern="__name__" directory="output_dbkey" format="txt"/>
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
117 <filter>input_type_cond['input_type'] == 'collection'</filter>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
118 </collection>
2
ee6166a3edd8 Uploaded
greg
parents: 1
diff changeset
119 <collection name="output_metrics_collection" type="list" label="${tool.name} (metrics) on ${on_string}">
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
120 <discover_datasets pattern="__name__" directory="output_metrics" format="txt"/>
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
121 <filter>input_type_cond['input_type'] == 'collection'</filter>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
122 </collection>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
123 </outputs>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
124 <tests>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
125 <test>
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
126 <param name="in_test_mode" value="true"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
127 <param name="read_type" value="single"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
128 <param name="read1" value="Mcap_Deer_DE_SRR650221.fastq.gz" ftype="fastqsanger.gz"/>
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
129 <output name="output_dbkey" file="output_dbkey.txt" ftype="txt"/>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
130 <output name="output_metrics" file="output_metrics.txt" ftype="txt"/>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
131 </test>
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
132 <test>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
133 <param name="in_test_mode" value="true"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
134 <param name="input_type" value="collection"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
135 <param name="collection_type" value="paired_reads"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
136 <param name="reads_collection">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
137 <collection type="paired">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
138 <element name="forward" value="forward.fastq.gz" ftype="fastqsanger.gz"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
139 <element name="reverse" value="reverse.fastq.gz" ftype="fastqsanger.gz"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
140 </collection>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
141 </param>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
142 <output_collection name="output_dbkey_collection" type="list">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
143 <element name="forward.txt" file="forward_dbkey.txt" ftype="txt"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
144 <element name="reverse.txt" file="reverse_dbkey.txt" ftype="txt"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
145 </output_collection>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
146 <output_collection name="output_metrics_collection" type="list">
bca267738b33 Uploaded
greg
parents: 0
diff changeset
147 <element name="forward.txt" file="forward_metrics.txt" ftype="txt"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
148 <element name="reverse.txt" file="reverse_metrics.txt" ftype="txt"/>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
149 </output_collection>
bca267738b33 Uploaded
greg
parents: 0
diff changeset
150 </test>
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
151 </tests>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
152 <help>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
153 **What it does**
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
154
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
155 Accepts a single fastqsanger read, a set of paired reads, or a collection of reads and inspects the data to discover the
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
156 best reference genome for aligning the reads. This tool is, in essence, a DNA sniffer, and is the first Galaxy tool to
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
157 perform this task. While inspecting the data, a string of 0's and 1's is compiled based on the data contents, and we call
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
158 the complete string a "DNA print". All of the "DNA prints" files installed by the complementary **vSNP DNAprints data
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
159 manager** tool are then inspected to find a match for the compiled "DNA print" string. These files are each associated
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
160 with a Galaxy "dbkey" (i.e., genome build), so when a metach is found, the associated "dbkey" is passed to a mapper (e.g.,
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
161 **Map with BWA-MEM**) to align the reads to the associated reference.
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
162
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
163 The tool produces 2 text files, a "dbkey" file that contains the dbkey string and a "metrics" file that provides information
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
164 used to compile the "DNA print" string.
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
165
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
166 This tool is important for samples containing bacterial species because many of the samples have a "mixed bag" of species,
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
167 and discovering the primary species is critical. DNA print matchig is currently supported for the following genomes.
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
168
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
169 * Mycobacterium bovis AF2122/97
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
170 * Brucella abortus bv. 1 str. 9-941
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
171 * Brucella abortus strain BER
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
172 * Brucella canis ATCC 23365
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
173 * Brucella ceti TE10759-12
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
174 * Brucella melitensis bv. 1 str. 16M
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
175 * Brucella melitensis bv. 3 str. Ether
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
176 * Brucella melitensis BwIM_SOM_36b
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
177 * Brucella melitensis ATCC 23457
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
178 * Brucella ovis ATCC 25840
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
179 * Brucella suis 1330
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
180 * Mycobacterium tuberculosis H37Rv
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
181 * Mycobacterium avium subsp. paratuberculosis strain Telford
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
182 * Mycobacterium avium subsp. paratuberculosis K-10
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
183 * Brucella suis ATCC 23445
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
184 * Brucella suis bv. 3 str. 686
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
185
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
186 **Required Options**
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
187
1
bca267738b33 Uploaded
greg
parents: 0
diff changeset
188 * **Choose the category of the files to be analyzed** - select "Single files" or "Collection of files", then select the appropriate history items (single or paired fastqsanger reads or a collection of fastqsanger reads) based on the selected option.
0
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
189 * **Number of processes for job splitting** - Select the number of processes for splitting the job to shorten execution time.
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
190 </help>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
191 <citations>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
192 <citation type="bibtex">
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
193 @misc{None,
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
194 journal = {None},
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
195 author = {1. Stuber T},
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
196 title = {Manuscript in preparation},
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
197 year = {None},
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
198 url = {https://github.com/USDA-VS/vSNP},}
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
199 </citation>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
200 </citations>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
201 </tool>
ebc08e5ce646 Uploaded
greg
parents:
diff changeset
202