annotate sambamba_filter.xml @ 1:806b3253c996

add test data
author lomereiter
date Tue, 14 Aug 2012 21:25:40 +0400
parents 668e187566d5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
1 <tool id="sambamba_filter" name="Filter BAM or SAM" version="0.2.4">
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
2 <requirements>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
3 <requirement type="binary">sambamba</requirement>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
4 </requirements>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
5 <description>
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
6 on flags, fields, and tags
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
7 </description>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
8 <command>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
9 #if $query != None:
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
10 #set $query = $query.replace('__sq__', '\'')
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
11 #set $query = $query.replace('__ob__', '[')
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
12 #set $query = $query.replace('__cb__', ']')
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
13 #set $query = $query.replace('__dq__', '"')
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
14 #set $query = $query.replace('__oc__', '{')
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
15 #set $query = $query.replace('__cc__', '}')
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
16 #set $query = $query.replace('__gt__', chr(62))
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
17 #set $query = $query.replace('__lt__', chr(60))
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
18 #end if
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
19 #if isinstance($input.datatype, $__app__.datatypes_registry.get_datatype_by_extension('bam').__class__):
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
20 #set $input1 = 'input.bam'
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
21 ln -s $input $input1 &amp;&amp;
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
22 ln -s $input.metadata.bam_index input.bai &amp;&amp;
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
23 sambamba view -h --filter="$query" -f $outputformat.format -o $outfile $input1 $region
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
24 #else
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
25 sambamba view -S -h --filter="$query" -f $outputformat.format -o $outfile $input
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
26 #end if
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
27 </command>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
28 <inputs>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
29 <param name="input" type="data" format="bam,sam" label="BAM or SAM file to filter"/>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
30 <param name="query" type="text" size="80">
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
31 <label>Filter expression</label>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
32 <help>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
33 The syntax is described at sambamba wiki: https://github.com/lomereiter/sambamba/wiki/%5Bsambamba-view%5D-Filter-expression-syntax
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
34 </help>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
35 </param>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
36
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
37 <conditional name="outputformat">
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
38 <param name="format" type="select">
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
39 <label>Output format</label>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
40 <option value="sam">SAM</option>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
41 <option value="bam">BAM</option>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
42 </param>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
43 <when value="sam">
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
44 <!-- TODO
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
45 <param name="header" type="select">
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
46 <label>Include SAM header in output</label>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
47 <option value="yes">Yes</option>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
48 <option value="no">No</option>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
49 </param>-->
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
50 </when>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
51 <when value="bam"/>
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
52 </conditional>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
53 <param name="region" type="text" size="40" label="Region in format chr:beg-end, works for BAM input only">
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
54 <help>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
55 The syntax is the same as in samtools, start and end coordinates are 1-based.
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
56 </help>
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
57 </param>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
58 </inputs>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
59 <outputs>
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
60 <data name="outfile" format="bam">
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
61 <change_format>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
62 <when input="outputformat.format" value="sam" format="sam"/>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
63 </change_format>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
64 </data>
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
65 </outputs>
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
66 <tests>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
67 <test>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
68 <param name="input" value="ex1_header.sam" ftype="sam" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
69 <param name="query" value="[H0] == 1 and read_name =~ /^EAS51_62/" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
70 <param name="format" value="bam" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
71 <param name="region" value="" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
72 <output name="outfile" file="ex1_header_filtered.bam" ftype="bam" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
73 </test>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
74 <test>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
75 <param name="input" value="c1215_fixmate.bam" ftype="bam" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
76 <param name="query" value="[MD] =~ /^\d+T\d+A\d+/ and first_of_pair" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
77 <param name="format" value="sam" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
78 <!--<param name="header" value="yes" />-->
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
79 <param name="region" value="AL096846:1000-5000" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
80 <output name="outfile" file="c1215_fixmate_filtered.sam" ftype="sam" />
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
81 </test>
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
82 </tests>
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
83 <help>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
84 **What it does**
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
85
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
86 This tool uses sambamba view to filter BAM/SAM on flags, fields, tags, and region.
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
87 In order to install sambamba, visit its website_ and either download
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
88 a Debian package for your architecture, or build the tool from source.
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
89
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
90 Input is SAM or BAM file, output is chosen by user.
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
91
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
92 **Note**
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
93
1
806b3253c996 add test data
lomereiter
parents: 0
diff changeset
94 Filtering by region works only for coordinate-sorted BAM files. For SAM files this parameter is ignored.
0
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
95
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
96 -----
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
97
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
98 .. _website: http://github.com/lomereiter/sambamba
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
99
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
100
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
101 </help>
668e187566d5 uploaded xml wrapper
lomereiter
parents:
diff changeset
102 </tool>