Mercurial > repos > iuc > ngsutils_bam_filter
comparison bam_filter.xml @ 0:4e4e4093d65d draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ngsutils commit 09194687c74a424732f8b0c017cbb942aad89068
author | iuc |
---|---|
date | Wed, 11 Nov 2015 13:04:07 -0500 |
parents | |
children | 8187a729d9f4 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4e4e4093d65d |
---|---|
1 <tool id="ngsutils_bam_filter" name="BAM filter" version="@WRAPPER_VERSION@.0"> | |
2 <description>Removes reads from a BAM file based on criteria</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
6 <expand macro="requirements" /> | |
7 <expand macro="stdio" /> | |
8 <expand macro="version" /> | |
9 <command><![CDATA[ | |
10 ## If the tool is executed with no filtering option, | |
11 ## the default parameters simply copy over the input file | |
12 if grep -q "\w" ${parameters}; | |
13 then | |
14 $__tool_directory__/filter.py | |
15 $infile | |
16 $outfile | |
17 `cat ${parameters}`; | |
18 else | |
19 cp $infile $outfile; | |
20 fi | |
21 ]]> | |
22 </command> | |
23 <configfiles> | |
24 <configfile name="parameters"> | |
25 <![CDATA[ | |
26 #if $minlen: | |
27 -minlen $minlen | |
28 #end if | |
29 #if $maxlen | |
30 -maxlen $maxlen | |
31 #end if | |
32 $mapped | |
33 $unmapped | |
34 $properpair | |
35 $noproperpair | |
36 #if $mask: | |
37 -mask "${mask}" | |
38 #end if | |
39 #if int($uniq) > -1: | |
40 -uniq | |
41 #if int($uniq) > 0: | |
42 $uniq | |
43 #end if | |
44 #end if | |
45 $uniq_start | |
46 #if $mismatch: | |
47 -mismatch $mismatch | |
48 #end if | |
49 $nosecondary | |
50 $noqcfail | |
51 $nopcrdup | |
52 #if $excludebed: | |
53 -excludebed "${excludebed}" $ignore_strand | |
54 #end if | |
55 #if $includebed: | |
56 -includebed "${includebed}" $ignore_strand | |
57 #end if | |
58 #if $includeref: | |
59 -includeref "${includeref}" | |
60 #end if | |
61 #if $excluderef: | |
62 -excluderef "${excluderef}" | |
63 #end if | |
64 #if $maximum_mismatch_ratio | |
65 -maximum_mismatch_ratio $maximum_mismatch_ratio | |
66 #end if | |
67 ]]> | |
68 </configfile> | |
69 </configfiles> | |
70 <inputs> | |
71 <param name="infile" type="data" format="bam" label="Select BAM dataset" /> | |
72 <param argument="-minlen" type="integer" value="" optional="True" min="0" | |
73 label="Remove reads that are smaller than" | |
74 help="in bp"/> | |
75 <param argument="-maxlen" type="integer" value="" optional="True" min="0" | |
76 label="Remove reads that are larger than" | |
77 help="in bp"/> | |
78 <param argument="-mapped" truevalue="-mapped" type="boolean" falsevalue="" | |
79 label="Keep only mapped reads" | |
80 help="" /> | |
81 <param argument="-unmapped" truevalue="-unmapped" type="boolean" falsevalue="" | |
82 label="Keep only unmapped reads" | |
83 help="" /> | |
84 <param argument="-properpair" truevalue="-properpair" type="boolean" falsevalue="" | |
85 label="Keep only properly paired reads" | |
86 help="both mapped, correct orientation, flag set in BAM" /> | |
87 <param argument="-noproperpair" truevalue="-noproperpair" type="boolean" falsevalue="" | |
88 label="Discard properly paired reads" | |
89 help="" /> | |
90 <param argument="-mask" type="text" value="" optional="True" label="Remove reads that match the mask" | |
91 help="e.g. 0x400, 0x2" /> | |
92 | |
93 <param argument="-uniq" type="integer" value="-1" optional="True" min="-1" | |
94 label="Remove reads that have the same sequence" | |
95 help="up to the Nth nucleotide starting from the 5prime end. -1 means do not filter, 0 means check along the entire read, | |
96 10 would make filter reads that are unique over the first 10 nucleotides."/> | |
97 | |
98 <param argument="-uniq_start" truevalue="-uniq_start" type="boolean" falsevalue="" | |
99 label="Remove reads that start at the same position" | |
100 help="Use only for low-coverage samples" /> | |
101 | |
102 <param argument="-mismatch" type="integer" value="" optional="True" min="0" | |
103 label="Remove reads with that many mismatches" | |
104 help="Indels always counts as 1 regardless of length. Requires NM tag to be set."/> | |
105 | |
106 <param argument="-nosecondary" truevalue="-nosecondary" type="boolean" falsevalue="" | |
107 label="Remove secondary alignment reads" | |
108 help="Remove reads flagged with 0x100" /> | |
109 <param argument="-noqcfail" truevalue="-noqcfail" type="boolean" falsevalue="" | |
110 label="Remove reads that do not pass the quality control" | |
111 help="Remove reads flagged with 0x200" /> | |
112 <param argument="-nopcrdup" truevalue="-nopcrdup" type="boolean" falsevalue="" | |
113 label="Remove reads that are marked as PCR dupicates " | |
114 help="Remove reads flagged with 0x400" /> | |
115 | |
116 <param argument="-excludebed" type="data" optional="True" format="bed" label="Remove reads that are in any of the regions" /> | |
117 <param argument="-includebed" type="data" optional="True" format="bed" label="Remove reads that are NOT any of the regions" /> | |
118 <param name="ignore_strand" truevalue="nostrand" type="boolean" falsevalue="" | |
119 label="Strand information from BED file is ignored. Affects -excludebed and -includebed." | |
120 help="" /> | |
121 | |
122 <param argument="-includeref" type="text" value="" optional="True" label="Exclude reads NOT mapped to a reference" | |
123 help="" /> | |
124 <param argument="-excluderef" type="text" value="" optional="True" label="Exclude reads mapped to a particular reference" | |
125 help="e.g. chrM, or _dup chromosomes" /> | |
126 | |
127 <param argument="-maximum_mismatch_ratio" type="float" value="" optional="True" min="0.0" max="1.0" | |
128 label="Filter by maximum mismatch ratio" | |
129 help="fraction of length"/> | |
130 | |
131 </inputs> | |
132 <outputs> | |
133 <data format="bam" name="outfile" /> | |
134 </outputs> | |
135 <tests> | |
136 <test> | |
137 <param name="infile" ftype="bam" value="ngsutils_bam_filter_input1.bam"/> | |
138 <param name="minlen" value="100"/> | |
139 <param name="maximum_mismatch_ratio" value="0.02"/> | |
140 <output name="outfile" file="ngsutils_bam_filter_result1.bam" ftype="bam" /> | |
141 </test> | |
142 <test> | |
143 <param name="infile" ftype="bam" value="ngsutils_bam_filter_input1.bam"/> | |
144 <param name="minlen" value="250"/> | |
145 <param name="properpair" value="True"/> | |
146 <output name="outfile" file="ngsutils_bam_filter_result2.bam" ftype="bam" /> | |
147 </test> | |
148 <test> | |
149 <param name="infile" ftype="bam" value="ngsutils_bam_filter_input1.bam"/> | |
150 <param name="minlen" value="100"/> | |
151 <param name="nosecondary" value="True"/> | |
152 <param name="noqcfail" value="True"/> | |
153 <param name="nopcrdup" value="True"/> | |
154 <output name="outfile" file="ngsutils_bam_filter_result3.bam" ftype="bam" /> | |
155 </test> | |
156 <test> | |
157 <param name="infile" ftype="bam" value="ngsutils_bam_filter_input1.bam"/> | |
158 <output name="outfile" file="ngsutils_bam_filter_input1.bam" ftype="bam" /> | |
159 </test> | |
160 <test> | |
161 <param name="infile" ftype="bam" value="ngsutils_bam_filter_input1.bam"/> | |
162 <param name="mask" value="0x40"/> | |
163 <output name="outfile" file="ngsutils_bam_filter_result4.bam" ftype="bam" /> | |
164 </test> | |
165 </tests> | |
166 <help><![CDATA[ | |
167 Removes reads from a BAM file based on criteria. | |
168 | |
169 Given a BAM file, this tool will discard reads that did not meet the selected filtering criteria | |
170 The output is another BAM file with the reads not matching the criteria removed. | |
171 | |
172 Note: this does not adjust tag values reflecting any filtering. (for example: | |
173 if a read mapped to two locations (IH:i:2), and one was removed by | |
174 filtering, the IH:i tag would still read IH:i:2). | |
175 | |
176 Currently, the available filters are: | |
177 | |
178 +--------------------------------+-------------------------------------------------+ | |
179 | Agument | Description | | |
180 +================================+=================================================+ | |
181 | -minlen val | Remove reads that are smaller than {val} | | |
182 +--------------------------------+-------------------------------------------------+ | |
183 | -maxlen val | Remove reads that are larger than {val} | | |
184 +--------------------------------+-------------------------------------------------+ | |
185 | -mapped | Keep only mapped reads | | |
186 +--------------------------------+-------------------------------------------------+ | |
187 | -unmapped | Keep only unmapped reads | | |
188 +--------------------------------+-------------------------------------------------+ | |
189 | -properpair | Keep only properly paired reads (both mapped, | | |
190 | | correct orientation, flag set in BAM) | | |
191 +--------------------------------+-------------------------------------------------+ | |
192 | -noproperpair | Keep only not-properly paired reads | | |
193 +--------------------------------+-------------------------------------------------+ | |
194 | -mask bitmask | Remove reads that match the mask (e.g. 0x400) | | |
195 +--------------------------------+-------------------------------------------------+ | |
196 | -uniq {length} | Remove reads that are have the same sequence | | |
197 | | Note: BAM file should be sorted | | |
198 | | (up to an optional length) | | |
199 +--------------------------------+-------------------------------------------------+ | |
200 | -uniq_start | Remove reads that start at the same position | | |
201 | | Note: BAM file should be sorted | | |
202 | | (Use only for low-coverage samples) | | |
203 +--------------------------------+-------------------------------------------------+ | |
204 |-mismatch num | Number of mismatches or indels | | |
205 | | indel always counts as 1 regardless of length | | |
206 | | (requires NM tag in reads) | | |
207 +--------------------------------+-------------------------------------------------+ | |
208 |-nosecondary | Remove reads that have the 0x100 flag set | | |
209 +--------------------------------+-------------------------------------------------+ | |
210 |-noqcfail | Remove reads that have the 0x200 flag set | | |
211 +--------------------------------+-------------------------------------------------+ | |
212 |-nopcrdup | Remove reads that have the 0x400 flag set | | |
213 +--------------------------------+-------------------------------------------------+ | |
214 |-excludebed file.bed {nostrand} | Remove reads that are in any of the regions | | |
215 | | from the given BED file. If 'nostrand' is given,| | |
216 | | strand information from the BED file is ignored.| | |
217 +--------------------------------+-------------------------------------------------+ | |
218 |-includebed file.bed {nostrand} | Remove reads that are NOT any of the regions | | |
219 | | from the given BED file. If 'nostrand' is given,| | |
220 | | strand information from the BED file is ignored.| | |
221 | | Note: If this is a large dataset, use | | |
222 | | "bamutils extract" instead. | | |
223 +--------------------------------+-------------------------------------------------+ | |
224 | -includeref refname | Exclude reads NOT mapped to a reference | | |
225 +--------------------------------+-------------------------------------------------+ | |
226 | -excluderef refname | Exclude reads mapped to a particular reference | | |
227 | | (e.g. chrM, or _dup chromosomes) | | |
228 +--------------------------------+-------------------------------------------------+ | |
229 ]]> | |
230 </help> | |
231 </tool> |