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