upstream-extended/iuc/tool_collections/samtools/samtools_depth/samtools_depth.xml
1<tool id="samtools_depth" name="Samtools depth" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>compute the depth at each position or region</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements"/>
7 <expand macro="stdio"/>
8 <expand macro="version_command"/>
9 <command><![CDATA[
10## create symlinks to bams and index files (0,..., n-1 + 0.[bai|crai],...,n-1.[bai|crai] )
11@PREPARE_IDX_MULTIPLE@
12
13samtools depth
14$all
15#if $cond_region.select_region == 'bed':
16 -b '$cond_region.input_bed'
17#else if $cond_region.select_region == 'text':
18 -r $cond_region.region
19#end if
20#if str($minlength) != '':
21 -l $minlength
22#end if
23#if str($maxdepth) != '':
24 -m $maxdepth
25#end if
26#if str($basequality) != '':
27 -q $basequality
28#end if
29#if str($mapquality) != '':
30 -Q $mapquality
31#end if
32#for $i in range(len( $input_bams )):
33 ${i}
34#end for
35#set $filter = $additional_options.required_flags
36@FLAGS@
37-g $flags
38#set $filter = $additional_options.skipped_flags
39@FLAGS@
40-G $flags
41$additional_options.deletions
42$additional_options.single_read
43$output_options.header
44> '${output}'
45 ]]></command>
46 <inputs>
47 <param name="input_bams" type="data" format="bam" multiple="true" label="BAM file(s)" />
48 <conditional name="cond_region">
49 <param name="select_region" type="select" label="Filter by regions">
50 <option value="no" selected="True">No</option>
51 <option value="text">Manualy specify a region</option>
52 <option value="bed">Regions from BED file</option>
53 </param>
54 <when value="no"/>
55 <when value="text">
56 <param name="region" type="text" optional="false" argument="-r" label="Only report depth in a specified region" help="Format is CHROMOSOME:FROM-TO"/>
57 </when>
58 <when value="bed">
59 <param name="input_bed" type="data" format="bed" argument="-b" label="Genomic intervals (in BED format)" help="Compute depth at list of positions or regions in specified BED FILE." />
60 </when>
61 </conditional>
62
63 <param name="all" type="select" argument="-a/-aa" label="Output all positions" help="Note that if the all option (-a) is used in conjunction with a BED file it may sometimes operate as if -aa was specified if the reference sequence has coverage outside of the region specified in the BED file.">
64 <option value="" selected="True">Default</option>
65 <option value="-a">Output all positions (including those with zero depth) (-a)</option>
66 <option value="-aa">Output absolutely all positions, including unused reference sequences. (-aa)</option>
67 </param>
68 <param name="minlength" type="integer" argument="-l" min="0" optional="true" label="Ignore reads shorter than" />
69 <param name="maxdepth" type="integer" argument="-m" min="0" optional="true" label="Limits the maximum number of considered alignments starting at any sequence position to INT. Note that, the reported depths values might be larger than INT. If 0, depth is set to the maximum integer value, effectively removing any depth limit. (default = 8000)" />
70
71 <param name="basequality" type="integer" argument="-q" min="0" optional="true" label="Only count reads with base quality greater than" />
72 <param name="mapquality" type="integer" argument="-Q" min="0" optional="true" label="Only count reads with mapping quality greater than" />
73
74 <section name="additional_options" title="Additional Filter Options">
75 <param name="required_flags" argument="-g" type="select" multiple="True" label="Require that these flags are set.">
76 <expand macro="flag_options" />
77 </param>
78
79 <param name="skipped_flags" argument="-G" type="select" multiple="True" label="Exclude reads with any of the following flags set (the default set is UNMAP,SECONDARY,QCFAIL,DUP or 0x704).">
80 <expand macro="flag_options" s4="true" s256="true" s512="true" s1024="true"/>
81 </param>
82
83 <param name="deletions" type="boolean" argument="-J" truevalue="-J" falsevalue="" checked="false" label="Include reads with deletions in depth computation." />
84 <param name="single_read" type="boolean" argument="-s" truevalue="-s" falsevalue="" checked="false" label="For the overlapping section of a read pair, count only the bases of a single read." />
85 </section>
86
87 <section name="output_options" title="Output Options" expanded="true">
88 <param name="header" type="boolean" argument="-H" truevalue="-H" falsevalue="" checked="false" label="Print a file header to file." />
89 </section>
90
91 </inputs>
92 <outputs>
93 <data name="output" format="tabular" label="${tool.name} on ${on_string}" />
94 </outputs>
95 <tests>
96 <!-- 1) -->
97 <test>
98 <conditional name="cond_region">
99 <param name="select_region" value="bed"/>
100 <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
101 </conditional>
102 <param name="input_bams" value="eboVir3.bam" ftype="bam" />
103 <output name="output" file="samtools_depth_out1.tab" />
104 </test>
105 <!-- 2) -->
106 <test>
107 <conditional name="cond_region">
108 <param name="select_region" value="text"/>
109 <param name="region" value="eboVir3:500-1500" />
110 </conditional>
111 <param name="input_bams" value="eboVir3.bam" ftype="bam" />
112 <output name="output" file="samtools_depth_out2.tab" />
113 </test>
114 <!-- 3) -->
115 <test>
116 <param name="input_bams" value="eboVir3.bam,eboVir3.2.bam" ftype="bam" />
117 <param name="all" value="-a"/>
118 <output name="output" file="samtools_depth_out3.tab" />
119 </test>
120 <!-- 4) -->
121 <test>
122 <param name="input_bams" value="eboVir3.bam,eboVir3.2.bam" ftype="bam" />
123 <param name="minlength" value="10" />
124 <!-- Odd thing: I did not expect values > 4 in the output, but there are ... ?
125 see https://github.com/samtools/samtools/issues/889 -->
126 <param name="maxdepth" value="4" />
127 <param name="basequality" value="11" />
128 <param name="mapquality" value="12" />
129 <output name="output" file="samtools_depth_out4.tab" />
130 </test>
131 <!-- 5) Testing argument -H -->
132 <test>
133 <conditional name="cond_region">
134 <param name="select_region" value="bed"/>
135 <param name="input_bed" value="eboVir3.1.bed" ftype="bed" />
136 </conditional>
137 <param name="input_bams" value="eboVir3.bam" ftype="bam" />
138 <section name="output_options">
139 <param name="header" value="true" />
140 </section>
141 <output name="output" file="samtools_depth_out5.tab" />
142 </test>
143 <!-- 6) Tetsing argument -g -->
144 <test>
145 <param name="input_bams" value="eboVir3.bam" ftype="bam" />
146 <section name="additional_options">
147 <param name="required_flags" value="2,16,64" />
148 </section>
149 <output name="output" file="samtools_depth_out6.tab" />
150 </test>
151 <!-- 7) Tetsing argument -G -->
152 <test>
153 <param name="input_bams" value="eboVir3.bam" ftype="bam" />
154 <section name="additional_options">
155 <param name="skipped_flags" value="2,16,64" />
156 </section>
157 <output name="output" file="samtools_depth_out7.tab" />
158 </test>
159 </tests>
160 <help>
161**What it does**
162
163Computes the depth at each position or region using the ``samtools depth`` command.
164
165The output is a tabular file, with one line for each base of each reference
166with any coverage (bases with no coverage may not appear).
167
168The first column is the reference name, the second column is the reference
169position, and then there is one column for each SAM/BAM file giving the
170coverage depth at that position.
171 </help>
172 <expand macro="citations"/>
173</tool>