view hal_maf2hal.xml @ 0:2900728b299a draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/haltools commit 6244b9d15a5ad97ae20191e2f8fbafe2050c3cac
author iuc
date Fri, 06 Feb 2026 10:37:03 +0000
parents
children
line wrap: on
line source

<tool id="hal_maf2hal" name="maf2hal" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>imports MAF into HAL database</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/> 
    <expand macro="stdio"/>
    <command detect_errors="aggressive">
        <![CDATA[
        #if $mode.append == 'true':
            ## If an input HAL file is provided to append to, ensure that it is not modified.
            cp '$mode.input_hal' writable_hal.hal && 
        #end if
        ## Uncompress input
        #if $input_maf.ext.endswith('.gz'):
            gunzip -c '$input_maf' > uncompressed_input.maf &&
        #else if $input_maf.ext.endswith('.bz2'):
            bunzip2 -c '$input_maf' > uncompressed_input.maf &&
        #else
            cp '$input_maf' uncompressed_input.maf &&
        #end if
        maf2hal
            #if $refGenome:
                --refGenome '$refGenome'
            #end if
            #if $targetGenomes:
                --targetGenomes '$targetGenomes'
            #end if
            #if $mode.append == 'true':
                --append
            #else if $mode.backend.format == 'mmap':
                --format 'mmap'
                --mmapFileSize $mode.backend.mmapFileSize
            #end if
            uncompressed_input.maf writable_hal.hal 
    ]]></command>
    <inputs>
        <param name="input_maf" type="data" format="maf,maf.gz,maf.bz2" label="MAF file"/>
        <param argument="--refGenome" type="text" value="" optional="true" label="Reference genome" help="Name of the reference genome in the MAF file (first found if empty)">
            <expand macro="sanitizer_default"/>
            <expand macro="validator_trim"/>
        </param> 
        <expand macro="params_targetGenomes_optional"/>
        <conditional name="mode">
            <param name="append" type="select" label="Output options">
                <option value="false" selected="true">Create a new HAL file (default)</option>
                <option value="true">Append MAF as subtree to an existing HAL file (--append)</option>
            </param>
            <when value="false">
                <expand macro="hal_backend_format"/>   
            </when>
            <when value="true">
                <expand macro="input_hal"/>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="output_file" format="hal" label="${tool.name} on ${on_string}: HAL file" from_work_dir="writable_hal.hal"/>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_maf" value="maf2halTest.maf"/>
            <output name="output_file" ftype="hal">
                <assert_contents>
                    <has_size min="50000"/>
                </assert_contents>
            </output>
            <assert_stdout>
                <has_text text="Total Number of blocks in maf: 6"/>
            </assert_stdout>
        </test>
        <test expect_num_outputs="1">
            <param name="input_maf" value="maf2halTest.maf.gz"/>
            <output name="output_file" ftype="hal">
                <assert_contents>
                    <has_size min="50000"/>
                </assert_contents>
            </output>
            <assert_stdout>
                <has_text text="Total Number of blocks in maf: 6"/>
            </assert_stdout>
        </test>
        <test expect_num_outputs="1">
            <param name="input_maf" value="maf2halTest.maf.bz2"/>
            <output name="output_file" ftype="hal">
                <assert_contents>
                    <has_size min="50000"/>
                </assert_contents>
            </output>
            <assert_stdout>
                <has_text text="Total Number of blocks in maf: 6"/>
            </assert_stdout>
        </test>
        <test expect_num_outputs="1">
            <param name="input_maf" value="maf2halTestAppend.maf"/>
            <conditional name="mode">
                <param name="append" value="true"/>
                <param name="input_hal" value="maf2halTestAppend.hal"/>
            </conditional>
            <output name="output_file" ftype="hal">
                <assert_contents>
                    <has_size min="70000"/>
                </assert_contents>
            </output>
            <assert_stdout>
                <has_text text="Total Number of blocks in maf: 1"/>
            </assert_stdout>
        </test>
        <!-- 
        Disabled until mmap HAL format is allowed
        <test expect_num_outputs="1">
            <param name="input_maf" value="maf2halTest.maf"/>
            <conditional name="mode">
                <param name="append" value="false"/>
                <conditional name="inputFormat">
                    <param name="type" value="mmap"/>
                    <param name="mmapFileSize" value="1"/>
                </conditional>
            </conditional>
            <assert_stdout>
                <has_text text="Total Number of blocks in maf: 6"/>
            </assert_stdout>
        </test>
        -->
    </tests>
    <help><![CDATA[
maf2hal takes a MAF alignment as input and produces a HAL database as output.
It can build a new HAL file or attach the MAF as a subtree if the reference genome already exists as a leaf. 
You can specify the reference genome and limit import to selected target genomes. 

-----

.. class:: warningmark

Creating or importing a HAL file in mmap format can result in a corrupted HAL file. Run halValidate on the output HAL file before further analysis.

.. class:: warningmark

At the moment, creating a HAL file in mmap format is disabled. The creation in HDF5 format is enforced.
    ]]></help>
    <expand macro="citation"/>
    <expand macro="creator"/>
</tool>