Repository 'bamtools_filter'
hg clone https://toolshed.g2.bx.psu.edu/repos/devteam/bamtools_filter

Changeset 0:9315b97e25a4 (2015-01-09)
Next changeset 1:d64c7e752f4d (2015-03-09)
Commit message:
Uploaded
added:
bamtools-filter.xml
images/complex-filters.png
images/multiple-filters.png
images/rule.png
images/single-filter.png
shed_upload.tar.gz
test-data/bamtools-input1.bam
test-data/bamtools-test1.bam
tool_dependencies.xml
b
diff -r 000000000000 -r 9315b97e25a4 bamtools-filter.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bamtools-filter.xml Fri Jan 09 11:48:18 2015 -0500
[
b'@@ -0,0 +1,331 @@\n+<tool id="bamFilter" name="Filter" version="0.0.1">\r\n+  <description>BAM datasets on a variety of attributes</description>\r\n+  <requirements>\r\n+    <requirement type="package" version="2.3.0_2d7685d2ae">bamtools</requirement>\r\n+  </requirements>\r\n+  <command>\r\n+\r\n+    cat $script_file > $out_file2;\r\n+    \r\n+    #for $bam_count, $input_bam in enumerate( $input_bams ):\r\n+        ln -s "${input_bam.input_bam}" "localbam_${bam_count}.bam" &amp;&amp;\r\n+        ln -s "${input_bam.input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" &amp;&amp;\r\n+    #end for\r\n+    \r\n+    bamtools\r\n+    filter\r\n+    -script $script_file\r\n+    \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+\r\n+  <inputs>\r\n+    <repeat name="input_bams" title="BAM dataset(s) to filter" min="1">\r\n+          <param name="input_bam" type="data" format="bam" label="BAM dataset" />\r\n+    </repeat>\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="position"/>\r\n+            <option value="queryBases"/>\r\n+            <option value="reference"/>\r\n+            <option value="tag"/>\r\n+          </param>\r\n+          <!-- would be fanstastic to have AND and OR constructs in when statements -->\r\n+          <when value="alignmentFlag">\r\n+            <param name="bam_property_value" type="integer" value="3" label="Filter on this alignment flag" help="Default (3) is for a paired read mapped in a proper pair"/>\r\n+          </when>\r\n+          <when value="cigar">\r\n+            <param name="bam_property_value" type="text" size="10" value="101M" label="Filter on this CIGAR string" help="Default (101M) is for 101 continuously matched bases"/>\r\n+          </when>\r\n+          <when value="insertSize">\r\n+            <param name="bam_property_value" type="text" size="10" value=">=250" label="Filter on inster size" help="You can use &gt;, &lt;, =, and ! (not) in your expression. E.g., to select pairs with inster size above 250 nt use &quot;>=250&quot;">\r\n+              <sanitizer invalid_char="">\r\n+                <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>\r\n+              </sanitizer>\r\n+            </param>\r\n+          </when>\r\n+          <when value="isDuplicate">\r\n+            <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select reads makwed as duplicates" help="Checked = Read IS Duplicate, Empty = Read is NOT Duplicate" />\r\n+          </when>\r\n+          <when value="isFailedQC">\r\n+            <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select reads failing QC" help="Checked = Failed QC, Empty = Passed QC"/>\r\n+          </when>\r\n+          <when value="isFirstMate">\r\n+            <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="f'..b'e 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.\r\n+\r\n+-----\r\n+\r\n+**Example 1. Using a single filter**\r\n+\r\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).\r\n+For example, for retaining reads with mapping quality of at least 20 one would set the tool interface as shown below:\r\n+\r\n+.. image:: ${static_path}/images/simple-filter.png\r\n+\r\n+-----\r\n+\r\n+**Example 2. Using multiple filters**\r\n+\r\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.\r\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):\r\n+\r\n+.. image:: ${static_path}/images/multiple-filters.png\r\n+\r\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.\r\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.\r\n+\r\n+-----\r\n+\r\n+**Example 3. Complex filtering with multiple conditions**\r\n+\r\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*) \r\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*. \r\n+The following screenshot expalins how this can be done:\r\n+\r\n+.. image:: ${static_path}/images/complex-filters.png\r\n+\r\n+-----\r\n+\r\n+**Example 4. Even more complex filtering with Rules**\r\n+\r\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.\r\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\r\n+filtering will look like this::\r\n+\r\n+ !(1) &amp; (2 | 3)\r\n+ \r\n+Here, numbers 1, 2, and 3 represent conditions. The following screenshot illustrates how to do this in Galaxy:\r\n+\r\n+.. image:: ${static_path}/images/rule.png\r\n+\r\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.\r\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::\r\n+\r\n+ NOT condition 1 AND (condition 2 OR condition 3)\r\n+\r\n+-----\r\n+\r\n+**JSON script file**\r\n+\r\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.\r\n+For instance, the example 4 looks like this in the JSON form::\r\n+\r\n+       {\r\n+        "filters":\r\n+        [\r\n+          { "id": "1",\r\n+            "tag":"NM:=0",\r\n+            "isReverseStrand":"false"\r\n+          },\r\n+          { "id": "2",\r\n+            "tag":"NM:>0",\r\n+            "isReverseStrand":"true"\r\n+          }\r\n+        ]\r\n+      }\r\n+    \r\n+    \r\n+\r\n+-----\r\n+\r\n+**More information**\r\n+\r\n+.. class:: infomark\r\n+\r\n+Additional information about BAMtools can be found at https://github.com/pezmaster31/bamtools/wiki\r\n+\r\n+\r\n+</help>\r\n+  <citations>\r\n+    <citation type="doi">10.1093/bioinformatics/btr174</citation>\r\n+  </citations>\r\n+</tool>\r\n'
b
diff -r 000000000000 -r 9315b97e25a4 images/complex-filters.png
b
Binary file images/complex-filters.png has changed
b
diff -r 000000000000 -r 9315b97e25a4 images/multiple-filters.png
b
Binary file images/multiple-filters.png has changed
b
diff -r 000000000000 -r 9315b97e25a4 images/rule.png
b
Binary file images/rule.png has changed
b
diff -r 000000000000 -r 9315b97e25a4 images/single-filter.png
b
Binary file images/single-filter.png has changed
b
diff -r 000000000000 -r 9315b97e25a4 shed_upload.tar.gz
b
Binary file shed_upload.tar.gz has changed
b
diff -r 000000000000 -r 9315b97e25a4 test-data/bamtools-input1.bam
b
Binary file test-data/bamtools-input1.bam has changed
b
diff -r 000000000000 -r 9315b97e25a4 test-data/bamtools-test1.bam
b
Binary file test-data/bamtools-test1.bam has changed
b
diff -r 000000000000 -r 9315b97e25a4 tool_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml Fri Jan 09 11:48:18 2015 -0500
b
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <package name="bamtools" version="2.3.0_2d7685d2ae">
+        <repository changeset_revision="4e49af060657" name="package_bamtools_2_3_0_2d7685d2ae" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+</tool_dependency>