0
|
1 <tool id="bamSplit" name="Split" version="2.4.0">
|
|
2 <description>BAM datasets on variety of attributes</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="2.4.0">bamtools</requirement>
|
|
5 </requirements>
|
|
6 <command>
|
|
7 <![CDATA[
|
|
8 echo "BAM" > $report &&
|
|
9 #for $bam_count, $input_bam in enumerate( $input_bams ):
|
|
10 ln -s "${input_bam}" "localbam_${bam_count}.bam" &&
|
|
11 ln -s "${input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" &&
|
|
12 #end for
|
|
13 bamtools
|
|
14 split
|
|
15 #if str ( $analysis_type.analysis_type_selector ) == "-tag" :
|
|
16 ${analysis_type.analysis_type_selector} "${analysis_type.tag_name}"
|
|
17 #else
|
|
18 ${analysis_type.analysis_type_selector}
|
|
19 #end if
|
|
20 -stub split_bam
|
|
21 #for $bam_count, $input_bam in enumerate( $input_bams ):
|
|
22 -in "localbam_${bam_count}.bam"
|
|
23 #end for
|
|
24 ]]>
|
|
25 </command>
|
|
26 <inputs>
|
|
27 <param name="input_bams" type="data" format="bam" label="BAM dataset(s) to filter" min="1" multiple="True"/>
|
|
28 <conditional name="analysis_type">
|
|
29 <param name="analysis_type_selector" type="select" label="Split BAM dataset(s) by" help="See help below for explanation of each option">
|
|
30 <option value="-mapped">Mapping status (-mapped)</option>
|
|
31 <option value="-paired">Pairing status (-paired)</option>
|
|
32 <option value="-reference">Reference name (-reference)</option>
|
|
33 <option value="-tag">Specific tag (-tag)</option>
|
|
34 </param>
|
|
35 <when value="-mapped" />
|
|
36 <when value="-paired" />
|
|
37 <when value="-reference" />
|
|
38 <when value="-tag">
|
|
39 <param name="tag_name" type="text" value="NM" label="Enter tag name here" help="For example, to split on NM tag enter "NM""/>
|
|
40 </when>
|
|
41 </conditional>
|
|
42 </inputs>
|
|
43 <outputs>
|
|
44 <data format="txt" name="report" label="BAMSplitter Run" hidden="true">
|
|
45 <discover_datasets pattern="split_bam\.(?P<designation>.+)\.bam" ext="bam" visible="true"/>
|
|
46 </data>
|
|
47 </outputs>
|
|
48 <tests>
|
|
49 <test>
|
|
50 <param name="input_bams" ftype="bam" value="bamtools-input1.bam"/>
|
|
51 <param name="analysis_type_selector" value="-mapped"/>
|
|
52 <output name="report">
|
|
53 <assert_contents>
|
|
54 <has_line line="BAM" />
|
|
55 </assert_contents>
|
|
56 <discovered_dataset designation="MAPPED" file="bamtools-split-test1.bam" ftype="bam"/>
|
|
57 </output>
|
|
58 </test>
|
|
59 </tests>
|
|
60 <help>
|
|
61 **What is does**
|
|
62
|
|
63 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).
|
|
64
|
|
65 -----
|
|
66
|
|
67 .. class:: warningmark
|
|
68
|
|
69 **DANGER: Multiple Outputs**
|
|
70
|
|
71 As described below, splitting a BAM dataset(s) on reference name or a tag value can produce very large numbers of outputs. Read below and know what you are doing.
|
|
72
|
|
73 -----
|
|
74
|
|
75 **How it works**
|
|
76
|
|
77 The following options can be specified via "**Split BAM dataset(s) by**" dropdown::
|
|
78
|
|
79 Mapping status (-mapped) split mapped/unmapped and generate two output files
|
|
80 named (MAPPED) and (UNMAPPED) containing mapped and unmapped
|
|
81 reads, respectively.
|
|
82
|
|
83 Pairing status (-paired) split single-end/paired-end alignments and generate two output files
|
|
84 named (SINGLE_END) and (PAIRED_END) containing paired and unpaired
|
|
85 reads, respectively.
|
|
86
|
|
87 Reference name (-reference) split alignments by reference name. In cases of unfinished genomes with
|
|
88 very large number of reference sequences (scaffolds) it can generate
|
|
89 thousands (if not millions) of output datasets.
|
|
90
|
|
91 Specific tag (-tag) split alignments based on all values of TAG encountered. Choosing this
|
|
92 option from the menu will allow you to enter the tag name. As was the
|
|
93 case with the reference splitting above, this option can produce very
|
|
94 large number of outputs if a tag has a large number of unique values.
|
|
95
|
|
96 -----
|
|
97
|
|
98 .. class:: infomark
|
|
99
|
|
100 **More information**
|
|
101
|
|
102 Additional information about BAMtools can be found at https://github.com/pezmaster31/bamtools/wiki
|
|
103
|
|
104 </help>
|
|
105 <citations>
|
|
106 <citation type="doi">10.1093/bioinformatics/btr174</citation>
|
|
107 </citations>
|
|
108 </tool>
|