Mercurial > repos > devteam > bamtools_filter
comparison bamtools-filter.xml @ 11:6fae66d050a7 draft
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/bamtools/bamtools_filter commit 53f2eeca99efda354323295a0ebfb5e7f21f2fd4
author | devteam |
---|---|
date | Thu, 25 May 2017 11:49:21 -0400 |
parents | 4089f1be1a71 |
children | ce5482dfe8bd |
comparison
equal
deleted
inserted
replaced
10:4089f1be1a71 | 11:6fae66d050a7 |
---|---|
1 <tool id="bamFilter" name="Filter" version="2.4.0"> | 1 <tool id="bamFilter" name="Filter" version="2.4.1"> |
2 <description>BAM datasets on a variety of attributes</description> | 2 <description>BAM datasets on a variety of attributes</description> |
3 <requirements> | 3 <requirements> |
4 <requirement type="package" version="2.4.0">bamtools</requirement> | 4 <requirement type="package" version="2.4.0">bamtools</requirement> |
5 </requirements> | 5 </requirements> |
6 <command> | 6 <command> |
7 <![CDATA[ | 7 <![CDATA[ |
8 cat $script_file > $out_file2; | 8 cp '$script_file' '$out_file2' && |
9 #for $bam_count, $input_bam in enumerate( $input_bams ): | 9 ln -s '${input_bam}' localbam.bam && |
10 ln -s "${input_bam}" "localbam_${bam_count}.bam" && | 10 ln -s '${input_bam.metadata.bam_index}' localbam.bam.bai && |
11 ln -s "${input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" && | 11 bamtools filter -script '$script_file' -in localbam.bam -out '$out_file1' |
12 #end for | |
13 bamtools | |
14 filter | |
15 -script $script_file | |
16 #for $bam_count, $input_bam in enumerate( $input_bams ): | |
17 -in "localbam_${bam_count}.bam" | |
18 #end for | |
19 -out $out_file1 | |
20 ]]> | 12 ]]> |
21 </command> | 13 </command> |
22 <configfiles> | 14 <configfiles> |
23 <configfile name="script_file"> | 15 <configfile name="script_file"> |
24 ##Sets up a json configfile for bamtools filter | 16 <![CDATA[ |
25 ##If there is more than one condition prints brackets and "filters:" | 17 <% import json %> |
26 #if len( $conditions ) > 1 | 18 #set $config = dict() |
27 { | 19 #if $conditions: |
28 "filters": | 20 #set $config[ 'filters' ] = [] |
29 [ | 21 #for $i, $condition in enumerate( $conditions, start=1 ): |
30 #end if | 22 #set $filter = dict( id=str( $i ) ) |
31 #for $i, $c in enumerate( $conditions, start=1 ) | 23 #for $j, $s in enumerate( $condition.filters, start=1 ): |
32 { "id": "$i", | 24 #set $filter[ $str( s[ 'bam_property' ][ 'bam_property_selector' ] ) ] = $str( s[ 'bam_property' ][ 'bam_property_value' ] ) |
33 #for $j, $s in enumerate( $c.filters, start=1 ) | 25 #end for |
34 ##The if below takes care of the comma at the end of last condition within group | 26 $(config[ 'filters' ].append( $filter )) |
35 #if $j != len( $c.filters) | 27 #end for |
36 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}", | 28 #if str( $rule_configuration.rules_selector ) == "true": |
37 #else | 29 #set $config[ 'rule' ] = $rule_configuration.rules |
38 "${s.bam_property.bam_property_selector}":"${s.bam_property.bam_property_value}" | 30 #end if |
39 #end if | 31 #end if |
40 #end for | 32 $json.dumps( $config, indent=4 ) |
41 ##The if below takes care of the comma at the end of last condition within group | 33 ]]> |
42 #if $i != len( $conditions ) | |
43 }, | |
44 #else | |
45 } | |
46 #end if | |
47 #end for | |
48 #if len( $conditions ) > 1 | |
49 #if str( $rule_configuration.rules_selector ) == "True": | |
50 ], | |
51 "rule" : "${rule_configuration.rules}" | |
52 #else | |
53 ] | |
54 #end if | |
55 } | |
56 #end if | |
57 </configfile> | 34 </configfile> |
58 </configfiles> | 35 </configfiles> |
59 <inputs> | 36 <inputs> |
60 <param name="input_bams" type="data" format="bam" label="BAM dataset(s) to filter" min="1" multiple="True"/> | 37 <param name="input_bam" type="data" format="bam" label="BAM dataset(s) to filter" /> |
61 <repeat name="conditions" title="Condition" min="1"> | 38 <repeat name="conditions" title="Condition" min="1"> |
62 <repeat name="filters" title="Filter" min="1"> | 39 <repeat name="filters" title="Filter" min="1"> |
63 <conditional name="bam_property"> | 40 <conditional name="bam_property"> |
64 <param name="bam_property_selector" type="select" label="Select BAM property to filter on"> | 41 <param name="bam_property_selector" type="select" label="Select BAM property to filter on"> |
65 <option value="alignmentFlag"/> | 42 <option value="alignmentFlag"/> |
202 </param> | 179 </param> |
203 </when> | 180 </when> |
204 </conditional> | 181 </conditional> |
205 </inputs> | 182 </inputs> |
206 <outputs> | 183 <outputs> |
207 <data format="txt" name="out_file2" /> | 184 <data format="txt" name="out_file2" label="${tool.name} on ${on_string}: JSON filter rules" /> |
208 <data format="bam" name="out_file1" /> | 185 <data name="out_file1" format="bam" label="${tool.name} on ${on_string}: Filtered BAM" /> |
209 </outputs> | 186 </outputs> |
210 <tests> | 187 <tests> |
211 <test> | 188 <test> |
212 <param name="input_bams" ftype="bam" value="bamtools-input1.bam"/> | 189 <param name="input_bam" ftype="bam" value="bamtools-input1.bam"/> |
213 <param name="bam_property_selector" value="mapQuality"/> | 190 <param name="bam_property_selector" value="mapQuality"/> |
214 <param name="bam_property_value" value=">20"/> | 191 <param name="bam_property_value" value=">20"/> |
215 <output name="out_file1" file="bamtools-test1.bam" ftype="bam"/> | 192 <output name="out_file1" ftype="bam" file="bamtools-test1.bam" /> |
216 </test> | 193 </test> |
217 </tests> | 194 </tests> |
218 <help> | 195 <help> |
219 **What is does** | 196 **What is does** |
220 | 197 |