view concoct_coverage_table.xml @ 3:5ded3318cf8a draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/concoct commit 58c54ba18f478ce75fdfd6093921ba0b50af02ac
author iuc
date Wed, 03 Aug 2022 13:56:39 +0000
parents 6302656ed45d
children fd31cd168efc
line wrap: on
line source

<tool id="concoct_coverage_table" name="CONCOCT: Generate the input coverage table" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>for CONCOCT</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
#import re
mkdir 'mapping' &&
#if $mode.type == 'individual'
    #set $identifier = re.sub('[^\s\w\-\\.]', '_', str($mode.bamfile))
ln -s '$mode.bamfile' 'mapping/${identifier}.sorted.bam' &&
samtools index 'mapping/${identifier}.sorted.bam' 'mapping/${identifier}.bam.bai' &&
mv 'mapping/${identifier}.sorted.bam' 'mapping/${identifier}.bam' &&
#else
    #for $e in $mode.bamfiles
        #set $identifier = re.sub('[^\s\w\-\\.]', '_', str($e.element_identifier))
ln -s '$e' 'mapping/${identifier}.sorted.bam' &&
samtools index 'mapping/${identifier}.sorted.bam' 'mapping/${identifier}.bam.bai' &&
mv 'mapping/${identifier}.sorted.bam' 'mapping/${identifier}.bam' &&
    #end for
#end if
concoct_coverage_table.py
    '$bedfile'
    mapping/*.bam
    > '$output'
    ]]></command>
    <inputs>
        <param name="bedfile" type="data" format="bed" label="Contigs BEDFile" help="The file should have four columns representing: 'Contig ID, Start Position, End Position and SubContig ID' respectively. The Subcontig ID must contain the pattern 'concoct_part_[0-9]*' while the contigs which are not cutup cannot contain this pattern. This file can be generated by the CONCOCT: Cut up contigs tool."/>
        <conditional name="mode">
            <param name="type" type="select" label="Type of assembly used to generate the contigs" help="Information used to process the BAM files">
                <option value="individual">Individual assembly: 1 run per BAM file</option>
                <option value="co">Co-assembly: all BAM files processed together</option>
            </param>
            <when value="individual">
                <param name="bamfile" type="data" format="bam" label="Sorted BAM file" help="BAM file with mappings to the original contigs, after sorting"/>
            </when>
            <when value="co">
                <param name="bamfiles" type="data" format="bam" label="Sorted BAM files" multiple="true" help="BAM files with mappings to the original contigs, after sorting"/>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="output" format="tabular"/>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="bedfile" value="two_contigs-cut2.bed" ftype="bed"/>
            <conditional name="mode">
                <param name="type" value="individual"/>
                <param name="bamfile" value="ten_reads_two_contigs-s.bam" ftype="bam"/>
            </conditional>
            <output name="output" ftype="tabular">
                <assert_contents>
                    <has_text text="contig-21000001.concoct_part_0"/>
                    <has_n_lines n="11"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="bedfile" value="two_contigs-cut2.bed" ftype="bed"/>
            <conditional name="mode">
                <param name="type" value="co"/>
                <param name="bamfiles" value="ten_reads_two_contigs-s.bam,ten_reads_two_contigs-s_2.bam" ftype="bam"/>
            </conditional>
            <output name="output" ftype="tabular">
                <assert_contents>
                    <has_text text="cov_mean_sample_ten_reads_two_contigs-s.bam"/>
                    <has_text text="cov_mean_sample_ten_reads_two_contigs-s_2.bam"/>
                    <has_text text="contig-21000001.concoct_part_0"/>
                    <has_n_lines n="11"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Accepts an assembled (and possibly cut by the Cut fasta contigs tool) fasta contigs file and a tabular coverage histogram
file (produced by the bedtools Genomve Coverage tool) and outputs a tabular coverage file for use as the input to the
CONCOCT metagenome binning tool.

@HELP_OVERVIEW@
    ]]></help>
    <expand macro="citations"/>
</tool>