Source code

Download source archive ↓

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

1<tool id="samtools_calmd" name="Samtools calmd" version="2.0.7" profile="@PROFILE@">
2    <description>recalculate MD/NM tags</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@ADDTHREADS@
11@PREPARE_FASTA_IDX@
12
13samtools calmd
14    $baq_settings.use_baq $baq_settings.modify_quality $baq_settings.extended_baq
15    #if str($option_set.option_sets) == 'advanced':
16        $option_set.change_identical -C $option_set.adjust_mq
17    #end if
18    -b
19    -@ \$addthreads
20    '$input'
21    "\$reffa"
22    > '$calmd_output'
23    ]]></command>
24    <inputs>
25        <param name="input" type="data" format="bam" label="BAM file to recalculate" />
26        <expand macro="mandatory_reference"/>
27        <conditional name="baq_settings">
28            <param name="use_baq" argument="-r" type="select"
29            label="Do you also want BAQ (Base Alignment Quality) scores to be calculated?">
30                <option value="">No</option>
31                <option value="-r">Yes, run BAQ calculation</option>
32            </param>
33            <when value="">
34                <param name="modify_quality" type="hidden" value="" />
35                <param name="extended_baq" type="hidden" value="" />
36            </when>
37            <when value="-r">
38                <param name="modify_quality" argument="-A" type="boolean" truevalue="-A" falsevalue="" checked="false"
39                label="Use BAQ to cap read base qualities"
40                help="By default, BAQ scores are stored in a separate BQ tag, and the read base quality string is left untouched. When you enable this option, the BAQ scores will be used directly to modify the quality string instead." />
41                <param name="extended_baq" argument="-E" type="boolean" truevalue="-E" falsevalue="" checked="false" label="Extended BAQ for better sensitivity" />
42            </when>
43        </conditional>
44        <conditional name="option_set">
45            <param name="option_sets" type="select" label="Additional options">
46                <option value="default">Use defaults</option>
47                <option value="advanced">Advanced options</option>
48            </param>
49            <when value="default" />
50            <when value="advanced">
51                <param name="change_identical" argument="-e" type="boolean" truevalue="-e" falsevalue="" checked="False"
52                label="Change identical bases to '='"
53                help="Replace bases in read sequences that match the reference base at that position with an equal sign" />
54                <param name="adjust_mq" argument="-C" type="integer" min="0" max="255" value="0"
55                label="Coefficient to cap mapping quality of poorly mapped reads"
56                help="Higher values for this setting mean a stronger downgrade of the mapping quality of reads with excessive mismatches (50: recommended setting for reads aligned with BWA, 0: do not downgrade mapping qualities)" />
57            </when>
58        </conditional>
59    </inputs>
60    <outputs>
61        <data name="calmd_output" format="bam" label="${tool.name} on ${on_string}" />
62    </outputs>
63    <tests>
64        <test>
65            <conditional name="baq_settings">
66                <param name="use_baq" value="" />
67            </conditional>
68            <conditional name="option_set">
69                <param name="option_sets" value="default" />
70            </conditional>
71            <param name="input" value="phiX.bam"/>
72            <conditional name="addref_cond">
73                <param name="addref_select" value="history" />
74                <param name="ref" value="phiX.fasta" />
75            </conditional>
76            <output name="calmd_output" file="samtools_calmd_out_1.bam" ftype="bam" lines_diff="4" />
77        </test>
78        <test>
79            <conditional name="baq_settings">
80                <param name="use_baq" value="-r" />
81                <param name="extended_baq" value="true" />
82            </conditional>
83            <conditional name="option_set">
84                <param name="option_sets" value="advanced" />
85                <param name="change_identical" value="true" />
86                <param name="adjust_mq" value="50" />
87            </conditional>
88            <param name="input" value="phiX.bam"/>
89            <conditional name="addref_cond">
90                <param name="addref_select" value="history" />
91                <param name="ref" value="phiX.fasta" />
92            </conditional>
93            <output name="calmd_output" file="samtools_calmd_out_2.bam" ftype="bam" lines_diff="4" />
94        </test>
95    </tests>
96    <help><![CDATA[
97**What it does**
98
99Generates the MD tag using the ``samtools calmd`` command. If the MD tag (see
100SAM format reference below for explanation of SAM/BAM tags) is already present,
101this command will give a warning if the MD tag generated is different from the
102existing tag.
103
104Optionally, also generates the BQ tag to encode base alignment qualities,
105caps the mapping quality of poorly mapping reads, and modifies read sequences
106replacing bases matching the reference with ``=``.
107
108Outputs a BAM file.
109
110-----
111
112**SAM/BAM tags written by this tool**
113
114From the SAM format tag specification::
115
116  MD (string)  String for mismatching positions. Regex : [0-9]+(([A-Z]|\^[A-Z]+)[0-9]+)*7
117  NM (integer) Edit distance to the reference, including ambiguous bases but excluding clipping
118  BQ (string)  String of offsets to base alignment quality (BAQ), of the same length as the read sequence.
119               At the i-th read base, BAQ i = Q i − (BQ i − 64) where Q i is the i-th base quality.
120
121See references for more information about SAM format tags.
122    ]]></help>
123    <expand macro="citations"/>
124</tool>