view cat_bins.xml @ 3:0e63d03c8790 draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cat commit 47be73f0ca2b3a3bcb79a1fa7cf15a63c7facd19
author iuc
date Fri, 16 Feb 2024 10:45:27 +0000
parents 31853794ace2
children
line wrap: on
line source

<tool id="cat_bins" name="CAT bins" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>annotate with taxonomic classification</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="bio_tools"/>
    <expand macro="requirements" />
    <expand macro="version_command" />
    <command detect_errors="exit_code"><![CDATA[
    #import re
    #set $bin_dir = None
    #if len($mags) > 1:
        #set $bin_dir = 'inputs'
        mkdir -p $bin_dir &&
        #for mag in $mags:
            #set input_identifier = re.sub('[^\s\w\-]', '_', str($mag.element_identifier))
            ln -s '$mag' '${bin_dir}/${input_identifier}.FASTA' &&
        #end for
    #else
        #set $bin_file = re.sub('[^\s\w\-]', '_', str($mags[0].element_identifier))
        ln -s $mags[0] '$bin_file' &&
    #end if
    CAT 
    #if $bin_dir
        bins -s '.FASTA' -b '$bin_dir'
    #else
        bin -b '$bin_file'
    #end if 
    @CAT_DB@
    @USE_INTERMEDIATES@
    @CUSTOM_SETTINGS@
    @DIAMOND_OPTIONS@
    && @TXT2TSV@ *.ORF2LCA.txt *.bin2classification.txt
    #if len($mags) > 1:
        #set pat = '$' + '{i/concatenated./}'
        && (for i in *.concatenated.*; do ln -s "\$i" "${pat}"; done)
    #end if
    @ADD_NAMES@
    @SUMMARISE@
    ]]></command>
    <inputs>
        <param name="mags" type="data" format="fasta" multiple="true" label="metagenome assembled genomes (MAGs/bins)"/>
        <expand macro="cat_db" />
        <expand macro="use_intermediates" />
        <expand macro="custom_settings_bins" />
        <expand macro="diamond_options" />
        <expand macro="add_names" />
        <expand macro="summarise" />
        <expand macro="select_bat_outputs" />
    </inputs>
    <outputs>
        <expand macro="outputs" />
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="mags" ftype="fasta" value="genome2.fna"/>
            <expand macro="test_catdb"/>
            <param name="select_outputs" value="bin2classification"/>
            <output name="bin2classification">
                <assert_contents>
                    <has_text text="666" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="mags" ftype="fasta" value="genome3.fna"/>
            <expand macro="test_catdb"/>
            <param name="select_outputs" value="bin2classification"/>
            <output name="bin2classification">
                <assert_contents>
                    <has_text text="1639" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="mags" ftype="fasta" value="genome2.fna,genome3.fna"/>
            <expand macro="test_catdb"/>
            <param name="select_outputs" value="bin2classification"/>
            <output name="bin2classification">
                <assert_contents>
                    <has_text text="666" />
                    <has_text text="1639" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="4">
            <param name="mags" ftype="fasta" value="genome2.fna,genome3.fna"/>
            <expand macro="test_catdb"/>
            <param name="select_outputs" value="bin2classification"/>
            <param name="select_outputs" value="predicted_proteins_faa"/>
            <param name="fraction" value="0.6"/>
            <conditional name="names">
                <param name="add_names" value="both"/>
            </conditional>
            <param name="summarise" value="classification"/>
            <output name="predicted_proteins_faa">
                <assert_contents>
                    <has_text text="contig_11394" />
                    <has_text text="contig_4403" />
                </assert_contents>
            </output>
            <output name="orf2lca_names">
                <assert_contents>
                    <has_text text="Vibrionaceae" />
                    <has_text text="Vibrio" />
                </assert_contents>
            </output>
            <output name="classification_summary">
                <assert_contents>
                    <has_text text="Gammaproteobacteria" />
                </assert_contents>
            </output>
        </test>

    </tests>
    <help><![CDATA[
**CAT bin** or **CAT bins**

Classify metagenomics assembled genomes. 

@COMMON_HELP@

**INPUTS**

One or more fasta files of metagenome assembled genomes.

@OUTPUTS_HELP@

**CAT bins**

Run Bin Annotation Tool (BAT) on a set of bins.

Required arguments:
  -b, --bin_folder       Path to directory containing bins.
  -d, --database_folder  Path to folder that contains database files.
  -t, --taxonomy_folder  Path to folder that contains taxonomy files.


@OPTIONS_HELP@

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