Repository 'bamtools_split_tag'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/bamtools_split_tag

Changeset 0:c9fbbe6f5fc8 (2021-11-27)
Next changeset 1:45f0ce0a9f63 (2023-01-11)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/bamtools/bamtools_split commit 1cacd14cfb2429fefa91fdd05c82d2e36d23283a"
added:
bamtools_split_tag.xml
macros.xml
test-data/bamtools-input-paired.bam
test-data/bamtools-input-tags.bam
test-data/bamtools-input1.bam
test-data/bamtools-input2.bam
test-data/bamtools-split-test1.bam
test-data/bamtools_input2.chr1
test-data/bamtools_input_tags.TAG_XG_N.bam
test-data/bamtools_input_tags.TAG_XG_V.bam
test-data/split_bam.MAPPED.bam
test-data/split_bam.PAIRED_END.bam
test-data/split_bam.SINGLE_END.bam
test-data/split_bam.UNMAPPED.bam
b
diff -r 000000000000 -r c9fbbe6f5fc8 bamtools_split_tag.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bamtools_split_tag.xml Sat Nov 27 10:02:45 2021 +0000
[
@@ -0,0 +1,71 @@
+<tool id="bamtools_split_tag" name="Split BAM by Tag" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
+    <description>into dataset list collection</description>
+    <macros>
+          <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <command>
+        <![CDATA[
+            #import re
+            #set $name = 'split_bam' + $re.sub('\W','_',$re.sub('\.bam$','',$input_bam.name))
+            ln -s '${input_bam}' 'localbam.bam' &&
+            ln -s '${input_bam.metadata.bam_index}' 'localbam.bam.bai' &&
+            bamtools split -tag $tag_name
+            -in 'localbam.bam'
+            -stub '$name'
+        ]]>
+    </command>
+    <inputs>
+        <param name="input_bam" type="data" format="bam" label="BAM dataset to split by tag value"/>
+        <param name="tag_name" type="text" value="NM" label="Enter tag name here" help="For example, to split on NM tag enter &quot;NM&quot;"/>
+    </inputs>
+    <outputs>
+        <collection name="output_bams" type="list" label="${input_bam.name} Split List">
+            <discover_datasets pattern="split_bam(?P&lt;designation&gt;.+)\.bam" ext="bam" visible="false"/>
+        </collection>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input_bam" ftype="bam" value="bamtools-input-tags.bam"/>
+            <param name="tag_name" value="XG"/>
+            <output_collection name="output_bams"  type="list">
+                <element name="bamtools_input_tags.TAG_XG_V"  file="bamtools_input_tags.TAG_XG_V.bam" compare="sim_size" delta="500" />
+            </output_collection>
+        </test>
+
+    </tests>
+    <help>
+**What is does**
+
+BAMTools split is a utility for splitting BAM files. It is based on BAMtools suite of tools by Derek Barnett (https://github.com/pezmaster31/bamtools).
+
+-----
+
+.. class:: warningmark
+
+**DANGER: Multiple Outputs**
+
+As described below, splitting a BAM dataset(s) on tag value can produce very large numbers of outputs. Read below and know what you are doing.
+
+-----
+
+**How it works**
+
+Split alignments by tag name into a dataset list collection.
+
+This can generate a huge number of output datasets depending on the number of distinct values of the TAG.
+
+
+-----
+
+.. class:: infomark
+
+**More information**
+
+Additional information about BAMtools can be found at https://github.com/pezmaster31/bamtools/wiki
+
+    </help>
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/btr174</citation>
+    </citations>
+</tool>
b
diff -r 000000000000 -r c9fbbe6f5fc8 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Sat Nov 27 10:02:45 2021 +0000
b
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<macros>
+    <token name="@TOOL_VERSION@">2.5.1</token>
+    <token name="@VERSION_SUFFIX@">0</token>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@TOOL_VERSION@">bamtools</requirement>
+            <requirement type="package" version="1.4.1">samtools</requirement>
+        </requirements>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1093/bioinformatics/btr174</citation>
+        </citations>
+    </xml>
+</macros>
\ No newline at end of file
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools-input-paired.bam
b
Binary file test-data/bamtools-input-paired.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools-input-tags.bam
b
Binary file test-data/bamtools-input-tags.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools-input1.bam
b
Binary file test-data/bamtools-input1.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools-input2.bam
b
Binary file test-data/bamtools-input2.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools-split-test1.bam
b
Binary file test-data/bamtools-split-test1.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools_input2.chr1
b
Binary file test-data/bamtools_input2.chr1 has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools_input_tags.TAG_XG_N.bam
b
Binary file test-data/bamtools_input_tags.TAG_XG_N.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/bamtools_input_tags.TAG_XG_V.bam
b
Binary file test-data/bamtools_input_tags.TAG_XG_V.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/split_bam.MAPPED.bam
b
Binary file test-data/split_bam.MAPPED.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/split_bam.PAIRED_END.bam
b
Binary file test-data/split_bam.PAIRED_END.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/split_bam.SINGLE_END.bam
b
Binary file test-data/split_bam.SINGLE_END.bam has changed
b
diff -r 000000000000 -r c9fbbe6f5fc8 test-data/split_bam.UNMAPPED.bam
b
Binary file test-data/split_bam.UNMAPPED.bam has changed