view samtools_calmd.xml @ 2:e65c2cd0964c draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_calmd commit 766da8a5f0449de99c2854aacaefb80d11ad083c
author iuc
date Fri, 30 Nov 2018 17:46:15 -0500
parents 33208952b99d
children 3d873744df7e
line wrap: on
line source

<tool id="samtools_calmd" name="CalMD" version="2.0.2">
    <description>recalculate MD/NM tags</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
        #if str( $reference_source.reference_source_selector ) == "history":
            #set ref_fa = 'ref.fa'
            ln -s '${reference_source.ref_fasta}' ref.fa &&
            samtools faidx ref.fa &&
        #else:
            #set ref_fa = str( $reference_source.ref_fasta.fields.path )
        #end if

        samtools calmd
            $baq_settings.use_baq $baq_settings.modify_quality $baq_settings.extended_baq
            #if str($option_set.option_sets) == 'advanced':
                $option_set.change_identical -C $option_set.adjust_mq
            #end if
            -b
            '$input_bam'
            '$ref_fa'
            > '$calmd_output'
    ]]></command>
    <inputs>
        <param name="input_bam" type="data" format="bam" label="BAM file to recalculate" />
        <conditional name="reference_source">
            <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
                <option value="cached">Use a built-in genome</option>
                <option value="history">Use a genome from the history</option>
            </param>
            <when value="cached">
                <param name="ref_fasta" type="select" label="Using reference genome">
                    <options from_data_table="fasta_indexes">
                        <filter type="data_meta" column="1" key="dbkey" ref="input_bam" />
                        <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file" />
                    </options>
                </param>
            </when>
            <when value="history">
                <param name="ref_fasta" type="data" format="fasta" label="Using reference file" />
            </when>
        </conditional>
        <conditional name="baq_settings">
            <param name="use_baq" argument="-r" type="select"
            label="Do you also want BAQ (Base Alignment Quality) scores to be calculated?">
                <option value="">No</option>
                <option value="-r">Yes, run BAQ calculation</option>
            </param>
            <when value="">
                <param name="modify_quality" type="hidden" value="" />
                <param name="extended_baq" type="hidden" value="" />
            </when>
            <when value="-r">
                <param name="modify_quality" argument="-A" type="boolean" truevalue="-A" falsevalue="" checked="false"
                label="Use BAQ to cap read base qualities"
                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." />
                <param name="extended_baq" argument="-E" type="boolean" truevalue="-E" falsevalue="" checked="false" label="Extended BAQ for better sensitivity" />
            </when>
        </conditional>
        <conditional name="option_set">
            <param name="option_sets" type="select" label="Additional options">
                <option value="default">Use defaults</option>
                <option value="advanced">Advanced options</option>
            </param>
            <when value="default" />
            <when value="advanced">
                <param name="change_identical" argument="-e" type="boolean" truevalue="-e" falsevalue="" checked="False"
                label="Change identical bases to '='"
                help="Replace bases in read sequences that match the reference base at that position with an equal sign" />
                <param name="adjust_mq" argument="-C" type="integer" min="0" max="255" value="0"
                label="Coefficient to cap mapping quality of poorly mapped reads"
                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)" />
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="calmd_output" format="bam" label="${tool.name} on ${on_string}" />
    </outputs>
    <tests>
        <test>
            <param name="use_baq" value="" />
            <param name="option_sets" value="default" />
            <param name="input_bam" value="phiX.bam"/>
            <param name="reference_source_selector" value="history" />
            <param name="ref_fasta" value="phiX.fasta" />
            <output name="calmd_output" file="samtools_calmd_out_1.bam" ftype="bam" />
        </test>
        <test>
            <param name="use_baq" value="-r" />
            <param name="extended_baq" value="true" />
            <param name="option_sets" value="advanced" />
            <param name="change_identical" value="true" />
            <param name="adjust_mq" value="50" />
            <param name="input_bam" value="phiX.bam"/>
            <param name="reference_source_selector" value="history" />
            <param name="ref_fasta" value="phiX.fasta" />
            <output name="calmd_output" file="samtools_calmd_out_2.bam" ftype="bam" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Generates the MD tag using the ``samtools calmd`` command. If the MD tag (see
SAM format reference below for explanation of SAM/BAM tags) is already present,
this command will give a warning if the MD tag generated is different from the
existing tag.

Optionally, also generates the BQ tag to encode base alignment qualities,
caps the mapping quality of poorly mapping reads, and modifies read sequences
replacing bases matching the reference with ``=``.

Outputs a BAM file.

-----

**SAM/BAM tags written by this tool**

From the SAM format tag specification::

  MD (string)  String for mismatching positions. Regex : [0-9]+(([A-Z]|\^[A-Z]+)[0-9]+)*7
  NM (integer) Edit distance to the reference, including ambiguous bases but excluding clipping
  BQ (string)  String of offsets to base alignment quality (BAQ), of the same length as the read sequence. 
               At the i-th read base, BAQ i = Q i − (BQ i − 64) where Q i is the i-th base quality.

See references for more information about SAM format tags.
    ]]></help>
    <expand macro="citations"/>
</tool>