comparison picard_MergeBamAlignment.xml @ 120:9f95141d8f32 draft

Uploaded
author devteam
date Tue, 25 Feb 2014 18:55:58 -0500
parents
children
comparison
equal deleted inserted replaced
119:a85055d20937 120:9f95141d8f32
1 <tool id="picard_mergeBAMAlignment" name="Merge BAM Alignment" version="1.106.0">
2 <!-- Documentation: http://picard.sourceforge.net/command-line-overview.shtml#MergeBamAlignment
3 Merges alignment data from a SAM or BAM file with additional data stored in an unmapped BAM file and produces a third SAM or BAM file of aligned and unaligned reads. NOTE that this program expects to find a sequence dictionary in the same directory as REFERENCE_SEQUENCE and expects it to have the same base name as the reference fasta except with the extension '.dict'
4
5 OUTPUT=File Merged SAM or BAM file to write to. Required.
6 REFERENCE_SEQUENCE=File Path to the fasta file for the reference sequence. Required.
7 -->
8 <description>Merges alignment data from a SAM or BAM file with additional data stored</description>
9 <requirements><requirement type="package" version="1.106.0">picard</requirement></requirements>
10 <command interpreter="bash">
11 mergebamalignment_wrapper.sh $output1 $outformat $REFERENCE_SEQUENCE UNMAPPED_BAM=$UNMAPPED_BAM PAIRED_RUN=$PAIRED_RUN
12
13 ## optional arguments from here
14
15 #if str( $ALIGNED_BAM ):
16 ALIGNED_BAM=$ALIGNED_BAM
17 #end if
18 #for $i in $ALIGNED_BAMs
19 ALIGNED_BAM=${i.ALIGNED_BAM_file}
20 #end for
21
22 #if str( $READ1_ALIGNED_BAM ):
23 READ1_ALIGNED_BAM=$READ1_ALIGNED_BAM
24 #end if
25 #for $i in $READ1_ALIGNED_BAMs
26 READ1_ALIGNED_BAM=${i.READ1_ALIGNED_BAM_file}
27 #end for
28
29 #if str( $ATTRIBUTES_TO_RETAIN ):
30 ATTRIBUTES_TO_RETAIN=$ATTRIBUTES_TO_RETAIN
31 #end if
32 #for $i in $ATTRIBUTES_TO_RETAINs
33 ATTRIBUTES_TO_RETAIN=${i.ATTRIBUTES_TO_RETAIN_extra}
34 #end for
35
36 #if str( $READ2_ALIGNED_BAM ):
37 READ2_ALIGNED_BAM=$READ2_ALIGNED_BAM
38 #end if
39 #for $i in $READ2_ALIGNED_BAMs
40 READ2_ALIGNED_BAM=${i.READ2_ALIGNED_BAM_file}
41 #end for
42
43 #if str( $PROGRAM_RECORD_ID ):
44 PROGRAM_RECORD_ID=$PROGRAM_RECORD_ID
45 #end if
46
47 #if str( $PROGRAM_GROUP_VERSION ):
48 PROGRAM_GROUP_VERSION=$PROGRAM_GROUP_VERSION
49 #end if
50
51 #if str( $PROGRAM_GROUP_COMMAND_LINE ):
52 PROGRAM_GROUP_COMMAND_LINE=$PROGRAM_GROUP_COMMAND_LINE
53 #end if
54
55 #if str( $PROGRAM_GROUP_NAME ):
56 PROGRAM_GROUP_NAME=$PROGRAM_GROUP_NAME
57 #end if
58
59 #if str( $CLIP_ADAPTERS ):
60 CLIP_ADAPTERS=$CLIP_ADAPTERS
61 #end if
62
63 #if str( $IS_BISULFITE_SEQUENCE ):
64 IS_BISULFITE_SEQUENCE=$IS_BISULFITE_SEQUENCE
65 #end if
66
67 #if str( $ALIGNED_READS_ONLY ):
68 ALIGNED_READS_ONLY=$ALIGNED_READS_ONLY
69 #end if
70
71 #if str( $MAX_INSERTIONS_OR_DELETIONS ):
72 MAX_INSERTIONS_OR_DELETIONS=$MAX_INSERTIONS_OR_DELETIONS
73 #end if
74
75 #if str( $READ1_TRIM ):
76 READ1_TRIM=$READ1_TRIM
77 #end if
78
79 #if str( $READ2_TRIM ):
80 READ2_TRIM=$READ2_TRIM
81 #end if
82
83 #if str( $EXPECTED_ORIENTATIONS ):
84 EXPECTED_ORIENTATIONS=$EXPECTED_ORIENTATIONS
85 #end if
86
87 #if str( $SORT_ORDER ):
88 SORT_ORDER=$SORT_ORDER
89 #end if
90
91 #if str( $PRIMARY_ALIGNMENT_STRATEGY ):
92 PRIMARY_ALIGNMENT_STRATEGY=$PRIMARY_ALIGNMENT_STRATEGY
93 #end if
94
95 #if str( $CLIP_OVERLAPPING_READS ):
96 CLIP_OVERLAPPING_READS=$CLIP_OVERLAPPING_READS
97 #end if
98
99 #if str( $INCLUDE_SECONDARY_ALIGNMENTS ):
100 INCLUDE_SECONDARY_ALIGNMENTS=$INCLUDE_SECONDARY_ALIGNMENTS
101 #end if
102
103 VALIDATION_STRINGENCY=LENIENT TMP_DIR=$__new_file_path__
104 2&gt; $outlog
105 ##|| echo "Error running Picard MergeBamAlignment" >&amp;2
106 </command>
107 <inputs>
108 <!-- required arguments below -->
109 <param name="title" label="Name for the output merged BAM or SAM file" type="text" default="Merged.bam" help="This name will appear in your history so use it to remember what the new file in your history contains" />
110 <param name="outformat" type="select" label="Output format" >
111 <option value="bam" selected="True">BAM</option>
112 <option value="sam">SAM</option>
113 </param>
114 <param name="UNMAPPED_BAM" label="Original SAM or BAM file of unmapped reads, which must be in queryname order. Required." type="data" format="bam,sam" />
115 <param name="REFERENCE_SEQUENCE" label="Path to the fasta file for the reference sequence. Required." type="data" format="fasta" />
116 <param name="PAIRED_RUN" value="true" type="boolean" label="Whether this is a paired-end run. Required." truevalue="true" falsevalue="false" checked="yes" />
117 <!-- optional arguments below -->
118 <param name="ALIGNED_BAM" label="SAM or BAM file(s) with alignment data. This option may be specified 0 or more times. Cannot be used in conjuction with option(s) READ1_ALIGNED_BAM (R1_ALIGNED) READ2_ALIGNED_BAM (R2_ALIGNED)" type="data" format="bam,sam" help="Need to add more files? Use controls below." />
119 <repeat name="ALIGNED_BAMs" title="More ALIGNED_BAMs">
120 <param name="ALIGNED_BAM_file" label="ALIGNED_BAM" type="data" format="bam,sam" />
121 </repeat>
122 <param name="READ1_ALIGNED_BAM" label="SAM or BAM file(s) with alignment data from the first read of a pair. This option may be specified 0 or more times. Cannot be used in conjuction with option(s) ALIGNED_BAM (ALIGNED)" type="data" format="bam,sam" help="Need to add more files? Use controls below." />
123 <repeat name="READ1_ALIGNED_BAMs" title="More READ1_ALIGNED_BAMs">
124 <param name="READ1_ALIGNED_BAM_file" label="READ1_ALIGNED_BAM" type="data" format="bam,sam" />
125 </repeat>
126 <param name="READ2_ALIGNED_BAM" label="SAM or BAM file(s) with alignment data from the second read of a pair. This option may be specified 0 or more times. Cannot be used in conjuction with option(s) ALIGNED_BAM (ALIGNED)" type="data" format="bam,sam" help="Need to add more files? Use controls below." />
127 <repeat name="READ2_ALIGNED_BAMs" title="More READ2_ALIGNED_BAMs">
128 <param name="READ2_ALIGNED_BAM_file" label="READ2_ALIGNED_BAM" type="data" format="bam,sam" />
129 </repeat>
130 <param name="PROGRAM_RECORD_ID" label="The program group ID of the aligner (if not supplied by the aligned file)." type="text" default="" />
131 <param name="PROGRAM_GROUP_VERSION" label="The version of the program group (if not supplied by the aligned file)." type="text" default="" />
132 <param name="PROGRAM_GROUP_COMMAND_LINE" label="The command line of the program group (if not supplied by the aligned file)." type="text" default="" />
133 <param name="PROGRAM_GROUP_NAME" label="The name of the program group (if not supplied by the aligned file)." type="text" default="" />
134 <param name="CLIP_ADAPTERS" value="true" type="boolean" label="Whether to clip adapters where identified. Default value: true." truevalue="true" falsevalue="false" checked="yes" />
135 <param name="IS_BISULFITE_SEQUENCE" value="false" type="boolean" label="Whether the lane is bisulfite sequence (used when caculating the NM tag)." truevalue="true" falsevalue="false" checked="yes" />
136 <param name="ALIGNED_READS_ONLY" value="false" type="boolean" label="Whether to output only aligned reads." truevalue="true" falsevalue="false" checked="yes" />
137 <param name="MAX_INSERTIONS_OR_DELETIONS" value="1" type="integer"
138 label="The maximum number of insertions or deletions permitted for an alignment to be included."
139 help="Alignments with more than this many insertions or deletions will be ignored. Set to -1 to allow any number of insertions or deletions. Default value: 1." />
140
141 <param name="ATTRIBUTES_TO_RETAIN" label="Reserved alignment attributes (tags starting with X, Y, or Z) that should be brought over from the alignment data when merging. This option may be specified 0 or more times." type="text" default="" />
142 <repeat name="ATTRIBUTES_TO_RETAINs" title="More ATTRIBUTES_TO_RETAIN">
143 <param name="ATTRIBUTES_TO_RETAIN_extra" label="ATTRIBUTES_TO_RETAIN" type="text" default="" />
144 </repeat>
145 <param name="READ1_TRIM" value="0" type="integer" label="The number of bases trimmed from the beginning of read 1 prior to alignment"/>
146 <param name="READ2_TRIM" value="0" type="integer" label="The number of bases trimmed from the beginning of read 2 prior to alignment"/>
147 <param name="EXPECTED_ORIENTATIONS" label="The name of the program group (if not supplied by the aligned file)." type="select">
148 <option value="null" selected="True">null</option>
149 <option value="FR">FR</option>
150 <option value="RF">RF</option>
151 <option value="TANDEM">TANDEM</option>
152 </param>
153 <param name="SORT_ORDER" label="The order in which the merged reads should be output. Default value: coordinate." type="select">
154 <option value="coordinate" selected="True">coordinate</option>
155 <option value="queryname">queryname</option>
156 <option value="unsorted">unsorted</option>
157 </param>
158 <param name="PRIMARY_ALIGNMENT_STRATEGY" label="Strategy for selecting primary alignment when the aligner has provided more than one alignment for a pair or fragment, and none are marked as primary, more than one is marked as primary, or the primary alignment is filtered out for some reason." type="select" help="BestMapq expects that multiple alignments will be correlated with HI tag, and prefers the pair of
159 alignments with the largest MAPQ, in the absence of a primary selected by the aligner. EarliestFragment prefers the alignment which maps the earliest base in the read. Note that EarliestFragment may not be used for paired reads. BestEndMapq is appropriate for cases in which the aligner is not pair-aware, and does not output the HI tag. It simply picks the alignment for each end with the highest MAPQ, and makes those alignments primary, regardless of whether the two alignments make sense together.MostDistant is also for a non-pair-aware aligner, and picks the alignment pair with the largest insert size. If all alignments would be chimeric, it picks the alignments for each end with the best MAPQ. For all algorithms, ties are resolved arbitrarily. Default value: BestMapq.">
160 <option value="BestMapq" selected="True">BestMapq</option>
161 <option value="EarliestFragment">EarliestFragment</option>
162 <option value="BestEndMapq">BestEndMapq</option>
163 <option value="MostDistant">MostDistant</option>
164 </param>
165
166 <param name="CLIP_OVERLAPPING_READS" value="true" type="boolean" 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." truevalue="true" falsevalue="false" checked="yes" />
167 <param name="INCLUDE_SECONDARY_ALIGNMENTS" value="true" type="boolean" label="If false, do not write secondary alignments to output." truevalue="true" falsevalue="false" checked="yes" />
168 </inputs>
169
170 <outputs>
171 <data format="bam" name="output1" label="${title}.${outformat}" >
172 <change_format>
173 <when input="outformat" value="sam" format="sam" />
174 </change_format>
175 </data>
176 </outputs>
177 <tests>
178 <!-- note: this test is untested :) -->
179 <test>
180 <param name="REFERENCE_SEQUENCE" value="merger.fasta" />
181 <param name="UNMAPPED_BAM" value="unmapped.sam" />
182 <param name="PAIRED_RUN" value="false" />
183 <param name="outformat" value="sam" />
184 <output name="output1" file="output_mergebamalignment" lines_diff="1"/>
185 </test>
186 </tests>
187 <help>
188
189 **What it does**
190
191 Merges alignment data from a SAM or BAM file with additional data stored in an unmapped BAM file and produces a third SAM or BAM file of aligned and unaligned reads. NOTE that this program expects to find a sequence dictionary in the same directory as REFERENCE_SEQUENCE and expects it to have the same base name as the reference fasta except with the extension '.dict'
192 metadata such as read groups
193
194 .. _Picard: http://picard.sourceforge.net/command-line-overview.shtml#MergeBamAlignment
195
196
197 </help>
198 </tool>