Mercurial > repos > devteam > bamtools_filter
comparison bamtools-filter.xml @ 9:c20a4a4acf3f draft
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
author | devteam |
---|---|
date | Mon, 09 Nov 2015 12:04:29 -0500 |
parents | 709d8669e8d6 |
children | 4089f1be1a71 |
comparison
equal
deleted
inserted
replaced
8:709d8669e8d6 | 9:c20a4a4acf3f |
---|---|
1 <tool id="bamFilter" name="Filter" version="0.0.1"> | 1 <tool id="bamFilter" name="Filter" version="0.0.2"> |
2 <description>BAM datasets on a variety of attributes</description> | 2 <description>BAM datasets on a variety of attributes</description> |
3 <requirements> | 3 <requirements> |
4 <requirement type="package" version="2.3.0_2d7685d2ae">bamtools</requirement> | 4 <requirement type="package" version="2.3.0_2d7685d2ae">bamtools</requirement> |
5 </requirements> | 5 </requirements> |
6 <command> | 6 <command> |
7 cat $script_file > $out_file2; | 7 cat $script_file > $out_file2; |
8 | 8 |
9 #for $bam_count, $input_bam in enumerate( $input_bams ): | 9 #for $bam_count, $input_bam in enumerate( $input_bams ): |
10 ln -s "${input_bam.input_bam}" "localbam_${bam_count}.bam" && | 10 ln -s "${input_bam}" "localbam_${bam_count}.bam" && |
11 ln -s "${input_bam.input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" && | 11 ln -s "${input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" && |
12 #end for | 12 #end for |
13 | 13 |
14 bamtools | 14 bamtools |
15 filter | 15 filter |
16 -script $script_file | 16 -script $script_file |
17 | 17 |
18 #for $bam_count, $input_bam in enumerate( $input_bams ): | 18 #for $bam_count, $input_bam in enumerate( $input_bams ): |
19 -in "localbam_${bam_count}.bam" | 19 -in "localbam_${bam_count}.bam" |
20 #end for | 20 #end for |
21 -out $out_file1 | 21 -out $out_file1 |
22 </command> | 22 </command> |
23 <inputs> | 23 <inputs> |
24 <repeat name="input_bams" title="BAM dataset(s) to filter" min="1"> | 24 <param name="input_bams" type="data" format="bam" label="BAM dataset(s) to filter" min="1" multiple="True"/> |
25 <param name="input_bam" type="data" format="bam" label="BAM dataset" /> | |
26 </repeat> | |
27 <repeat name="conditions" title="Condition" min="1"> | 25 <repeat name="conditions" title="Condition" min="1"> |
28 <repeat name="filters" title="Filter" min="1"> | 26 <repeat name="filters" title="Filter" min="1"> |
29 <conditional name="bam_property"> | 27 <conditional name="bam_property"> |
30 <param name="bam_property_selector" type="select" label="Select BAM property to filter on"> | 28 <param name="bam_property_selector" type="select" label="Select BAM property to filter on"> |
31 <option value="alignmentFlag"/> | 29 <option value="alignmentFlag"/> |
180 [ | 178 [ |
181 #end if | 179 #end if |
182 #for $i, $c in enumerate( $conditions, start=1 ) | 180 #for $i, $c in enumerate( $conditions, start=1 ) |
183 { "id": "$i", | 181 { "id": "$i", |
184 #for $j, $s in enumerate( $c.filters, start=1 ) | 182 #for $j, $s in enumerate( $c.filters, start=1 ) |
185 ##The if below takes care of the comma at the end of last condition within group | 183 ##The if below takes care of the comma at the end of last condition within group |
186 #if $j != len( $c.filters) | 184 #if $j != len( $c.filters) |
187 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}", | 185 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}", |
188 #else | 186 #else |
189 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}" | 187 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}" |
190 #end if | 188 #end if |
191 #end for | 189 #end for |
192 ##The if below takes care of the comma at the end of last condition within group | 190 ##The if below takes care of the comma at the end of last condition within group |
193 #if $i != len( $conditions ) | 191 #if $i != len( $conditions ) |
194 }, | 192 }, |
195 #else | 193 #else |
196 } | 194 } |
197 #end if | 195 #end if |
212 <data format="txt" name="out_file2" /> | 210 <data format="txt" name="out_file2" /> |
213 <data format="bam" name="out_file1" /> | 211 <data format="bam" name="out_file1" /> |
214 </outputs> | 212 </outputs> |
215 <tests> | 213 <tests> |
216 <test> | 214 <test> |
217 <param name="input_bam" ftype="bam" value="bamtools-input1.bam"/> | 215 <param name="input_bams" ftype="bam" value="bamtools-input1.bam"/> |
218 <param name="bam_property_selector" value="mapQuality"/> | 216 <param name="bam_property_selector" value="mapQuality"/> |
219 <param name="bam_property_value" value=">20"/> | 217 <param name="bam_property_value" value=">20"/> |
220 <output name="out_file1" file="bamtools-test1.bam" ftype="bam"/> | 218 <output name="out_file1" file="bamtools-test1.bam" ftype="bam"/> |
221 </test> | 219 </test> |
222 </tests> | 220 </tests> |
223 <help> | 221 <help> |
224 **What is does** | 222 **What is does** |
225 | 223 |
262 | 260 |
263 ----- | 261 ----- |
264 | 262 |
265 **Example 3. Complex filtering with multiple conditions** | 263 **Example 3. Complex filtering with multiple conditions** |
266 | 264 |
267 Suppose now you would like to select **either** reads that (**1**) have (*1.1*) no mismatches and (*1.2*) are on the forward strand **OR** (**2**) reads that have (*2.1*) | 265 Suppose now you would like to select **either** reads that (**1**) have (*1.1*) no mismatches and (*1.2*) are on the forward strand **OR** (**2**) reads that have (*2.1*) |
268 at least one mismatch and (*2.2*) are on the reverse strand. In this scenario we have to set up two conditions: (**1**) and (**2**) each with two filters: *1.1* and *1.2* as well as *2.1* and *2.2*. | 266 at least one mismatch and (*2.2*) are on the reverse strand. In this scenario we have to set up two conditions: (**1**) and (**2**) each with two filters: *1.1* and *1.2* as well as *2.1* and *2.2*. |
269 The following screenshot expalins how this can be done: | 267 The following screenshot expalins how this can be done: |
270 | 268 |
271 .. image:: complex-filters.png | 269 .. image:: complex-filters.png |
272 | 270 |
273 ----- | 271 ----- |
277 In the above example we have used two conditions (Condition 1 and Condition 2). Using multiple conditions allows to combine them and a variety of ways to enable even more powerful filtering. | 275 In the above example we have used two conditions (Condition 1 and Condition 2). Using multiple conditions allows to combine them and a variety of ways to enable even more powerful filtering. |
278 For example, suppose get all reads that (**1**) do NOT map to mitochondria and either (**2**) have mapping quality over 20, or (**3**) are in properly mapped pairs. The logical rule to enable such | 276 For example, suppose get all reads that (**1**) do NOT map to mitochondria and either (**2**) have mapping quality over 20, or (**3**) are in properly mapped pairs. The logical rule to enable such |
279 filtering will look like this:: | 277 filtering will look like this:: |
280 | 278 |
281 !(1) & (2 | 3) | 279 !(1) & (2 | 3) |
282 | 280 |
283 Here, numbers 1, 2, and 3 represent conditions. The following screenshot illustrates how to do this in Galaxy: | 281 Here, numbers 1, 2, and 3 represent conditions. The following screenshot illustrates how to do this in Galaxy: |
284 | 282 |
285 .. image:: rule.png | 283 .. image:: rule.png |
286 | 284 |
287 There are three conditions here, each with a single filter. A text entry area that can be opened by clicking on the **Would you like to set rules?** checkbox enables you to enter a rule. | 285 There are three conditions here, each with a single filter. A text entry area that can be opened by clicking on the **Would you like to set rules?** checkbox enables you to enter a rule. |