annotate bamtools-filter.xml @ 2:2098a49ddf66 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
author devteam
date Wed, 11 Nov 2015 12:33:46 -0500
parents d64c7e752f4d
children 29ba2103739c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
1 <tool id="bamFilter" name="Filter" version="0.0.2">
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
2 <description>BAM datasets on a variety of attributes</description>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
3 <requirements>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
4 <requirement type="package" version="2.3.0_2d7685d2ae">bamtools</requirement>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
5 </requirements>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
6 <command>
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
7 cat $script_file > $out_file2;
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
8
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
9 #for $bam_count, $input_bam in enumerate( $input_bams ):
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
10 ln -s "${input_bam}" "localbam_${bam_count}.bam" &amp;&amp;
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
11 ln -s "${input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" &amp;&amp;
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
12 #end for
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
13
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
14 bamtools
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
15 filter
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
16 -script $script_file
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
17
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
18 #for $bam_count, $input_bam in enumerate( $input_bams ):
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
19 -in "localbam_${bam_count}.bam"
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
20 #end for
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
21 -out $out_file1
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
22 </command>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
23 <inputs>
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
24 <param name="input_bams" type="data" format="bam" label="BAM dataset(s) to filter" min="1" multiple="True"/>
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
25 <repeat name="conditions" title="Condition" min="1">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
26 <repeat name="filters" title="Filter" min="1">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
27 <conditional name="bam_property">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
28 <param name="bam_property_selector" type="select" label="Select BAM property to filter on">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
29 <option value="alignmentFlag"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
30 <option value="cigar"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
31 <option value="insertSize"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
32 <option value="isDuplicate"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
33 <option value="isFailedQC"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
34 <option value="isFirstMate"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
35 <option value="isMapped"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
36 <option value="isMateMapped"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
37 <option value="isMateReverseStrand"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
38 <option value="isPaired"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
39 <option value="isPrimaryAlignment"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
40 <option value="isProperPair"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
41 <option value="isReverseStrand"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
42 <option value="isSecondMate"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
43 <option selected="True" value="mapQuality"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
44 <option value="matePosition"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
45 <option value="mateReference"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
46 <option value="name"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
47 <option value="position"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
48 <option value="queryBases"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
49 <option value="reference"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
50 <option value="tag"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
51 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
52 <!-- would be fanstastic to have AND and OR constructs in when statements -->
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
53 <when value="alignmentFlag">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
54 <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"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
55 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
56 <when value="cigar">
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
57 <param name="bam_property_value" type="text" value="101M" label="Filter on this CIGAR string" help="Default (101M) is for 101 continuously matched bases"/>
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
58 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
59 <when value="insertSize">
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
60 <param name="bam_property_value" type="text" 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;">
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
61 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
62 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
63 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
64 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
65 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
66 <when value="isDuplicate">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
67 <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" />
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
68 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
69 <when value="isFailedQC">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
70 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select reads failing QC" help="Checked = Failed QC, Empty = Passed QC"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
71 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
72 <when value="isFirstMate">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
73 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select first mate in a read pair" help="Checked = is first mate, Empty = is NOT first mate"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
74 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
75 <when value="isMapped">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
76 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Selected mapped reads" help="Checked = Mapped, Empty = NOT mapped"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
77 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
78 <when value="isMateMapped">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
79 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select reads with mapped mate" help="Checked = Mate IS mapped Empty = Mate is NOT mapped"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
80 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
81 <when value="isMateReverseStrand">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
82 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select reads with mate on the reverse strand" help="Checked = Mate IS on reverse strand, Empty = Mate is NOT on the reverse strand"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
83 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
84 <when value="isPaired">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
85 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select paired reads" help="Checked = Read IS paired, Empty = Read is NOT paired"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
86 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
87 <when value="isPrimaryAlignment">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
88 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select BAM records for primary alignments" help="Checked = Alignment IS primary, Empty = Alignment is NOT primary"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
89 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
90 <when value="isProperPair">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
91 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select properly paired reads" help="Checked = Read IS in proper pair, Empty = Read is NOT in the proper pair"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
92 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
93 <when value="isReverseStrand">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
94 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select reads in the reverse strand only" help="Checked = Read IS on the reverse strand, Empty = Read is NOT on the reverse strand"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
95 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
96 <when value="isSecondMate">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
97 <param name="bam_property_value" type="boolean" truevalue="true" falsevalue="false" label="Select second mate in a read pair" help="Checked = Read IS second mate, Empty = Read is NOT second mate"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
98 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
99 <when value="mapQuality">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
100 <param name="bam_property_value" type="text" value="20" label="Filter on read mapping quality (phred scale)" help="You can use &gt;, &lt;, =, and ! (not) in your expression. E.g., to select reads with mapping quality of at least 30 use &quot;>=30&quot;">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
101 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
102 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
103 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
104 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
105 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
106 <when value="matePosition">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
107 <param name="bam_property_value" type="text" value="1000000" label="Filter on the position of the mate" help="You can use &gt;, &lt;, =, and ! (not) in your expression. E.g., to select reads with mate (second end) mapping after position 1,000,000 use &quot;&gt;1000000&quot;">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
108 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
109 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
110 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
111 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
112 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
113 <when value="mateReference">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
114 <param name="bam_property_value" type="text" value="chr22" label="Filter on reference name for the mate" help="You can use = and ! (not) in your expression. E.g., to select reads with mates mapping to chrM use &quot;chr22&quot;">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
115 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
116 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
117 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
118 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
119 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
120 <when value="name">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
121 <param name="bam_property_value" type="text" label="Filter on read name" help="You can use = and ! (not) in your expression.">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
122 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
123 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
124 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
125 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
126 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
127 <when value="position">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
128 <param name="bam_property_value" type="text" value="500000" label="Filter on the position of the read" help="You can use &gt;, &lt;, =, and ! (not) in your expression. E.g., to select reads mapping after position 5,000 use &quot;&gt;5000&quot;">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
129 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
130 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
131 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
132 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
133 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
134 <when value="queryBases">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
135 <param name="bam_property_value" type="text" value="ttagggttagg" label="Filter on a sequence motif" help="You can use ! (not) in your expression">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
136 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
137 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
138 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
139 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
140 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
141 <when value="reference">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
142 <param name="bam_property_value" type="text" value="chr22" label="Filter on the reference name for the read" help="You can use ! (not) in your expression">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
143 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
144 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value="!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
145 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
146 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
147 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
148 <when value="tag">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
149 <param name="bam_property_value" type="text" value="NM:&gt;1" label="Filter on a particular tag" help="You can use &gt;, &lt;, =, and ! (not).
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
150 Tag name and its value must be separated by &quot;:&quot;. E.g., to obtain reads with at least one mismatch use &quot;NM:&gt;1&quot;">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
151 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
152 <valid initial="string.letters,string.digits"><add value="&gt;"/><add value="&lt;"/><add value=":!="/></valid>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
153 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
154 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
155 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
156 </conditional>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
157 </repeat>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
158 </repeat>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
159 <conditional name="rule_configuration">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
160 <param name="rules_selector" type="boolean" truevalue="true" falsevalue="false" label="Would you like to set rules?" help="Allows complex logical constructs. See Example 4 below." />
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
161 <when value="true">
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
162 <param name="rules" type="text" label="Enter rules here" help="This option can only be used with at least two conditions. Read help below (Example 4) to understand how it works." >
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
163 <sanitizer invalid_char="">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
164 <valid initial="string.printable"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
165 </sanitizer>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
166 </param>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
167 </when>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
168 </conditional>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
169 </inputs>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
170
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
171 <configfiles>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
172 <configfile name="script_file">
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
173 ##Sets up a json configfile for bamtools filter
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
174 ##If there is more than one condition prints brackets and "filters:"
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
175 #if len( $conditions ) > 1
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
176 {
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
177 "filters":
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
178 [
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
179 #end if
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
180 #for $i, $c in enumerate( $conditions, start=1 )
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
181 { "id": "$i",
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
182 #for $j, $s in enumerate( $c.filters, start=1 )
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
183 ##The if below takes care of the comma at the end of last condition within group
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
184 #if $j != len( $c.filters)
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
185 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}",
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
186 #else
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
187 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}"
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
188 #end if
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
189 #end for
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
190 ##The if below takes care of the comma at the end of last condition within group
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
191 #if $i != len( $conditions )
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
192 },
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
193 #else
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
194 }
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
195 #end if
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
196 #end for
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
197 #if len( $conditions ) > 1
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
198 #if str( $rule_configuration.rules_selector ) == "True":
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
199 ],
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
200 "rule" : "${rule_configuration.rules}"
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
201 #else
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
202 ]
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
203 #end if
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
204 }
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
205 #end if
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
206 </configfile>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
207 </configfiles>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
208
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
209 <outputs>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
210 <data format="txt" name="out_file2" />
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
211 <data format="bam" name="out_file1" />
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
212 </outputs>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
213 <tests>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
214 <test>
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
215 <param name="input_bams" ftype="bam" value="bamtools-input1.bam"/>
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
216 <param name="bam_property_selector" value="mapQuality"/>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
217 <param name="bam_property_value" value=">20"/>
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
218 <output name="out_file1" file="bamtools-test1.bam" ftype="bam"/>
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
219 </test>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
220 </tests>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
221 <help>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
222 **What is does**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
223
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
224 BAMTools filter is a very powerful utility to perform complex filtering of BAM files. It is based on BAMtools suite of tools by Derek Barnett (https://github.com/pezmaster31/bamtools).
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
225
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
226 -----
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
227
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
228 **How it works**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
229
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
230 The tool use logic relies on the three concepts: (1) input BAM, (2) groups, and (3) filters.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
231
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
232 *Input BAM(s)*
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
233
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
234 The input BAM is self-explanatory. This is the dataset you will be filtering. The tool can accept just one or multiple BAM files. To filter on multiple BAMs just add them by clicking **Add new BAM dataset(s) to filter**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
235
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
236 *Conditions and Filters*
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
237
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
238 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.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
239
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
240 -----
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
241
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
242 **Example 1. Using a single filter**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
243
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
244 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).
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
245 For example, for retaining reads with mapping quality of at least 20 one would set the tool interface as shown below:
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
246
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
247 .. image:: single-filter.png
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
248
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
249 -----
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
250
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
251 **Example 2. Using multiple filters**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
252
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
253 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.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
254 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):
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
255
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
256 .. image:: multiple-filters.png
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
257
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
258 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.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
259 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.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
260
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
261 -----
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
262
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
263 **Example 3. Complex filtering with multiple conditions**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
264
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
265 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*)
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
266 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*.
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
267 The following screenshot expalins how this can be done:
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
268
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
269 .. image:: complex-filters.png
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
270
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
271 -----
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
272
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
273 **Example 4. Even more complex filtering with Rules**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
274
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
275 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.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
276 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
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
277 filtering will look like this::
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
278
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
279 !(1) &amp; (2 | 3)
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
280
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
281 Here, numbers 1, 2, and 3 represent conditions. The following screenshot illustrates how to do this in Galaxy:
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
282
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
283 .. image:: rule.png
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
284
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
285 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.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
286 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::
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
287
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
288 NOT condition 1 AND (condition 2 OR condition 3)
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
289
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
290 -----
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
291
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
292 **JSON script file**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
293
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
294 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.
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
295 For instance, the example 4 looks like this in the JSON form::
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
296
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
297 {
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
298 "filters":
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
299 [
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
300 { "id": "1",
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
301 "tag":"NM:=0",
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
302 "isReverseStrand":"false"
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
303 },
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
304 { "id": "2",
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
305 "tag":"NM:>0",
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
306 "isReverseStrand":"true"
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
307 }
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
308 ]
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
309 }
2
2098a49ddf66 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit a1517c9d22029095120643bbe2c8fa53754dd2b7
devteam
parents: 1
diff changeset
310
0
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
311
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
312 -----
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
313
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
314 **More information**
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
315
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
316 .. class:: infomark
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
317
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
318 Additional information about BAMtools can be found at https://github.com/pezmaster31/bamtools/wiki
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
319
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
320
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
321 </help>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
322 <citations>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
323 <citation type="doi">10.1093/bioinformatics/btr174</citation>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
324 </citations>
9315b97e25a4 Uploaded
devteam
parents:
diff changeset
325 </tool>