23
|
1 <tool id="read_alignment" name="SNAP Read Alignment" version="0.1.7.3">
|
0
|
2 <description>Map sequence reads to a reference genome using SNAP</description>
|
2
|
3 <macros>
|
|
4 <import>toolshed_macros.xml</import>
|
|
5 </macros>
|
23
|
6 <expand macro="requirements" />
|
21
|
7 <version_command>python3 -m MiModD version -q</version_command>
|
0
|
8 <command>
|
21
|
9 python3 -m MiModD snap-batch -s
|
0
|
10 ## SNAP calls (considering different cases)
|
|
11
|
|
12 #for $i in $datasets
|
|
13 "snap ${i.mode_choose.mode} '$ref_genome'
|
|
14 #if $str($i.mode_choose.mode) == "paired" and $str($i.mode_choose.input.iformat) in ("fastq", "gz"):
|
|
15 '${i.mode_choose.input.ifile1}' '${i.mode_choose.input.ifile2}'
|
|
16 #else:
|
|
17 '${i.mode_choose.input.ifile}'
|
|
18 #end if
|
|
19 --ofile '$outputfile' --iformat ${i.mode_choose.input.iformat} --oformat $oformat
|
|
20 --idx-seedsize '$set.seedsize'
|
6
|
21 --idx-slack '$set.slack' --maxseeds '$set.maxseeds' --maxhits '$set.maxhits' --clipping $set.clipping --maxdist '$set.maxdist' --confdiff '$set.confdiff' --confadapt '$set.confadpt'
|
0
|
22 #if $i.mode_choose.input.header:
|
|
23 --header '${i.mode_choose.input.header}'
|
|
24 #end if
|
|
25 #if $str($i.mode_choose.mode) == "paired":
|
|
26 --spacing '$set.sp_min' '$set.sp_max'
|
|
27 #end if
|
|
28 #if $str($set.selectivity) != "off":
|
|
29 --selectivity '$set.selectivity'
|
|
30 #end if
|
|
31 #if $str($set.filter_output) != "off":
|
|
32 --filter-output $set.filter_output
|
|
33 #end if
|
4
|
34 #if $str($set.sort) == "off":
|
|
35 --no-sort
|
|
36 #end if
|
|
37 #if $str($set.mmatch_notation) != "general":
|
|
38 -X
|
0
|
39 #end if
|
4
|
40 #if $set.discard_overlapping_mates:
|
|
41 --discard-overlapping-mates
|
|
42 ## remove ',' (and possibly adjacent whitespace) and replace with ' '
|
|
43 '#echo ("' '".join($set.discard_overlapping_mates.replace(" ", "").split(',')))#'
|
|
44 #end if
|
0
|
45 --verbose
|
|
46 "
|
|
47 #end for
|
|
48 </command>
|
|
49
|
|
50 <inputs>
|
|
51 ## mandatory arguments (and mode-conditionals)
|
|
52
|
23
|
53 <param format="fasta" help="The fasta reference genome that SNAP should align reads against." label="reference genome" name="ref_genome" type="data" />
|
0
|
54
|
23
|
55 <repeat default="1" min="1" name="datasets" title="datasets">
|
0
|
56 <conditional name="mode_choose">
|
23
|
57 <param help="Reads obtained from single-end sequencing runs should be aligned in 'single' mode, paired-end reads in 'paired' mode. **WARNING**: if the read input file is in SAM/BAM format, the current version of this tool will **not** verify the mode and may produce erroneous alignments with wrong settings!" label="choose mode" name="mode" type="select">
|
0
|
58 <option value="single">single-end</option>
|
|
59 <option value="paired">paired-end</option>
|
|
60 </param>
|
|
61
|
|
62 <when value="single">
|
|
63 <conditional name="input">
|
23
|
64 <param label="input file format" name="iformat" type="select">
|
0
|
65 <option value="bam">BAM</option>
|
|
66 <option value="sam">SAM</option>
|
|
67 <option value="gz">gz</option>
|
|
68 <option value="fastq">fastq</option>
|
|
69 </param>
|
|
70 <when value="bam">
|
23
|
71 <param format="bam" label="input file" name="ifile" type="data" />
|
|
72 <param format="sam" label="custom header file" name="header" optional="true" type="data" />
|
0
|
73 </when>
|
|
74 <when value="sam">
|
23
|
75 <param format="sam" label="input file" name="ifile" type="data" />
|
|
76 <param format="sam" label="custom header file" name="header" optional="true" type="data" />
|
0
|
77 </when>
|
|
78 <when value="gz">
|
23
|
79 <param label="input file" name="ifile" type="data" />
|
|
80 <param format="sam" label="header file" name="header" type="data" />
|
0
|
81 </when>
|
|
82 <when value="fastq">
|
23
|
83 <param format="fastq" label="input file" name="ifile" type="data" />
|
|
84 <param format="sam" label="header file" name="header" type="data" />
|
0
|
85 </when>
|
|
86 </conditional>
|
|
87 </when>
|
|
88 <when value="paired">
|
|
89 <conditional name="input">
|
23
|
90 <param label="input file format" name="iformat" type="select">
|
0
|
91 <option value="bam">BAM</option>
|
|
92 <option value="sam">SAM</option>
|
|
93 <option value="gz">gz</option>
|
|
94 <option value="fastq">fastq</option>
|
|
95 </param>
|
|
96 <when value="bam">
|
23
|
97 <param format="bam" label="input file" name="ifile" type="data" />
|
|
98 <param format="sam" label="custom header file" name="header" optional="true" type="data" />
|
0
|
99 </when>
|
|
100 <when value="sam">
|
23
|
101 <param format="sam" label="input file" name="ifile" type="data" />
|
|
102 <param format="sam" label="custom header file" name="header" optional="true" type="data" />
|
0
|
103 </when>
|
|
104 <when value="fastq">
|
23
|
105 <param format="fastq" label="inputfile with the first set of reads of paired-end data" name="ifile1" type="data" />
|
|
106 <param format="fastq" label="inputfile with the second set of reads of paired-end data" name="ifile2" type="data" />
|
|
107 <param format="sam" help="required" label="header file" name="header" type="data" />
|
0
|
108 </when>
|
|
109 <when value="gz">
|
23
|
110 <param label="inputfile with the first set of reads of paired-end data" name="ifile1" type="data" />
|
|
111 <param label="inputfile with the second set of reads of paired-end data" name="ifile2" type="data" />
|
|
112 <param format="sam" help="required" label="header file" name="header" type="data" />
|
0
|
113 </when>
|
|
114 </conditional>
|
|
115 </when>
|
|
116 </conditional>
|
|
117 </repeat>
|
|
118
|
23
|
119 <param label="output file format" name="oformat" type="select">
|
0
|
120 <option value="bam">BAM</option>
|
|
121 <option value="sam">SAM</option>
|
|
122 </param>
|
|
123
|
|
124 ## optional arguments
|
|
125
|
|
126 <conditional name="set">
|
23
|
127 <param help="This section lets you specify the detailed parameter settings for the SNAP aligner. Only change them if you know what you are doing, i.e., read the documentation first." label="further parameter settings" name="settings_mode" type="select">
|
0
|
128 <option value="default">default settings</option>
|
|
129 <option value="change">change settings</option>
|
|
130 </param>
|
|
131
|
|
132 ## default settings
|
|
133
|
|
134 <when value="default">
|
23
|
135 <param name="seedsize" type="hidden" value="20" />
|
|
136 <param name="slack" type="hidden" value="0.3" />
|
|
137 <param name="sp_min" type="hidden" value="100" />
|
|
138 <param name="sp_max" type="hidden" value="10000" />
|
|
139 <param name="maxdist" type="hidden" value="8" />
|
|
140 <param name="confdiff" type="hidden" value="2" />
|
|
141 <param name="confadpt" type="hidden" value="7" />
|
0
|
142
|
23
|
143 <param name="maxseeds" type="hidden" value="25" />
|
|
144 <param name="maxhits" type="hidden" value="250" />
|
|
145 <param name="clipping" type="hidden" value="++" />
|
0
|
146
|
23
|
147 <param name="selectivity" type="hidden" value="off" />
|
|
148 <param name="filter_output" type="hidden" value="off" />
|
|
149 <param name="sort" type="hidden" value="0" />
|
|
150 <param name="mmatch_notation" type="hidden" value="general" />
|
4
|
151 <param name="discard_overlapping_mates" type="hidden" value="" />
|
0
|
152 </when>
|
|
153
|
|
154 ## change settings
|
|
155
|
|
156 <when value="change">
|
23
|
157 <param help="Length of the seeds used in the reference genome hash table (SNAP index option -s)." label="seed size (default: 20)" name="seedsize" type="integer" value="20" />
|
|
158 <param help="Corresponds to the -h option of SNAP index." label="hash table slack size (default: 0.3)" name="slack" type="float" value="0.3" />
|
0
|
159
|
|
160 ## paired-end specific options
|
23
|
161 <param help="Corresponds to the first value of the SNAP option -s. Affects paired-end data only." label="minimum spacing to allow between paired ends (default: 100)" name="sp_min" type="integer" value="100" />
|
|
162 <param help="Corresponds to the second value of the SNAP option -s. Affects paired-end data only." label="maximum spacing to allow between paired ends (default: 10000)" name="sp_max" type="integer" value="10000" />
|
|
163 <param display="checkboxes" help="Consider overlapping mate pairs of the given orientation type(s) anomalous and discard them; allowed values: RF, FR, FF, RR; multiple types may be specified as a comma-separated list and ALL can be used as a shortcut for discarding all overlapping mate pairs; leave blank to retain all overlapping pairs. Affects paired-end data only." label="discard overlapping read pairs of type" multiple="true" name="discard_overlapping_mates" type="text" />
|
|
164 <param help="maximum edit distance allowed per read or pair (SNAP option -d); higher values allow more divergent alignments to be found, but increase the rate of misalignments." label="edit distance (default: 8)" name="maxdist" type="integer" value="8" />
|
|
165 <param help="Maximum hits to consider per seed (SNAP option -h); don't use a seed region in the alignment process if it matches more than maxhits regions in the reference genome. Higher values reduce the rate of misalignments, but reduce performance." label="maximum hits per seed (default: 250)" name="maxhits" type="integer" value="250" />
|
|
166 <param help="Confidence threshold (SNAP option -c); the minimum edit distance difference between two alternate alignments required to reject the poorer alignment as suboptimal; higher values increase the rate of ambiguously aligned reads." label="confidence threshold (default: 2)" name="confdiff" type="integer" value="2" />
|
|
167 <param help="Specifies how many seeds of a read may be ignored (based on the maximum hits value above) before the confidence threshold above gets increased by one for that read; helps fine-tuning alignment accuracy in repetitive regions of the genome." label="adaptive confdiff behaviour (default: 7)" name="confadpt" type="integer" value="7" />
|
|
168 <param help="Number of seeds to use per read (SNAP option -n) when trying to match it to the reference genome; higher numbers will increase the rate of aligned reads and reduce the rate of misalignments, but will reduce performance." label="maximum seeds per read (default: 25)" name="maxseeds" type="integer" value="25" />
|
|
169 <param help="Specifies from which end of a read low-quality bases should be clipped (SNAP option -Cxx)" label="read clipping (default: from back and front)" name="clipping" type="select">
|
0
|
170 <option value="++">from back and front</option>
|
6
|
171 <option value="x+">from back only</option>
|
|
172 <option value="+x">from front only</option>
|
|
173 <option value="xx">no clipping</option>
|
0
|
174 </param>
|
23
|
175 <param help="randomly choose 1/selectivity of the reads to score (SNAP option -S). The tool uses the default of 1 (or a 0 setting) to indicate that all reads should be worked with." label="selectivity (default: 1)" name="selectivity" type="integer" value="1" />
|
|
176 <param help="filter output (SNAP option -F for certain classes of reads." label="filter output (default: no filtering)" name="filter_output" type="select">
|
0
|
177 <option value="off">no filtering</option>
|
|
178 <option value="a">aligned only</option>
|
|
179 <option value="s">single-aligned only</option>
|
|
180 <option value="u">unaligned only</option>
|
|
181 </param>
|
23
|
182 <param help="Sort the output file by alignment location (SNAP option --so)." label="output sorting (default: sort by read coordinates)" name="sort" type="select">
|
0
|
183 <option value="0">sort by read coordinates</option>
|
|
184 <option value="off">no sorting</option>
|
|
185 </param>
|
23
|
186 <param help="Indicates whether CIGAR strings in the generated SAM/BAM file should use M (alignment match) rather than = and X (sequence (mis-)match). Warning: Downstream variant calling based on samtools currently relies on the old-style M notation!!" label="CIGAR symbols for alignment matches/mismatches (default: M notation)" name="mmatch_notation" type="select">
|
0
|
187 <option value="general">use M for both matches and mismatches</option>
|
|
188 <option value="differentiate">use = for matches, X for mismatches</option>
|
|
189 </param>
|
|
190 </when>
|
|
191 </conditional>
|
|
192 </inputs>
|
|
193
|
|
194 <outputs>
|
23
|
195 <data format="bam" label="Aligned reads from MiModd ${tool.name} on ${on_string}" name="outputfile">
|
0
|
196 <change_format>
|
23
|
197 <when format="sam" input="oformat" value="sam" />
|
0
|
198 </change_format>
|
|
199 </data>
|
|
200 </outputs>
|
|
201
|
|
202 <help>
|
|
203 .. class:: infomark
|
|
204
|
|
205 **What it does**
|
|
206
|
|
207 The tool aligns the sequenced reads in an arbitrary number of input datasets against a common reference genome and stores the results in a single, possibly multi-sample output file. It supports a variety of different sequenced reads input formats, i.e., SAM, BAM, fastq and gzipped fastq, and both single-end and paired-end data.
|
|
208
|
|
209 Internally, the tool uses the ultrafast, hashtable-based aligner SNAP (http://snap.cs.berkeley.edu), hence its name.
|
|
210
|
|
211 **Notes:**
|
|
212
|
|
213 1) In its standard configuration Galaxy will decompress any .gz files during their upload, so the option to align gzipped fastq input is useful only with customized Galaxy instances or by using linked files as explained in our `recipe for using gzipped fastq files in Galaxy`_ from the `MiModD user guide`_.
|
|
214
|
|
215 2) To use paired-end fastq data with the tool the read mate information needs to be split over two fastq files in corresponding order.
|
|
216
|
|
217 **TIP:** If your paired-end data is arranged differently, you may look into the *fastq splitter* and *fastq de-interlacer* tools for Galaxy from the `Fastq Manipulation category`_ of the Galaxy Tool Shed to see if they can convert your files to the expected format.
|
|
218
|
|
219 3) The tool supports the alignment of reads from the same sequencing run, but distributed across several input files.
|
|
220
|
|
221 Generally, it expects the reads from each input dataset to belong to one read-group and will abort with an error message if any input dataset declares more than one read group or sample names in its header. Different datasets, however, are allowed to contain reads from the same read-group (as indicated by matching read-group IDs and sample names in their headers), in which case the reads will be combined into one group in the output.
|
|
222
|
|
223 4) Read-group information is required for every input dataset!
|
|
224
|
|
225 We generally recommend to store NGS datasets in SAM/BAM format with run metadata stored in the file header. You can use the *NGS Run Annotation* and *Convert* tools to convert data in fastq format to SAM/BAM with added run information.
|
|
226
|
|
227 While it is not our recommended approach, you can, if you prefer it, align reads from fastq files or SAM/BAM files without header read-group information. To do so, you **must** specify a SAM file that provides the missing information in its header along with the input dataset. You can generate a SAM header file with the *NGS Run Annotation* tool.
|
|
228
|
|
229 Optionally, a SAM header file can also be used to replace existing read-group information in a headered SAM/BAM input file. This can be used to resolve read-group ID conflicts between multiple input files at tool runtime.
|
|
230
|
4
|
231 5) The options available under *further parameter settings* can have **big** effects on the alignment quality. You are strongly encouraged to consult the `tool documentation`_ for detailed explanations of the available options.
|
|
232
|
|
233 6) Currently, you cannot configure aligner-specific options separately for specific input files from within this Galaxy tool. If you need this advanced level of control, you should use the command line tool ``mimodd snap-batch``.
|
0
|
234
|
|
235 .. _Fastq Manipulation category: https://toolshed.g2.bx.psu.edu/repository/browse_repositories_in_category?id=310ff67d4caf6531
|
|
236 .. _recipe for using gzipped fastq files in Galaxy: http://mimodd.readthedocs.org/en/latest/recipes.html#use-gzipped-fastq-files-in-galaxy
|
|
237 .. _MiModD user guide: http://mimodd.readthedocs.org/en/latest
|
4
|
238 .. _tool documentation: http://mimodd.readthedocs.org/en/latest/tool_doc.html#snap
|
0
|
239
|
|
240 </help>
|
23
|
241 </tool> |