view hal_halSnps.xml @ 0:116020f2c8f3 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:35:08 +0000
parents
children
line wrap: on
line source

<tool id="hal_halsnps" name="halSnps" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>counts SNPs between orthologous positions in multiple genomes</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/> 
    <expand macro="stdio"/>
    <command detect_errors="aggressive"><![CDATA[
        set -o pipefail; ## Sets the pipeline’s exit code to halSnps on failure.
        ( ## echo headers for specific numerical data
        echo -e "targetGenome\ttotalSnps\ttotalCleanOrthologousPairs";
        halSnps
            #if $mode.export == 'sequence':
                --refSequence '$mode.sequence'
            #end if
            --start $start
            --length $length
            --minSpeciesForSnp $minSpeciesForSnp
            $noDupes
            $unique
            '$input_hal' '$refGenome' '$targetGenomes' 
            | tr ' ' '\t' ## Pipes specific output to replace space with tabs. Output is mostly numerical, and Genome names contain no commas, as this would invalidate the HAL Newick tree.
        ) > '$out_file'
    ]]></command>
    <inputs>        
        <expand macro="input_hal"/> 
        <expand macro="params_refGenome"/>
        <expand macro="params_targetGenomes"/>
        <conditional name="mode">
            <param name="export" type="select" label="Process options">
                <option value="default" selected="true">Process all sequences (default)</option>
                <option value="sequence">Process a specific sequence (--refSequence)</option>
            </param>
            <when value="default"/>
            <when value="sequence">
                <expand macro="params_sequence"/>
            </when>
        </conditional>
        <expand macro="params_start"/>
        <expand macro="params_length"/>
        <param argument="--noDupes" type="boolean" truevalue="--noDupes" falsevalue="" checked="false" label="No duplicates" help="Do not consider paralogies while mapping"/>
        <param argument="--minSpeciesForSnp" type="integer" min="1" value="1" label="Minimum number of species" help="Minimum number of species that must have a different base than the reference for a SNP to be reported in the output"/>
        <param argument="--unique" type="boolean" truevalue="--unique" falsevalue="" checked="false" label="Unique" help="Whether to ignore columns that are not canonical on the reference genome"/> 
    </inputs>
    <outputs>
        <data name="out_file" format="tabular" label="${tool.name} on ${on_string}"/>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <param name="refGenome" value="Genome_0"/>
            <param name="targetGenomes" value="Genome_0,Genome_1,Genome_2"/>
            <output name="out_file" ftype="tabular">
                <assert_contents>
                    <has_line line="targetGenome&#009;totalSnps&#009;totalCleanOrthologousPairs"/>   
                    <has_line line="Genome_0&#009;0&#009;1758"/>    
                    <has_line line="Genome_2&#009;0&#009;586"/>
                    <has_n_lines n="4"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <param name="refGenome" value="Genome_0"/>
            <param name="targetGenomes" value="Genome_0,Genome_1,Genome_2"/>
            <param name="noDupes" value="true"/>
            <output name="out_file" ftype="tabular">
                <assert_contents>
                    <has_line line="targetGenome&#009;totalSnps&#009;totalCleanOrthologousPairs"/>   
                    <has_line line="Genome_0&#009;0&#009;0"/>    
                    <has_line line="Genome_2&#009;0&#009;1465"/>
                    <has_n_lines n="4"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <param name="refGenome" value="Genome_0"/>
            <param name="targetGenomes" value="Genome_0,Genome_1,Genome_2"/>
            <param name="start" value="10"/>
            <param name="length" value="50"/>
            <output name="out_file" ftype="tabular">
                <assert_contents>
                    <has_line line="targetGenome&#009;totalSnps&#009;totalCleanOrthologousPairs"/>   
                    <has_line line="Genome_0&#009;0&#009;50"/>    
                    <has_line line="Genome_2&#009;0&#009;50"/>
                    <has_n_lines n="4"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="input_hal" value="halTest.hal"/>
            <param name="refGenome" value="Genome_0"/>
            <param name="targetGenomes" value="Genome_0,Genome_1,Genome_2"/>
            <conditional name="mode">
                <param name="export" value="sequence"/>
                <param name="sequence" value="Genome_0_seq"/>
            </conditional>
            <param name="start" value="10"/>
            <param name="length" value="500"/>
            <output name="out_file" ftype="tabular">
                <assert_contents>
                    <has_line line="targetGenome&#009;totalSnps&#009;totalCleanOrthologousPairs"/>   
                    <has_line line="Genome_0&#009;0&#009;500"/>    
                    <has_line line="Genome_2&#009;0&#009;283"/>
                    <has_n_lines n="4"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
halSnps counts SNPs between orthologous positions across multiple genomes in a HAL alignment. 
The tool compares each position in a reference genome against one or more target genomes and reports how many SNPs occur, along with the number of clean orthologous positions examined.
    ]]></help>
    <expand macro="citation"/>
    <expand macro="creator"/>
</tool>