0
|
1 <tool id="samtools_idxstats" name="IdxStats" version="2.0">
|
|
2 <description>tabulate mapping statistics for BAM dataset</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements"></expand>
|
|
7 <expand macro="stdio"></expand>
|
|
8 <expand macro="version_command"></expand>
|
|
9 <command><![CDATA[
|
|
10 if [ ! -f "${input}.bai" ] ; then
|
|
11 ln -s "${input}" input.bam ;
|
|
12 samtools sort -o sorted.bam -O bam -T sts "${input}" ;
|
|
13 samtools index sorted.bam ;
|
|
14 samtools idxstats sorted.bam > "${output}" ;
|
|
15 else
|
|
16 samtools idxstats "${input}" > "${output}" ;
|
|
17 fi]]>
|
|
18 </command>
|
|
19 <inputs>
|
|
20 <param name="input" type="data" format="bam" label="BAM file" />
|
|
21 </inputs>
|
|
22 <outputs>
|
|
23 <data format="tabular" name="output" label="${tool.name} on ${on_string}" />
|
|
24 </outputs>
|
|
25 <tests>
|
|
26 <test>
|
|
27 <param name="input" value="phiX.bam" ftype="bam" />
|
|
28 <output name="output" file="samtools_idxstats_out.tabular" compare="diff" ftype="tabular" />
|
|
29 </test>
|
|
30 </tests>
|
|
31 <help>
|
|
32 <![CDATA[
|
|
33 **What it does**
|
|
34
|
|
35 Runs the ``samtools idxstats`` command. It retrieves and prints stats in the index file.
|
|
36
|
|
37 Input is a sorted and indexed BAM file, the output is tabular with
|
|
38 four columns (one row per reference sequence plus a final line for
|
|
39 unmapped reads)::
|
|
40
|
|
41 Column Description
|
|
42 ------ -----------------------------
|
|
43 1 Reference sequence identifier
|
|
44 2 Reference sequence length
|
|
45 3 Number of mapped reads
|
|
46 4 Number of placed but unmapped reads
|
|
47 (typically unmapped partners of mapped reads)
|
|
48
|
|
49 ------
|
|
50
|
|
51 **Example** output from a *de novo* assembly::
|
|
52
|
|
53 contig_1 170035 98397 0
|
|
54 contig_2 403835 199564 0
|
|
55 contig_3 553102 288189 0
|
|
56 ... ... ... ...
|
|
57 contig_603 653 50 0
|
|
58 contig_604 214 6 0
|
|
59 \* 0 0 50320
|
|
60
|
|
61
|
|
62 In this example there were 604 contigs, each with one line in the output table,
|
|
63 plus the final row (labelled with an asterisk) representing 50320 unmapped reads.
|
|
64 In this BAM file, the final column was otherwise zero.
|
|
65
|
|
66 ------
|
|
67
|
|
68 Peter J.A. Cock (2013), `Galaxy wrapper <https://github.com/peterjc/pico_galaxy/tree/master/tools/samtools_idxstats>`_ for the samtools idxstats command
|
|
69 ]]>
|
|
70 </help>
|
|
71 <expand macro="citations"></expand>
|
|
72 </tool>
|