view hapog.xml @ 2:ee0d6e789958 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hapog commit 0da1ca313d02ca780a671247e434a424fa67887b
author iuc
date Sun, 28 Jan 2024 23:46:07 +0000
parents 7d56a813fd24
children 5287036a797a
line wrap: on
line source

<tool id="hapog" name="Hapo-G" profile="21.05" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>genome polishing</description>
    <macros>
        <token name="@TOOL_VERSION@">1.3.7</token>
        <token name="@VERSION_SUFFIX@">0</token>
    </macros>
    <xrefs>
        <xref type="bio.tools">hapog</xref>
    </xrefs>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">hapog</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
##Compute samtools memory settings like in samtools_sort
##use only 75% of available: https://github.com/samtools/samtools/issues/831
addmemory=\${GALAXY_MEMORY_MB_PER_SLOT:-768} &&
((addmemory=addmemory*75/100)) &&
hapog
--genome '${genome}'
--output output/

--threads \${GALAXY_SLOTS:-1}
--samtools-mem \$addmemory"M"

#if str( $reads.type ) == "short":
    #for $i in $reads.pe1
        --pe1 '${i}'
    #end for
    #for $i in $reads.pe2
        --pe2 '${i}'
    #end for
#elif str( $reads.type ) == "short_collection":
    #for $i in $reads.pecol
        --pe1 '${i.forward}'
        --pe2 '${i.reverse}'
    #end for
#elif str( $reads.type ) == "long":
    --single '${single}'
#elif str( $reads.type ) == "bam":
    -b '${bam}'
#end if

$u
    ]]></command>
    <inputs>
        <param argument="--genome" type="data" format="fasta" label="Genome assembly to polish"/>
        <conditional name="reads">
            <param name="type" type="select" label="Type of data used for polishing">
                <option value="short">Short (paired) reads</option>
                <option value="short_collection">Short (paired) reads collection</option>
                <option value="long">Long reads</option>
                <option value="bam">Pre-aligned reads (BAM)</option>
            </param>
            <when value="short">
                <param argument="--pe1" type="data" format="fastq,fastq.gz" multiple="true" label="First set of short reads"/>
                <param argument="--pe2" type="data" format="fastq,fastq.gz" multiple="true" label="Second set of short reads"/>
            </when>
            <when value="short_collection">
                <param name="pecol" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Paired collection of short reads"/>
            </when>
            <when value="long">
                <param argument="--single" type="data" format="fastq,fastq.gz" label="Long reads"/>
            </when>
            <when value="bam">
                <param name="bam" type="data" format="bam" label="Pre-aligned reads"/>
            </when>
        </conditional>
        <param argument="-u" type="boolean" truevalue="-u" falsevalue="" checked="False" label="Include unpolished sequences in final output" />
    </inputs>
    <outputs>
        <data format="fasta" name="output" label="${tool.name}: polished assembly from ${on_string}" from_work_dir="output/hapog_results/hapog.fasta"/>
        <data format="tsv" name="changes" label="${tool.name}: report of changes" from_work_dir="output/hapog_results/hapog.changes"/>
    </outputs>
    <tests>
        <test>
            <param name="genome" value="genome.fa" />
            <conditional name="reads">
                <param name="type" value="short" />
                <param name="pe1" value="fastq1.fq" />
                <param name="pe2" value="fastq2.fq" />
            </conditional>
            <output name="output" file="hapog_short.fasta" />
            <output name="changes" file="hapog_short.changes" />
        </test>
        <test>
            <param name="genome" value="genome.fa" />
            <conditional name="reads">
                <param name="type" value="short" />
                <param name="pe1" value="fastq1.fq.gz" />
                <param name="pe2" value="fastq2.fq.gz" />
            </conditional>
            <output name="output" file="hapog_short.fasta"/>
            <output name="changes" file="hapog_short.changes" />
        </test>
        <test>
            <param name="genome" value="genome.fa" />
            <conditional name="reads">
                <param name="type" value="long" />
                <param name="single" value="fastq1.fq" />
            </conditional>
            <output name="output" file="hapog_long.fasta" />
            <output name="changes" file="hapog_long.changes" />
        </test>
        <test>
            <param name="genome" value="genome.fa" />
            <conditional name="reads">
                <param name="type" value="long" />
                <param name="single" value="fastq1.fq.gz" />
            </conditional>
            <output name="output" file="hapog_long.fasta"/>
            <output name="changes" file="hapog_long.changes" />
        </test>
        <test>
            <param name="genome" value="genome.fa" />
            <conditional name="reads">
                <param name="type" value="bam" />
                <param name="bam" value="input.bam" />
            </conditional>
            <output name="output" file="hapog_bam.fasta"/>
            <output name="changes" file="hapog_bam.changes" />
        </test>
    </tests>
    <help><![CDATA[
Hapo-G uses alignments produced by BWA (or any other aligner that produces SAM files) to polish the consensus of a genome assembly.
]]></help>
    <citations>
        <citation type="doi">10.1093/nargab/lqab034</citation>
    </citations>
</tool>