view hal_hal2vg.xml @ 1:d989142ead55 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/haltools commit f46096b336bf460424143fc9d633b5e7c20bf1cf
author iuc
date Thu, 05 Mar 2026 11:33:07 +0000
parents 12d2e1a25cd6
children
line wrap: on
line source

<tool id="hal_hal2vg" name="hal2vg" version="1.1.8+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>converts HAL to a vg-compatible sequence graph</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <requirements>
        <requirement type="package" version="1.1.8">hal2vg</requirement>
    </requirements>
    <expand macro="stdio"/>
    <command detect_errors="aggressive"><![CDATA[
        hal2vg
            #if $rootGenome:
                --rootGenome '$rootGenome'
            #end if
            #if $mode.reference == '--refGenomes':
                --refGenomes '$mode.refGenomes'
            #end if
            #if $selection.filter == '--targetGenomes':
                --targetGenomes '$selection.targetGenomes'
            #else if $selection.filter == '--ignoreGenomes':
                --ignoreGenomes '$selection.ignoreGenomes'
            #end if
            #if $outputFormat == 'hg':
                --outputFormat 'hg'
            #end if
            --chop $chop
            $noAncestors
            '$input_hal' > '$output_file'
    ]]></command>
    <inputs>
        <expand macro="input_hal"/>
        <conditional name="mode">
            <param name="reference" type="select" label="Genomes to treat as reference paths" help="Specify genomes to treat as reference paths with all others as haplotype paths">
                <option value="" selected="true">All genomes (default)</option>
                <option value="--refGenomes">Specific reference genomes (--refGenomes)</option>
            </param>
            <when value=""/>
            <when value="--refGenomes">
                <param name="refGenomes" type="text" value="" label="List of genomes" help="Enter a comma-separated (no spaces) list of genomes to use as reference genomes">
                    <expand macro="sanitizer_default"/>
                    <expand macro="validator_comma_list"/>
                </param>
            </when>
        </conditional>
        <expand macro="params_rootGenome_optional"/>
        <conditional name="selection">
            <param name="filter" type="select" label="Genome selection filters">
                <option value="" selected="true">All genomes (default)</option>
                <option value="--targetGenomes">Specific genomes to target (--targetGenomes)</option>
                <option value="--ignoreGenomes">Specific genomes to ignore (--ignoreGenomes)</option>
            </param>
            <when value=""/>
            <when value="--targetGenomes">
                <expand macro="params_targetGenomes"/>
            </when>
            <when value="--ignoreGenomes">
                <param name="ignoreGenomes" type="text" value="" label="List of genome" help="Comma-separated (no spaces) list of genomes to ignore">
                    <expand macro="sanitizer_default"/>
                    <expand macro="validator_comma_list"/>
                </param>
            </when>
        </conditional>
        <param argument="--noAncestors" type="boolean" truevalue="--noAncestors" falsevalue="" checked="false" label="No ancestors" help="Don't write ancestral paths, nor sequence exclusive to ancestral genomes"/>
        <param argument="--chop" type="integer" min="0" value="0" label="Chop" help="Chop up nodes in output graph so they are not longer than given length"/>
        <param name="outputFormat" type="select" label="Output format">
            <option value="pg" selected="true">pg (default)</option>
            <option value="hg">hg</option>
        </param>
    </inputs>
    <outputs>
        <data name="output_file" format="hal.pg" label="${tool.name} on ${on_string}: Graph">
            <change_format>
                <when input="outputFormat" value="hg" format="hal.hg"/>
            </change_format>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <output name="output_file" ftype="hal.pg" file="hal2vg_output.pg"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <param name="outputFormat" value="hg"/>
            <output name="output_file" ftype="hal.hg" file="hal2vg_output.hg"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <param name="rootGenome" value="Genome_0"/>
            <conditional name="mode">
                <param name="reference" value="--refGenomes"/>
                <param name="refGenomes" value="Genome_0,Genome_1"/>
            </conditional>
            <output name="output_file" ftype="hal.pg" file="hal2vg_refGenomes_output.pg"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <param name="noAncestors" value="true"/>
            <output name="output_file" ftype="hal.pg" file="hal2vg_noAncestors_output.pg"/>
        </test>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <conditional name="selection">
                <param name="filter" value="--targetGenomes"/>
                <param name="targetGenomes" value="Genome_0,Genome_1"/>
            </conditional>
            <param name="chop" value="10"/>
            <output name="output_file" ftype="hal.pg" file="hal2vg_targetGenomes_chop_output.pg"/>
        </test>
    </tests>
    <help><![CDATA[
hal2vg converts a HAL file to a vg-compatible sequence graph.
The tool generates a graph representation where genomes can be treated as reference paths or haplotypes, optionally excluding ancestral sequences or selected genomes. 
Control node length via chopping, select target or reference genomes, and choose the output format (PG or HG). 

Use it for constructing genome graphs for downstream analyses such as variant calling, pangenome visualization, or graph-based mapping.
    ]]></help>
    <citations>
        <citation type="doi">10.1038/s41587-023-01793-w</citation>
    </citations>
    <expand macro="creator"/>
</tool>