view bam2fastx.xml @ 0:61a6b93ee6e1 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/pbtk commit cd34bba7aafb92ea993d4ef17a3669957de7c537
author iuc
date Tue, 12 Mar 2024 15:42:13 +0000
parents
children 7f7f2ee03430
line wrap: on
line source

<tool id="bam2fastx" name="PacBio bam2fastx" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.01">
    <description>PacBio BAM to Fastx</description>
    <macros>
        <token name="@TOOL_VERSION@">3.1.1</token>
        <token name="@VERSION_SUFFIX@">0</token>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">pbtk</requirement>
    </requirements>
    <command><![CDATA[
mkdir -p output_files/ &&
ln -s '$input_bam' input.bam &&
pbindex input.bam &&
#if $output_format == "fasta_gz":
    bam2fasta -o output
#elif $output_format == "fastq_gz":
    bam2fastq -o output
#end if
input.bam
--num-threads  "\${GALAXY_SLOTS:-1}"  &&
#if $output_format == "fasta":
    mv output.fasta.gz '$output_fasta_gz'
#elif $output_format == "fastq":
    mv output.fastq.gz '$output_fastq_gz'
#end if
    ]]></command>
    <inputs>
        <param name="input_bam" type="data" format="unsorted.bam" label="PacBio Bam file "/>
        <param name="output_format" type="select" label="Output Format" help="Output a fasta.gz or fastq.gz">
            <option value="fastq_gz">fastq.gz</option>
            <option value="fasta_gz">fasta.gz</option>
        </param>
    </inputs>
    <outputs>
        <data name="output_fasta_gz" format="fasta.gz" label="${tool.name} on ${on_string}: Fasta">
            <filter>output_format == "fasta"</filter>
        </data>
        <data name="output_fastq_gz" format="fastqsanger.gz" label="${tool.name} on ${on_string}: Fastq">
            <filter>output_format == "fastq"</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <param name="input_bam" ftype="unsorted.bam" value="sample.bam"/>
            <param name="output_format" value="fastq_gz" />
            <output name="output_fastq_gz">
                <assert_contents>
                    <has_size min="9000" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1" >
            <param name="input_bam" ftype="bam" value="sample.bam"/>
            <param name="output_format" value="fasta_gz" />
            <output name="output_fasta_gz" >
                <assert_contents>
                    <has_size min="9000" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
Convert a PacBio BAM file to Fastq or Fasta file.
    ]]></help>
        <citations>
            <citation type="bibtex">
                @misc{githubpbtk,
                author = {},
                year = {2024},
                title = {pbtk},
                publisher = {GitHub},
                journal = {GitHub repository},
                url = {https://github.com/PacificBiosciences/pbtk},
                }
            </citation>
        </citations>
 </tool>