Source code

Download source archive ↓

upstream-extended/iuc/tool_collections/samtools/samtools_flagstat/samtools_flagstat.xml

1<tool id="samtools_flagstat" name="Samtools flagstat" version="2.0.8" profile="@PROFILE@">
2    <description>tabulate descriptive stats for BAM datset</description>
3
4    <macros>
5        <import>macros.xml</import>
6    </macros>
7    <expand macro="requirements"/>
8    <expand macro="stdio"/>
9    <expand macro="version_command"/>
10
11    <command><![CDATA[
12    @ADDTHREADS@
13    samtools flagstat -@ \$addthreads 
14    #if $output_fmt != 'txt'
15        --output-fmt $output_fmt
16    #end if
17    '$input1'
18    > '$output1'
19    ]]></command>
20
21    <inputs>
22        <param name="input1" type="data" format="sam,bam,cram" label="BAM File to report statistics of" />
23        <param argument="--output-fmt" type="select" label="Output format">
24            <option value="txt">txt</option>
25            <option value="tsv">tsv</option>
26            <option value="json">json</option>
27        </param>
28    </inputs>
29
30    <outputs>
31        <data name="output1" format="txt">
32            <change_format>
33                <when input="output_fmt" value="tsv" format="tabular" />
34                <when input="output_fmt" value="json" format="json" />
35            </change_format>
36        </data>
37    </outputs>
38
39    <tests>
40        <test>
41            <param name="input1" value="samtools_flagstat_input1.bam" ftype="bam" />
42            <output name="output1" file="samtools_flagstat_out1.txt" ftype="txt"/>
43        </test>
44        <test>
45            <param name="input1" value="samtools_flagstat_input1.bam" ftype="bam" />
46            <param name="output_fmt" value="tsv"/>
47            <output name="output1" file="samtools_flagstat_out1.tsv" ftype="tabular" />
48        </test>
49        <test>
50            <param name="input1" value="samtools_flagstat_input1.bam" ftype="bam" />
51            <param name="output_fmt" value="json"/>
52            <output name="output1" file="samtools_flagstat_out1.json" ftype="json" />
53        </test>
54    </tests>
55    <help><![CDATA[
56**What it does**
57
58Uses ``samtools flagstat`` command to print descriptive information for a BAM dataset. Here is an example of such information::
59
60  200 + 0 in total (QC-passed reads + QC-failed reads)
61  0 + 0 secondary
62  0 + 0 supplementary
63  0 + 0 duplicates
64  25 + 0 mapped (12.50%:nan%)
65  200 + 0 paired in sequencing
66  100 + 0 read1
67  100 + 0 read2
68  0 + 0 properly paired (0.00%:nan%)
69  0 + 0 with itself and mate mapped
70  25 + 0 singletons (12.50%:nan%)
71  0 + 0 with mate mapped to a different chr
72  0 + 0 with mate mapped to a different chr (mapQ>=5)
73
74The results of samtools flagstat can be visualized with MultiQC.
75    ]]></help>
76    <expand macro="citations"/>
77</tool>