view chira_map.xml @ 9:771cffc56c87 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/chira commit 51f68a6d51d9e87f8e54021ce760b1506a3589b8"
author iuc
date Sun, 14 Jun 2020 17:37:38 -0400
parents b91f9fcd9fc7
children 95ddee768b61
line wrap: on
line source

<tool id="chira_map" name="ChiRA map" version="@WRAPPER_VERSION@0">
    <description>map reads to trascriptome</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="aggressive"><![CDATA[
        chira_map.py -b
        -a '$alignment.aligner'
        -i '$query'
        #if str($alignment.aligner) == "bwa":
            -s '$alignment.stranded'
            -l1 '$alignment.seed_length1'
            -l2 '$alignment.seed_length2'
            -s1 '$alignment.align_score1'
            -s2 '$alignment.align_score2'
            -ma1 '$alignment.match1'
            -mm1 '$alignment.mismatch1'
            -ma2 '$alignment.match2'
            -mm2 '$alignment.mismatch2'
            -go1 '$alignment.gapo1'
            -ge1 '$alignment.gape1'
            -go2 '$alignment.gapo2'
            -ge2 '$alignment.gape2'
            -h1 '$alignment.nhits1'
            -h2 '$alignment.nhits2'

        #else if str($alignment.aligner) == "clan":
            -s2 '$alignment.align_score'
            -co '$alignment.chimeric_overlap'
        #end if
        #if str($reference.ref_type) == "single":
            -f1 '$reference.ref_fasta'
        #else if str($reference.ref_type) == "split":
            -f1 '$reference.ref_fasta1'
            -f2 '$reference.ref_fasta2'
        #end if
        -p "\${GALAXY_SLOTS:-4}"
        -o ./

    ]]></command>

    <inputs>
        <param format="fasta" name="query" type="data" label="Input FASTA file"
               help="Input fasta file"/>
        <conditional name="reference">
            <param name="ref_type" type="select" label="Single or split reference?"
                   help="Use single if you have all the transcripts in single fasta file. Use split, if you split the
                   reference into two such that each chimeric read arm corresponds to one of them">
                <option value="split">Split reference</option>
                <option value="single">Single reference</option>
            </param>
            <when value="split">
                <param format="fasta" name="ref_fasta1" type="data" label="Reference FASTA file"
                       help="Reference fasta file"/>
                <param format="fasta" name="ref_fasta2" type="data" label="Second reference FASTA file"
                       help="Second reference fasta file."/>
            </when>
            <when value="single">
                <param format="fasta" name="ref_fasta" type="data" label="Reference FASTA file"
                       help="Reference fasta file"/>
            </when>
        </conditional>
        <conditional name="alignment" label="Aligner to use">
            <param name="aligner" type="select">
                <option value="bwa">BWA-MEM</option>
                <option value="clan">CLAN</option>
            </param>
            <when value="bwa">
                <param name="stranded" type="select" label="Map reads to">
                    <option value="fw">Transcript strand only</option>
                    <option value="rc">Reverse compliment of transcript strand only</option>
                    <option value="both">Try both strands</option>
                </param>
                <param name="seed_length1" type="integer" value="12" label="Seed length 1" min="1"
                       help="Seed length for 1st mapping iteration. bwa-mem parameter -k"/>
                <param name="seed_length2" type="integer" value="16" label="Seed length 2" min="1"
                      help="Seed length for 2nd mapping iteration. bwa-mem parameter -k"/>
                <param name="align_score1" type="integer" value="18" min="1"
                       label="Minimum alignmnet score for 1st mapping iteration" help="bwa-mem parameter '-T'"/>
                <param name="align_score2" type="integer" value="16" min="1"
                       label="Minimum alignmnet score for 2nd mapping iteration" help="bwa-mem parameter '-T'"/>
                <param name="match1" type="integer" value="1" label="Matching score for 1st mapping iteration"/>
                <param name="mismatch1" type="integer" value="4" label="Mismatch penalty for 1st mapping iteration"/>
                <param name="match2" type="integer" value="1" label="Matching score for 2nd mapping iteration"/>
                <param name="mismatch2" type="integer" value="6" label="Mismatch penalty for 2nd mapping iteration"/>
                <param name="gapo1" type="integer" value="6" label="Gap opening penalty for 1st mapping iteration"/>
                <param name="gape1" type="integer" value="1" label="Gap extension penalty for 1st mapping iteration"/>
                <param name="gapo2" type="integer" value="100" label="Gap opening penalty for 2nd mapping iteration"/>
                <param name="gape2" type="integer" value="100" label="Gap extension penalty for 2nd mapping iteration"/>
                <param name="nhits1" type="integer" value="50"
                       label="Maximum number of allowed multi hits per read in 1st iteration"/>
                <param name="nhits2" type="integer" value="100"
                       label="Maximum number of allowed multi hits per read in 2nd iteration"/>
            </when>
            <when value="clan">
                <param name="align_score" type="integer" value="10" label="Minimum length for each fragment" min="1"
                      help="Minimu length of the read segment that needs to be mapped. clan_search parameter '-l'"/>
                <param name="chimeric_overlap" type="integer" value="2" label=" Maximum number of bases allowed
                            between the chimericsegments of a read"/>
            </when>
        </conditional>
    </inputs>

    <outputs>
        <data format="bed" name="mapped_bed" from_work_dir="sorted.bed" label="ChiRA aligned BED on ${on_string}"/>
        <data format="fasta" name="unmapped_fasta" from_work_dir="unmapped.fasta"
              label="ChiRA unmapped FASTA on ${on_string}">
            <filter>alignment['aligner'] == "bwa"</filter>
        </data>
    </outputs>

    <tests>
        <!-- Test: Map with BWA-mem -->
        <test expect_num_outputs="2">
            <param name="seed_length1" value="12"/>
            <param name="seed_length2" value="6"/>
            <param name="align_score1" value="18"/>
            <param name="align_score2" value="10"/>
            <param name="aligner" value="bwa"/>
            <param name="query" value="reads.fasta"/>
            <param name="ref_type" value="split"/>
            <param name="ref_fasta1" value="ref1.fasta"/>
            <param name="ref_fasta2" value="ref2.fasta"/>
            <param name="unmapped" value="True"/>
            <output name="mapped_bed" >
                <assert_contents>
                    <has_text_matching expression="mmu-miR-6898-5p\t11\t21\t2\|2,mmu-miR-6898-5p,11,21,\+,10M39S\t1\t\+" />
                </assert_contents>
            </output>
            <output name="unmapped_fasta" >
                <assert_contents>
                    <has_text_matching expression="AAAAGACTCTGTAGACATGGCTGGTCTTGAACTCACAGAGATTTGTCTGCCTTTC" />
                </assert_contents>
            </output>
        </test>
        <!-- Test: Map with CLAN -->
        <test expect_num_outputs="1">
            <param name="aligner" value="clan"/>
            <param name="query" value="reads.fasta"/>
            <param name="ref_type" value="split"/>
            <param name="ref_fasta1" value="ref1.fasta"/>
            <param name="ref_fasta2" value="ref2.fasta"/>
            <param name="unmapped" value="True"/>
            <output name="mapped_bed" >
                <assert_contents>
                    <has_text_matching expression="mmu-miR-20a-5p\t0\t23\t3\|2,mmu-miR-20a-5p,0,23,\+,5S23M27S\t1\t\+" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help>

.. class:: infomark

**What it does**

This tool handles the mapping of the reads to reference transcriptome. User can choose between the bwa-mem and CLAN alignment tools.

**Inputs**

* A fasta file containing reads
* A reference fasta file containing transcript sequences
* An optional second reference fasta file, incase if  you split your reference into two

**Output**

* BED file containing the alignments
* Optional unmapped FASTA file

    </help>
    <expand macro="citations" />
</tool>