view cactus_export.xml @ 13:d7ce0ec78e51 draft

planemo upload for repository https://github.com/usegalaxy-au/tools-au commit 2d431863824af49c82ff2ae318abee3b16141a4e
author galaxy-australia
date Wed, 05 Jul 2023 03:25:47 +0000
parents aaa0d6a8b808
children c44f824c051a
line wrap: on
line source

<tool id="cactus_export" name="Cactus: export" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" license="MIT">
    <description>whole-genome multiple sequence alignment to other formats</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="xrefs"/>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        export TMPDIR=\${_GALAXY_JOB_TMP_DIR} &&

        ## check if the reference level was specified
        #if $export_select.format in ['maf_selector', 'vg_selector']:
            #if $export_select.ref_level == '':
                echo "You must provide a reference level" &&
                exit 1
            #end if
        #end if

        ln -s '$hal_file' alignment.hal 

        ## make a MAF
        #if $export_select.format == 'maf_selector':
            &&
            hal2maf 
            --refGenome $export_select.ref_level
            alignment.hal
            alignment.maf
        #end if

        ## make an assemblyHub
        #if $export_select.format == 'ah_selector':
            &&
            hal2assemblyHub.py 
            --maxCores  \${GALAXY_SLOTS:-4}
            --maxMemory \${GALAXY_MEMORY_MB:-8192}M
            ./jobStore
            alignment.hal
            assemblyhub
            &&
            tar -cv assemblyhub > assemblyhub.tar
        #end if

        ## make a VG
        #if $export_select.format == 'vg_selector':
            &&
            hal2vg alignment.hal
            --progress 
            > alignment.pg
        #end if

    ]]></command>
    <inputs>
        <param name="hal_file" type="data" format="h5" label="HAL file" help="Multiple-genome alignment generated by Cactus" />
        <conditional name="export_select">
            <param name="format" type="select" label="Output format" help="The type of output you want to export. Run this tool once for each output format.">
                <option value="maf_selector" selected="true">MAF file</option>
                <option value="ah_selector">Assembly Hub</option>
                <option value="vg_selector">VG file</option>
            </param>
            <when value="maf_selector">
                <param name="ref_level" type="text" value="" label="Reference genome" help="Specify one of the Input Genomes as the reference level. This must match the label used in 'Genome Label'." />
            </when>
            <when value="ah_selector">
            </when>
            <when value="vg_selector">
                <param name="ref_level" type="text" value="" label="Reference genome" help="Specify one of the Input Genomes as the reference level. This must match the label used in 'Genome Label'." />
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="out_maf" format="maf" from_work_dir="alignment.maf" label="${tool.name} on ${on_string} (MAF file)" >
            <filter>export_select['format'] == 'maf_selector'</filter>
        </data>
        <data name="out_vg" format="vg" from_work_dir="alignment.pg" label="${tool.name} on ${on_string} (VG file)" >
            <filter>export_select['format'] == 'vg_selector'</filter>
        </data>
        <data name="out_ah" format="tar" from_work_dir="assemblyhub.tar" label="${tool.name} on ${on_string} (Assembly Hub)" >
            <filter>export_select['format'] == 'ah_selector'</filter>
        </data>
    </outputs>
    <tests>
        <!-- this fails because no reference level is set -->
        <test expect_failure="true">
            <conditional name="export_select">
                <param name="format" value="maf_selector" />
            </conditional>
            <param name="hal_file" ftype="h5" value="evolverMammals.hal" />
        </test>
        <!-- within-species mode -->
        <test expect_num_outputs="1">
            <conditional name="export_select">
                <param name="ref_level" value="simMouse_chr6" />
                <param name="format" value="maf_selector" />
            </conditional>
            <param name="hal_file" ftype="h5" value="within.hal" />
            <output name="out_maf" file="set_reference.maf" />
        </test>
        <!-- between-species  -->
        <test expect_num_outputs="1">
            <conditional name="export_select">
                <param name="ref_level" value="simMouse_chr6" />
                <param name="format" value="maf_selector" />
            </conditional>
            <param name="hal_file" ftype="h5" value="evolverMammals_noroot.hal" />
            <output name="out_maf" file="evolverMammals_noroot.maf" />
        </test>
        <!-- assembly hub format -->
        <test expect_num_outputs="1">
            <conditional name="export_select">
                <param name="format" value="ah_selector" />
            </conditional>
            <param name="hal_file" ftype="h5" value="within.hal" />
            <output name="out_ah">
                <assert_contents>
                    <has_archive_member path="assemblyhub/hub.txt"/>
                </assert_contents>
            </output>
        </test>
        <!-- vg format -->
        <test expect_num_outputs="1">
            <conditional name="export_select">
                <param name="format" value="vg_selector" />
                <param name="ref_level" value="simMouse_chr6" />
            </conditional>
            <param name="hal_file" ftype="h5" value="within.hal" />            
            <output name="out_vg">
                <assert_contents>
                        <has_size value="860452" delta="200000" />
                </assert_contents>
            </output>
        </test>
        <!-- gfa format (gfa2): not implemented -->
    </tests>
    <help><![CDATA[
**What it does**

Converts the HAL output from `Cactus whole-genome multiple sequence
aligner <root?tool_id=cactus_cactus>`__ into other formats.

**Input**

A `HAL
file <https://github.com/ComparativeGenomicsToolkit/cactus#using-the-output>`__
from `Cactus <root?tool_id=cactus_cactus>`__.

**Output**

Currently, you can export a pangenome in VG format, for use with
`vg <https://github.com/vgteam/vg>`__, or Multiple Alignment Format
(MAF). Note that these files are **reference-based**, so it will contain
alignments to a single reference from your list of inputs (i.e. not a
graph). You have to provide this with the ‘reference genome’ option.

You can also export an Assembly Hub for use with the UCSC Genome Browser.
]]></help>
    <expand macro="citations"/>
</tool>