view ivar_removereads.xml @ 5:75c279fa403a draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit a5ff06c631a2a5a0d5d44edd6cb58a599d50918b"
author iuc
date Wed, 19 May 2021 16:49:58 +0000
parents ee2beb764a7b
children 28a6f1908fcc
line wrap: on
line source

<tool id="ivar_removereads" name="ivar removereads" version="@VERSION@+galaxy0">
    <description>Remove reads from trimmed BAM file</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements">
        <requirement type="package" version="3.8.1">python</requirement>
    </expand>
    <expand macro="version_command" />
    <command detect_errors="exit_code"><![CDATA[
        cp '$input_bed' binding_sites.bed &&
        python '$__tool_directory__/sanitize_bed.py' binding_sites.bed &&

        ivar getmasked
        -i '$variants_tsv' -b binding_sites.bed -f '$amplicon_info' -p masked_primers &&

        python '$__tool_directory__/completemask.py' masked_primers.txt '$amplicon_info' &&
        ln -s '$input_bam' sorted.bam &&
        ln -s '${input_bam.metadata.bam_index}' sorted.bam.bai &&

        ivar removereads 
        -i sorted.bam
        -b binding_sites.bed
        -p removed_reads.bam
        -t masked_primers.txt
    ]]></command>
    <inputs>
        <param name="input_bam" argument="-i" type="data" format="bam"
        label="Bam input"
        help="BAM dataset, preprocessed with ivar trim, to remove reads from" />
        <param name="variants_tsv" type="data" format="tabular"
        label="Variants input"
        help="This dataset will be scanned for variants that affect primer binding sites and needs to be in tabular format with affected chromosome names in the first, and positions in the second column. If there is a header line, the name of the second column should be POS." />
        <param name="input_bed" argument="-b" type="data" format="bed" label="Primer binding sites information"
        help="The same six-column BED dataset that served as input to ivar trim"/>
        <param name="amplicon_info" type="data" format="tabular"
        label="Primer to amplicon assignment info"
        help="This input should consist of one line per amplicon with the tab-separated names of all primers used to generate that amplicon."/>
    </inputs>
    <outputs>
        <data name="output_bam" format="bam" label="${tool.name} on ${on_string}" from_work_dir="removed_reads.bam"/>
    </outputs>
    <tests>
        <test>
            <param name="input_bam" value="zika/Z52_a.trimmed.sorted.bam"/>
            <param name="variants_tsv" value="zika/primers_Z52_consensus.tsv"/>
            <param name="input_bed" value="zika/db/zika_primers_consensus.bed"/>
            <param name="amplicon_info" value="zika/db/pair_information.tsv"/>
            <output name="output_bam" file="zika/Z52_a.masked.bam" compare="sim_size" delta="100000" />
        </test>
    </tests>
    <help><![CDATA[
This Galaxy tool combines the functionality of ``ivar getmasked`` and
``ivar removereads``. No separate ``ivar getmasked`` step is required when
using this tool.

The wrapper takes as input a BAM dataset of aligned and sorted reads, from
which the primers listed in the primer binding sites BED input have been
trimmed with ``ivar trim``.

From this input it will remove reads that come from amplicons that have been
generated with one or more primers that may have been affected in their binding
by variants listed in the variants input file.

.. class:: Warning mark

   Preprocessing of the BAM input with ivar trim is essential for this tool to
   work because only ``ivar trim`` can add required primer information to the
   BAM auxillary data of every read.
        
ivar documentation can be found at `<https://andersen-lab.github.io/ivar/html/manualpage.html>`__.
    ]]></help>
    <expand macro="citations" />
</tool>