Mercurial > repos > devteam > picard_122_up
comparison picard_MergeBamAlignment.xml @ 0:b76a4f17bbbb draft
Uploaded
author | devteam |
---|---|
date | Thu, 23 Oct 2014 11:31:30 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b76a4f17bbbb |
---|---|
1 <tool name="MergeBamAlignment" id="picard_MergeBamAlignment" version="1.122.0"> | |
2 <description>merge alignment data with additional info stored in an unmapped BAM dataset</description> | |
3 <requirements><requirement type="package" version="1.122.0">picard</requirement></requirements> | |
4 | |
5 <macros> | |
6 <import>picard_macros.xml</import> | |
7 </macros> | |
8 | |
9 <command> | |
10 @java_options@ | |
11 #set $picard_dict = "localref.dict" | |
12 #set $ref_fasta = "localref.fa" ## This is done because picards "likes" .fa extension | |
13 | |
14 ln -s "${reference_source.ref_file}" "${ref_fasta}" && | |
15 | |
16 #if str( $reference_source.reference_source_selector ) == "history": | |
17 | |
18 java -jar \$JAVA_JAR_PATH/CreateSequenceDictionary.jar REFERENCE="${ref_fasta}" OUTPUT="${picard_dict}" | |
19 QUIET=true | |
20 VERBOSITY=ERROR | |
21 | |
22 && | |
23 | |
24 #else: | |
25 | |
26 #set $ref_fasta = str( $reference_source.ref_file.fields.path ) | |
27 | |
28 #end if | |
29 | |
30 java -jar \$JAVA_JAR_PATH/MergeBamAlignment.jar | |
31 UNMAPPED_BAM="${unmapped_bam}" | |
32 | |
33 PAIRED_RUN=true ##This argument is ignored and will be removed. Required. Possible values: {true, false} | |
34 | |
35 #if str( $aligned_or_read1_and_read2.aligned_or_read1_and_read2_selector ) == "paired_one_file": | |
36 #for $dataset in $aligned_or_read1_and_read2.aligned_bams: | |
37 ALIGNED_BAM="${dataset.aligned_bam}" | |
38 #end for | |
39 #elif str( $aligned_or_read1_and_read2.aligned_or_read1_and_read2_selector ) == "paired_two_files": | |
40 #for $dataset in $aligned_or_read1_and_read2.read1_aligned_bams: | |
41 READ1_ALIGNED_BAM="${dataset.read1_aligned_bam}" | |
42 #end for | |
43 #for $dataset in $aligned_or_read1_and_read2.read2_aligned_bams: | |
44 READ2_ALIGNED_BAM="${dataset.read1_aligned_bam}" | |
45 #end for | |
46 #else | |
47 #for $dataset in $aligned_or_read1_and_read2.read1_aligned_bams: | |
48 READ1_ALIGNED_BAM="${dataset.read1_aligned_bam}" | |
49 #end for | |
50 #end if | |
51 | |
52 OUTPUT="${outFile}" | |
53 REFERENCE_SEQUENCE="${ref_fasta}" | |
54 | |
55 CLIP_ADAPTERS="${clip_adapters}" | |
56 IS_BISULFITE_SEQUENCE="${is_bisulfite_sequence}" | |
57 ALIGNED_READS_ONLY="${aligned_reads_only}" | |
58 MAX_INSERTIONS_OR_DELETIONS="${max_insertions_or_deletions}" | |
59 | |
60 #for $attribute in $attributes_to_retain: | |
61 ATTRIBUTES_TO_RETAIN="${$attribute.attribute}" | |
62 #end for | |
63 | |
64 #for $attribute in $attributes_to_remove: | |
65 ATTRIBUTES_TO_REMOVE="${$attribute.attribute}" | |
66 #end for | |
67 | |
68 READ1_TRIM="${read1_trim}" | |
69 READ2_TRIM="${read2_trim}" | |
70 | |
71 #if str( $orientations ) != "None": | |
72 #for $orientation in str( $orientations ).split(','): ## See trello card https://trello.com/c/9nW02Zhd | |
73 EXPECTED_ORIENTATIONS="${orientation}" | |
74 #end for | |
75 #end if | |
76 | |
77 ALIGNER_PROPER_PAIR_FLAGS="${aligner_proper_pair_flags}" | |
78 PRIMARY_ALIGNMENT_STRATEGY="${primary_alignment_strategy}" | |
79 CLIP_OVERLAPPING_READS="${clip_overlapping_reads}" | |
80 INCLUDE_SECONDARY_ALIGNMENTS="${include_secondary_alignments}" | |
81 ADD_MATE_CIGAR="${add_mate_cigar}" | |
82 | |
83 VALIDATION_STRINGENCY="${validation_stringency}" | |
84 | |
85 SORT_ORDER=coordinate | |
86 QUIET=true | |
87 VERBOSITY=ERROR | |
88 | |
89 </command> | |
90 | |
91 <inputs> | |
92 | |
93 <conditional name="reference_source"> | |
94 <param name="reference_source_selector" type="select" label="Load reference genome from"> | |
95 <option value="cached">Local cache</option> | |
96 <option value="history">History</option> | |
97 </param> | |
98 <when value="cached"> | |
99 <param name="ref_file" type="select" label="Use dictionary from the list" help="Select genome from the list"> | |
100 <options from_data_table="picard_indexes"> | |
101 <filter type="sort_by" column="2" /> | |
102 <validator type="no_options" message="No indexes are available" /> | |
103 </options> | |
104 <validator type="no_options" message="A built-in dictionary is not available for the build associated with the selected input file"/> | |
105 </param> | |
106 </when> | |
107 <when value="history"> | |
108 <param name="ref_file" type="data" format="fasta" label="Use the following dataset to create dictionary" help="You can upload a FASTA sequence to the history from which Picard will automatically generate dictionary using CreateSequenceDictionary command" /> | |
109 </when> | |
110 </conditional> | |
111 | |
112 <param format="sam,bam" name="unmapped_bam" type="data" label="Selected unaligned SAM or BAM with original reads" help="UNMAPPED_BAM; This dataset must be sorted in queryname order (use picard_SortSam to do this)" /> | |
113 <conditional name="aligned_or_read1_and_read2"> | |
114 <param name="aligned_or_read1_and_read2_selector" type="select" label="What type of aligned data do you have?"> | |
115 <option value="paired_one_file">Paired data in a single BAM file (ALIGNED_BAM)</option> | |
116 <option value="paired_two_files">Paired data in separate files (READ1_ALIGNED_BAM and READ2_ALIGNED_BAM)</option> | |
117 <option value="single_file">Singe end data (READ1_ALIGNED_BAM)</option> | |
118 </param> | |
119 <when value="paired_one_file"> | |
120 <repeat name="aligned_bams" title="Aligned SAM or BAM dataset" min="1" help="You can provide multiple datasets"> | |
121 <param name="aligned_bam" type="data" format="sam,bam" label="SAM or BAM dataset(s) with alignment data" help="ALIGNED_BAM"/> | |
122 </repeat> | |
123 </when> | |
124 <when value="paired_two_files"> | |
125 <repeat name="read1_aligned_bams" title="Aligned SAM or BAM dataset for Read 1" min="1" help="You can provide multiple datasets"> | |
126 <param name="read1_aligned_bam" type="data" format="sam,bam" label="SAM or BAM dataset(s) with alignment data for Read1" help="READ1_ALIGNED_BAM"/> | |
127 </repeat> | |
128 <repeat name="read2_aligned_bams" title="Aligned SAM or BAM dataset for Read 2" min="1" help="You can provide multiple datasets"> | |
129 <param name="read2_aligned_bam" type="data" format="sam,bam" label="SAM or BAM dataset(s) with alignment data for Read2" help="READ2_ALIGNED_BAM"/> | |
130 </repeat> | |
131 </when> | |
132 <when value="single_file"> | |
133 <repeat name="read1_aligned_bams" title="Aligned SAM or BAM dataset for Single Reads" min="1" help="You can provide multiple datasets"> | |
134 <param name="read1_aligned_bam" type="data" format="sam,bam" label="SAM or BAM dataset(s) with alignment data" help="READ1_ALIGNED_BAM"/> | |
135 </repeat> | |
136 </when> | |
137 </conditional> | |
138 | |
139 <param name="clip_adapters" type="boolean" checked="true" label="Whether to clip adapters where identified" help="CLIP_ADAPTERS; default=True"/> | |
140 <param name="is_bisulfite_sequence" type="boolean" label="Whether the data is from bisulfite sequencing (used when caculating the NM tag)" help="IS_BISULFITE_SEQUENCE; default=False"/> | |
141 <param name="aligned_reads_only" type="boolean" label="Whether to output only aligned reads" help="ALIGNED_READS_ONLY; default=False"/> | |
142 <param name="max_insertions_or_deletions" type="integer" value="1" label="The maximum number of insertions or deletions permitted for an alignment to be included" help="MAX_INSERTIONS_OR_DELETIONS; Alignments with more than this many insertions or deletions will be ignored. Set to -1 to allow any number of insertions or deletions. default=1"/> | |
143 | |
144 <repeat name="attributes_to_retain" title="Retain the following alignment attribute" min="0" help="You can provide multiple attributes"> | |
145 <param name="attribute" type="text" size="4" label="Reserved alignment attributes (tags starting with X, Y, or Z) that should be brought over from the alignment data when merging" help="ATTRIBUTES_TO_RETAIN; example: XA"/> | |
146 </repeat> | |
147 | |
148 <repeat name="attributes_to_remove" title="Remove the following alignment attribute" min="0" help="You can provide multiple attributes"> | |
149 <param name="attribute" type="text" size="4" label="Attributes from the alignment record that should be removed when merging." help="ATTRIBUTES_TO_REMOVE; This overrides ATTRIBUTES_TO_RETAIN if they share common tags"/> | |
150 </repeat> | |
151 | |
152 <param name="read1_trim" type="integer" value="0" label="The number of bases trimmed from the beginning of read 1 prior to alignment" help="READ1_TRIM; default=0"/> | |
153 <param name="read2_trim" type="integer" value="0" label="The number of bases trimmed from the beginning of read 2 prior to alignment" help="READ2_TRIM; default=0"/> | |
154 | |
155 <param name="orientations" type="select" multiple="True" display="checkboxes" label="The expected orientation of proper read pairs" help="EXPECTED_ORIENTATIONS; multiple orinetations can be selected"> | |
156 <option value="FR">Forward/Reverse (FR)</option> | |
157 <option value="RF">Reverse/Forward (RF)</option> | |
158 <option value="TANDEM">Tandem</option> | |
159 </param> | |
160 | |
161 | |
162 <param name="aligner_proper_pair_flags" type="boolean" label="Use the aligner's idea of what a proper pair is rather than computing in this program" help="ALIGNER_PROPER_PAIR_FLAGS; default=False"/> | |
163 | |
164 <param name="primary_alignment_strategy" type="select" label="Strategy for selecting primary alignment when the aligner has provided more than one alignment for a pair or fragments" help="PRIMARY_ALIGNMENT_STRATEGY; see help below for more info; default=BestMapq"> | |
165 <option value="BestMapq" selected="True">BestMapq</option> | |
166 <option value="EarliestFragment">EarliestFragment</option> | |
167 <option value="BestEndMapq">BestEndMapq</option> | |
168 <option value="MostDistant">MostDistant</option> | |
169 </param> | |
170 | |
171 <param name="clip_overlapping_reads" type="boolean" checked="True" label="For paired reads, soft clip the 3' end of each read if necessary so that it does not extend past the 5' end of its mate" help="CLIP_OVERLAPPING_READS; default=True"/> | |
172 <param name="include_secondary_alignments" type="boolean" checked="True" label="If false, do not write secondary alignments to output" help="INCLUDE_SECONDARY_ALIGNMENTS; default=True"/> | |
173 <param name="add_mate_cigar" type="boolean" checked="True" label="Adds the mate CIGAR tag (MC) if true, does not if false" help="ADD_MATE_CIGAR; default=True"/> | |
174 <expand macro="VS" /> | |
175 </inputs> | |
176 <outputs> | |
177 <data name="outFile" format="bam" label="${tool.name} on ${on_string}: BAM with merged alignments"/> | |
178 </outputs> | |
179 <tests> | |
180 <test> | |
181 <param name="reference_source_selector" value="history" /> | |
182 <param name="ref_file" value="picard_MergeBamAlignment_ref.fa" ftype="fasta" /> | |
183 <param name="unmapped_bam" value="picard_MergeBamAlignment_unaligned.bam" ftype="bam"/> | |
184 <param name="aligned_or_read1_and_read2_selector" value="paired_one_file"/> | |
185 <param name="aligned_bam" value="picard_MergeBamAlignment_aligned.bam" ftype="bam"/> | |
186 <param name="clip_adapters" value="True"/> | |
187 <param name="is_bisulfite_sequence" value="False"/> | |
188 <param name="aligned_reads_only" value="False"/> | |
189 <param name="max_insertions_or_deletions" value="1"/> | |
190 <param name="read1_trim" value="0"/> | |
191 <param name="read2_trim" value="0"/> | |
192 <param name="orientation" value="FR"/> | |
193 <param name="aligner_proper_pair_flags" value="False"/> | |
194 <param name="primary_alignment_strategy" value="BestMapq"/> | |
195 <param name="clip_overlapping_reads" value="True"/> | |
196 <param name="include_secondary_alignments" value="True"/> | |
197 <param name="add_mate_cigar" value="True"/> | |
198 <output name="outFile" file="picard_MergeBamAlignment_test1.bam" ftype="bam" lines_diff="2"/> | |
199 </test> | |
200 </tests> | |
201 | |
202 <stdio> | |
203 <exit_code range="1:" level="fatal"/> | |
204 </stdio> | |
205 | |
206 <help> | |
207 | |
208 .. class:: infomark | |
209 | |
210 **Purpose** | |
211 | |
212 Merges alignment data from a SAM or BAM dataset with additional data stored in an unmapped BAM dataset and produces a third SAM or BAM dataset of aligned and unaligned reads. | |
213 | |
214 @dataset_collections@ | |
215 | |
216 @description@ | |
217 | |
218 UNMAPPED_BAM=File | |
219 UNMAPPED=File Original SAM or BAM file of unmapped reads, which must be in queryname order. Required. | |
220 | |
221 ALIGNED_BAM=File | |
222 ALIGNED=File SAM or BAM file(s) with alignment data. This option may be specified 0 or more times. | |
223 Cannot be used in conjuction with option(s) READ1_ALIGNED_BAM (R1_ALIGNED) | |
224 READ2_ALIGNED_BAM (R2_ALIGNED) | |
225 | |
226 READ1_ALIGNED_BAM=File | |
227 R1_ALIGNED=File SAM or BAM file(s) with alignment data from the first read of a pair. This option may be | |
228 specified 0 or more times. Cannot be used in conjuction with option(s) ALIGNED_BAM | |
229 (ALIGNED) | |
230 | |
231 READ2_ALIGNED_BAM=File | |
232 R2_ALIGNED=File SAM or BAM file(s) with alignment data from the second read of a pair. This option may | |
233 be specified 0 or more times. Cannot be used in conjuction with option(s) ALIGNED_BAM | |
234 (ALIGNED) | |
235 | |
236 PAIRED_RUN=Boolean | |
237 PE=Boolean This argument is ignored and will be removed. Required. Possible values: {true, false} | |
238 | |
239 JUMP_SIZE=Integer | |
240 JUMP=Integer The expected jump size (required if this is a jumping library). Deprecated. Use | |
241 EXPECTED_ORIENTATIONS instead Default value: null. Cannot be used in conjuction with | |
242 option(s) EXPECTED_ORIENTATIONS (ORIENTATIONS) | |
243 | |
244 CLIP_ADAPTERS=Boolean Whether to clip adapters where identified. Default value: true. Possible values: {true, false} | |
245 | |
246 IS_BISULFITE_SEQUENCE=Boolean Whether the lane is bisulfite sequence (used when caculating the NM tag). Default value: | |
247 false. Possible values: {true, false} | |
248 | |
249 ALIGNED_READS_ONLY=Boolean Whether to output only aligned reads. Default value: false. Possible values: {true, false} | |
250 | |
251 MAX_INSERTIONS_OR_DELETIONS=Integer | |
252 MAX_GAPS=Integer The maximum number of insertions or deletions permitted for an alignment to be included. | |
253 Alignments with more than this many insertions or deletions will be ignored. Set to -1 to | |
254 allow any number of insertions or deletions. Default value: 1. | |
255 | |
256 ATTRIBUTES_TO_RETAIN=String Reserved alignment attributes (tags starting with X, Y, or Z) that should be brought over | |
257 from the alignment data when merging. This option may be specified 0 or more times. | |
258 | |
259 ATTRIBUTES_TO_REMOVE=String Attributes from the alignment record that should be removed when merging. This overrides | |
260 ATTRIBUTES_TO_RETAIN if they share common tags. This option may be specified 0 or more | |
261 times. | |
262 | |
263 READ1_TRIM=Integer | |
264 R1_TRIM=Integer The number of bases trimmed from the beginning of read 1 prior to alignment Default | |
265 value: 0. | |
266 | |
267 READ2_TRIM=Integer | |
268 R2_TRIM=Integer The number of bases trimmed from the beginning of read 2 prior to alignment Default | |
269 value: 0. | |
270 | |
271 EXPECTED_ORIENTATIONS=PairOrientation | |
272 ORIENTATIONS=PairOrientation The expected orientation of proper read pairs. Replaces JUMP_SIZE Possible values: {FR, | |
273 RF, TANDEM} This option may be specified 0 or more times. Cannot be used in conjuction | |
274 with option(s) JUMP_SIZE (JUMP) | |
275 | |
276 ALIGNER_PROPER_PAIR_FLAGS=Boolean | |
277 Use the aligner's idea of what a proper pair is rather than computing in this program. | |
278 Default value: false. Possible values: {true, false} | |
279 | |
280 SORT_ORDER=SortOrder | |
281 SO=SortOrder The order in which the merged reads should be output. Default value: coordinate. | |
282 Possible values: {unsorted, queryname, coordinate} | |
283 | |
284 PRIMARY_ALIGNMENT_STRATEGY=PrimaryAlignmentStrategy | |
285 Strategy for selecting primary alignment when the aligner has provided more than one | |
286 alignment for a pair or fragment, and none are marked as primary, more than one is marked | |
287 as primary, or the primary alignment is filtered out for some reason. BestMapq expects | |
288 that multiple alignments will be correlated with HI tag, and prefers the pair of | |
289 alignments with the largest MAPQ, in the absence of a primary selected by the aligner. | |
290 EarliestFragment prefers the alignment which maps the earliest base in the read. Note | |
291 that EarliestFragment may not be used for paired reads. BestEndMapq is appropriate for | |
292 cases in which the aligner is not pair-aware, and does not output the HI tag. It simply | |
293 picks the alignment for each end with the highest MAPQ, and makes those alignments | |
294 primary, regardless of whether the two alignments make sense together.MostDistant is also | |
295 for a non-pair-aware aligner, and picks the alignment pair with the largest insert size. | |
296 If all alignments would be chimeric, it picks the alignments for each end with the best | |
297 MAPQ. For all algorithms, ties are resolved arbitrarily. Default value: BestMapq. | |
298 Possible values: {BestMapq, EarliestFragment, BestEndMapq, MostDistant} | |
299 | |
300 CLIP_OVERLAPPING_READS=BooleanFor paired reads, soft clip the 3' end of each read if necessary so that it does not | |
301 extend past the 5' end of its mate. Default value: true. Possible values: {true, false} | |
302 | |
303 INCLUDE_SECONDARY_ALIGNMENTS=Boolean | |
304 If false, do not write secondary alignments to output. Default value: true. | |
305 Possible values: {true, false} | |
306 | |
307 ADD_MATE_CIGAR=Boolean | |
308 MC=Boolean Adds the mate CIGAR tag (MC) if true, does not if false. Possible values: {true, false} | |
309 | |
310 | |
311 | |
312 | |
313 @more_info@ | |
314 </help> | |
315 </tool> | |
316 | |
317 | |
318 | |
319 | |
320 | |
321 | |
322 | |
323 | |
324 | |
325 | |
326 | |
327 | |
328 |