view cut_up_fasta.xml @ 4:f80e693468d8 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/concoct commit 6bcf71ac8fae2a84117069dc00b3c4cac6d20fa5
author iuc
date Sat, 26 Aug 2023 02:42:32 +0000
parents 0132036a530a
children 4d8bc5dd9e95
line wrap: on
line source

<tool id="concoct_cut_up_fasta" name="CONCOCT: Cut up contigs" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>in non-overlapping or overlapping parts of equal length</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
## CONCOCT doesn't handle gzipped files.
#if $input_fasta.ext.endswith(".gz")
    gunzip -c '$input_fasta' > 'input.fa' &&
#else:
    ln -s '$input_fasta' 'input.fa' &&
#end if

cut_up_fasta.py
    'input.fa'
    --chunk_size $chunk_size
    --overlap_size $overlap_size
    $merge_last
    #if $bedfile
    --bedfile '$output_bed'
    #end if
    > '$output_fasta'
    ]]></command>
    <inputs>
        <param name="input_fasta" type="data" format="fasta,fasta.gz" label="Fasta contigs file"/>
        <param argument="--chunk_size" type="integer" min="0" value="10000"  label="Chunk size"/>
        <param argument="--overlap_size" type="integer" min="0" value="0" label="Overlap size" help="Zero value produces non-overlapping parts"/>
        <param argument="--merge_last" type="boolean" truevalue="--merge_last" falsevalue="" checked="false" label="Concatenate final part to last contig?"/>
        <param name="bedfile" type="boolean" label="Output bed file with exact regions of the original contigs corresponding to the newly created contigs?" help="Can be used as input to the SAMTools bedcov tool"/>
    </inputs>
    <outputs>
        <data name="output_fasta" format="fasta" label="${tool.name} on ${on_string}: Cut contigs"/>
        <data name="output_bed" format="bed" label="${tool.name} on ${on_string}: Contig parts with coordinates">
            <filter>bedfile</filter>
        </data>
    </outputs>
    <tests>
        <!-- default settings -->
        <test expect_num_outputs="1">
            <param name="input_fasta" value="two_contigs.fa"/>
            <param name="chunk_size" value="1000" />
            <param name="overlap_size" value="0"/>
            <param name="merge_last" value=""/>
            <param name="bedfile" value="false"/>
            <output name="output_fasta" ftype="fasta">
                <assert_contents>
                    <has_size value="12009"/>
                    <has_text text=">contig-21000001.concoct_part_0"/>
                    <has_n_lines n="24"/>
                </assert_contents>
            </output>
        </test>
        <!-- merge_last and  output bed file -->
        <test expect_num_outputs="2">
            <param name="input_fasta" value="two_contigs.fa"/>
            <param name="chunk_size" value="1000" />
            <param name="overlap_size" value="0"/>
            <param name="merge_last" value="--merge_last"/>
            <param name="bedfile" value="true"/>
            <output name="output_bed" ftype="bed">
                <assert_contents>
                    <has_size value="564"/>
                    <has_text text="contig-21000001.concoct_part_1"/>
                    <has_n_lines n="10"/>
                </assert_contents>
            </output>
            <output name="output_fasta" ftype="fasta">
                <assert_contents>
                    <has_size value="11943"/>
                    <has_text text=">contig-21000001.concoct_part_0"/>
                    <has_n_lines n="20"/>
                </assert_contents>
            </output>
        </test>
        <!-- Change chunk size, overlap size, fasta.gz as inputs -->
        <test expect_num_outputs="1">
            <param name="input_fasta" value="composition.fa.gz" ftype="fasta.gz"/>
            <param name="chunk_size" value="500" />
            <param name="overlap_size" value="499"/>
            <param name="merge_last" value=""/>
            <param name="bedfile" value="false"/>
            <output name="output_fasta" ftype="fasta">
                <assert_contents>
                    <has_size value="505603858"/>
                    <has_text text="116"/>
                    <has_n_lines n="2048636"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Accepts a fasta file containing contigs, cuts them into non-overlapping or overlapping parts of equal length, and produces a fasta file containing the cut contigs.  An optional output BED file can be produced, where the cut contigs are specified in terms of the original contigs.  Using this file as input to a BED coverage tool (e.g., bedtools Compute both the length and depth of coverage) will produce a file that can be used as input to the CONCOCT Create coverage table tool.

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