Previous changeset 4:3213c223678c (2017-01-18) Next changeset 6:82658c080fd0 (2018-06-05) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit 53f2eeca99efda354323295a0ebfb5e7f21f2fd4 |
modified:
bamtools-filter.xml |
added:
test-data/mm10_1.bam test-data/mm10_2.bam test-data/mm10_out_1.bam test-data/mm10_out_2.bam |
b |
diff -r 3213c223678c -r bd735cae4ce6 bamtools-filter.xml --- a/bamtools-filter.xml Wed Jan 18 11:47:29 2017 -0500 +++ b/bamtools-filter.xml Thu May 25 11:49:34 2017 -0400 |
[ |
b'@@ -1,322 +1,299 @@\n-<tool id="bamFilter" name="Filter" version="2.4.0">\r\n- <description>BAM datasets on a variety of attributes</description>\r\n- <requirements>\r\n- <requirement type="package" version="2.4.0">bamtools</requirement>\r\n- </requirements>\r\n- <command>\r\n- <![CDATA[\r\n- cat $script_file > $out_file2;\r\n- #for $bam_count, $input_bam in enumerate( $input_bams ):\r\n- ln -s "${input_bam}" "localbam_${bam_count}.bam" &&\r\n- ln -s "${input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" &&\r\n- #end for\r\n- bamtools\r\n- filter\r\n- -script $script_file\r\n- #for $bam_count, $input_bam in enumerate( $input_bams ):\r\n- -in "localbam_${bam_count}.bam"\r\n- #end for\r\n- -out $out_file1\r\n- ]]>\r\n- </command>\r\n- <configfiles>\r\n- <configfile name="script_file">\r\n- ##Sets up a json configfile for bamtools filter\r\n- ##If there is more than one condition prints brackets and "filters:"\r\n- #if len( $conditions ) > 1\r\n- {\r\n- "filters":\r\n- [\r\n- #end if\r\n- #for $i, $c in enumerate( $conditions, start=1 )\r\n- { "id": "$i",\r\n- #for $j, $s in enumerate( $c.filters, start=1 )\r\n- ##The if below takes care of the comma at the end of last condition within group\r\n- #if $j != len( $c.filters)\r\n- "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}",\r\n- #else\r\n- "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}"\r\n- #end if\r\n- #end for\r\n- ##The if below takes care of the comma at the end of last condition within group\r\n- #if $i != len( $conditions )\r\n- },\r\n- #else\r\n- }\r\n- #end if\r\n- #end for\r\n- #if len( $conditions ) > 1\r\n- #if str( $rule_configuration.rules_selector ) == "True":\r\n- ],\r\n- "rule" : "${rule_configuration.rules}"\r\n- #else\r\n- ]\r\n- #end if\r\n- }\r\n- #end if\r\n- </configfile>\r\n- </configfiles>\r\n- <inputs>\r\n- <param name="input_bams" type="data" format="bam" label="BAM dataset(s) to filter" min="1" multiple="True"/>\r\n- <repeat name="conditions" title="Condition" min="1">\r\n- <repeat name="filters" title="Filter" min="1">\r\n- <conditional name="bam_property">\r\n- <param name="bam_property_selector" type="select" label="Select BAM property to filter on">\r\n- <option value="alignmentFlag"/>\r\n- <option value="cigar"/>\r\n- <option value="insertSize"/>\r\n- <option value="isDuplicate"/>\r\n- <option value="isFailedQC"/>\r\n- <option value="isFirstMate"/>\r\n- <option value="isMapped"/>\r\n- <option value="isMateMapped"/>\r\n- <option value="isMateReverseStrand"/>\r\n- <option value="isPaired"/>\r\n- <option value="isPrimaryAlignment"/>\r\n- <option value="isProperPair"/>\r\n- <option value="isReverseStrand"/>\r\n- <option value="isSecondMate"/>\r\n- <option selected="True" value="mapQuality"/>\r\n- <option value="matePosition"/>\r\n- <option value="mateReference"/>\r\n- <option value="name"/>\r\n- <option value="po'..b'tiple BAM files. To filter on multiple BAMs just add them by clicking **Add new BAM dataset(s) to filter**\n+\n+*Conditions and Filters*\n+\n+Conditions for filtering BAM files can be arranged in **Groups and Filters**. While it can be confusing at first this is what gives ultimate power to this tools. So try to look at the examples we are supplying below.\n+\n+-----\n+\n+**Example 1. Using a single filter**\n+\n+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).\n+For example, for retaining reads with mapping quality of at least 20 one would set the tool interface as shown below:\n+\n+.. image:: single-filter.png\n+\n+-----\n+\n+**Example 2. Using multiple filters**\n+\n+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.\n+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):\n+\n+.. image:: multiple-filters.png\n+\n+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.\n+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.\n+\n+-----\n+\n+**Example 3. Complex filtering with multiple conditions**\n+\n+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*)\n+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*.\n+The following screenshot expalins how this can be done:\n+\n+.. image:: complex-filters.png\n+\n+-----\n+\n+**Example 4. Even more complex filtering with Rules**\n+\n+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.\n+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\n+filtering will look like this::\n+\n+ !(1) & (2 | 3)\n+\n+Here, numbers 1, 2, and 3 represent conditions. The following screenshot illustrates how to do this in Galaxy:\n+\n+.. image:: rule.png\n+\n+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.\n+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::\n+\n+ NOT condition 1 AND (condition 2 OR condition 3)\n+\n+-----\n+\n+**JSON script file**\n+\n+This tool produces two outputs. One of the them is a BAM file containing filtered reads. The other is a JSONified script. It can help you to see how your instructions are sent to BAMTools.\n+For instance, the example 4 looks like this in the JSON form::\n+\n+ {\n+ "filters":\n+ [\n+ { "id": "1",\n+ "tag":"NM:=0",\n+ "isReverseStrand":"false"\n+ },\n+ { "id": "2",\n+ "tag":"NM:>0",\n+ "isReverseStrand":"true"\n+ }\n+ ]\n+ }\n+\n+\n+-----\n+\n+**More information**\n+\n+.. class:: infomark\n+\n+Additional information about BAMtools can be found at https://github.com/pezmaster31/bamtools/wiki\n+\n+\n+ </help>\n+ <citations>\n+ <citation type="doi">10.1093/bioinformatics/btr174</citation>\n+ </citations>\n+</tool>\n' |
b |
diff -r 3213c223678c -r bd735cae4ce6 test-data/mm10_1.bam |
b |
Binary file test-data/mm10_1.bam has changed |
b |
diff -r 3213c223678c -r bd735cae4ce6 test-data/mm10_2.bam |
b |
Binary file test-data/mm10_2.bam has changed |
b |
diff -r 3213c223678c -r bd735cae4ce6 test-data/mm10_out_1.bam |
b |
Binary file test-data/mm10_out_1.bam has changed |
b |
diff -r 3213c223678c -r bd735cae4ce6 test-data/mm10_out_2.bam |
b |
Binary file test-data/mm10_out_2.bam has changed |