Mercurial > repos > devteam > bamtools_filter
comparison bamtools-filter.xml @ 1:5e2fe70292a7 draft
planemo upload commit 5ad726dc73203a704666033cd3bf70b82575978f-dirty
| author | devteam |
|---|---|
| date | Wed, 26 Aug 2015 14:58:44 -0400 |
| parents | db10554eaad9 |
| children | 39e21f756379 |
comparison
equal
deleted
inserted
replaced
| 0:db10554eaad9 | 1:5e2fe70292a7 |
|---|---|
| 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 | |
| 8 cat $script_file > $out_file2; | 7 cat $script_file > $out_file2; |
| 9 | 8 |
| 10 #for $bam_count, $input_bam in enumerate( $input_bams ): | 9 #for $bam_count, $input_bam in enumerate( $input_bams ): |
| 11 ln -s "${input_bam.input_bam}" "localbam_${bam_count}.bam" && | 10 ln -s "${input_bam.input_bam}" "localbam_${bam_count}.bam" && |
| 12 ln -s "${input_bam.input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" && | 11 ln -s "${input_bam.input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" && |
| 13 #end for | 12 #end for |
| 14 | 13 |
| 18 | 17 |
| 19 #for $bam_count, $input_bam in enumerate( $input_bams ): | 18 #for $bam_count, $input_bam in enumerate( $input_bams ): |
| 20 -in "localbam_${bam_count}.bam" | 19 -in "localbam_${bam_count}.bam" |
| 21 #end for | 20 #end for |
| 22 -out $out_file1 | 21 -out $out_file1 |
| 23 | |
| 24 </command> | 22 </command> |
| 25 | |
| 26 <inputs> | 23 <inputs> |
| 27 <repeat name="input_bams" title="BAM dataset(s) to filter" min="1"> | 24 <repeat name="input_bams" title="BAM dataset(s) to filter" min="1"> |
| 28 <param name="input_bam" type="data" format="bam" label="BAM dataset" /> | 25 <param name="input_bam" type="data" format="bam" label="BAM dataset" /> |
| 29 </repeat> | 26 </repeat> |
| 30 <repeat name="conditions" title="Condition" min="1"> | 27 <repeat name="conditions" title="Condition" min="1"> |
| 195 ##The if below takes care of the comma at the end of last condition within group | 192 ##The if below takes care of the comma at the end of last condition within group |
| 196 #if $i != len( $conditions ) | 193 #if $i != len( $conditions ) |
| 197 }, | 194 }, |
| 198 #else | 195 #else |
| 199 } | 196 } |
| 200 #end if | 197 #end if |
| 201 #end for | 198 #end for |
| 202 #if len( $conditions ) > 1 | 199 #if len( $conditions ) > 1 |
| 203 #if str( $rule_configuration.rules_selector ) == "True": | 200 #if str( $rule_configuration.rules_selector ) == "True": |
| 204 ], | 201 ], |
| 205 "rule" : "${rule_configuration.rules}" | 202 "rule" : "${rule_configuration.rules}" |
| 206 #else | 203 #else |
| 247 **Example 1. Using a single filter** | 244 **Example 1. Using a single filter** |
| 248 | 245 |
| 249 When filtering on a single condition there is no need to worry about filters and conditions. Just choose a filter from the **Select BAM property to filter on:** dropdown and enter a value (or click a checkbox for binary filters). | 246 When filtering on a single condition there is no need to worry about filters and conditions. Just choose a filter from the **Select BAM property to filter on:** dropdown and enter a value (or click a checkbox for binary filters). |
| 250 For example, for retaining reads with mapping quality of at least 20 one would set the tool interface as shown below: | 247 For example, for retaining reads with mapping quality of at least 20 one would set the tool interface as shown below: |
| 251 | 248 |
| 252 .. image:: ${static_path}/images/simple-filter.png | 249 .. image:: images/single-filter.png |
| 253 | 250 |
| 254 ----- | 251 ----- |
| 255 | 252 |
| 256 **Example 2. Using multiple filters** | 253 **Example 2. Using multiple filters** |
| 257 | 254 |
| 258 Now suppose one needs to extract reads that (1) have mapping quality of at least 20, (2) contain at least 1 mismatch, and (3) are mapping onto forward strand only. | 255 Now suppose one needs to extract reads that (1) have mapping quality of at least 20, (2) contain at least 1 mismatch, and (3) are mapping onto forward strand only. |
| 259 To do so we will use three filters as shown below (multiple filters are added to the interface by clicking on the **Add new Filter** button): | 256 To do so we will use three filters as shown below (multiple filters are added to the interface by clicking on the **Add new Filter** button): |
| 260 | 257 |
| 261 .. image:: ${static_path}/images/multiple-filters.png | 258 .. image:: images/multiple-filters.png |
| 262 | 259 |
| 263 In this case (you can see that the three filters are grouped within a single Condition - **Condition 1**) the filter too use logical **AND** to perform filtering. | 260 In this case (you can see that the three filters are grouped within a single Condition - **Condition 1**) the filter too use logical **AND** to perform filtering. |
| 264 In other words only reads that (1) have mapping quality of at least 20 **AND** (2) contain at least 1 mismatch **AND** are mapping onto forward strand will be returned in this example. | 261 In other words only reads that (1) have mapping quality of at least 20 **AND** (2) contain at least 1 mismatch **AND** are mapping onto forward strand will be returned in this example. |
| 265 | 262 |
| 266 ----- | 263 ----- |
| 269 | 266 |
| 270 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*) | 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*) |
| 271 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*. | 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*. |
| 272 The following screenshot expalins how this can be done: | 269 The following screenshot expalins how this can be done: |
| 273 | 270 |
| 274 .. image:: ${static_path}/images/complex-filters.png | 271 .. image:: images/complex-filters.png |
| 275 | 272 |
| 276 ----- | 273 ----- |
| 277 | 274 |
| 278 **Example 4. Even more complex filtering with Rules** | 275 **Example 4. Even more complex filtering with Rules** |
| 279 | 276 |
| 283 | 280 |
| 284 !(1) & (2 | 3) | 281 !(1) & (2 | 3) |
| 285 | 282 |
| 286 Here, numbers 1, 2, and 3 represent conditions. The following screenshot illustrates how to do this in Galaxy: | 283 Here, numbers 1, 2, and 3 represent conditions. The following screenshot illustrates how to do this in Galaxy: |
| 287 | 284 |
| 288 .. image:: ${static_path}/images/rule.png | 285 .. image:: images/rule.png |
| 289 | 286 |
| 290 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. | 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. |
| 291 Here numbers correspond to numbers of conditions as they are shown in the interface. E.g., 1 corresponds to condition 1, 2 to condition 2 and so on... In human language this means:: | 288 Here numbers correspond to numbers of conditions as they are shown in the interface. E.g., 1 corresponds to condition 1, 2 to condition 2 and so on... In human language this means:: |
| 292 | 289 |
| 293 NOT condition 1 AND (condition 2 OR condition 3) | 290 NOT condition 1 AND (condition 2 OR condition 3) |
| 310 "tag":"NM:>0", | 307 "tag":"NM:>0", |
| 311 "isReverseStrand":"true" | 308 "isReverseStrand":"true" |
| 312 } | 309 } |
| 313 ] | 310 ] |
| 314 } | 311 } |
| 315 | 312 |
| 316 | |
| 317 | 313 |
| 318 ----- | 314 ----- |
| 319 | 315 |
| 320 **More information** | 316 **More information** |
| 321 | 317 |
