view bam2fastx.xml @ 2:0bfdf46e5e31 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/pbtk commit 7f0e2a6739769971f60c9719f1ef883c621d5ce1
author iuc
date Wed, 06 Nov 2024 22:22:30 +0000
parents 7f7f2ee03430
children
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.4.0</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_gz":
    mv output.fasta.gz '$output_fasta_gz'
#elif $output_format == "fastq_gz":
    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_gz"</filter>
        </data>
        <data name="output_fastq_gz" format="fastqsanger.gz" label="${tool.name} on ${on_string}: Fastq">
            <filter>output_format == "fastq_gz"</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" decompress="true">
                <assert_contents>
                    <has_text text="AATGCCTTATTAAGTTAAGAAATGGTTTTTTTTAAACTTACAGATGGAA" />
                </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" decompress="true">
                <assert_contents>
                    <has_text text="AATGCCTTATTAAGTTAAGAAATGGTTTTTTTTAAACTTACAGATGGAA" />
                </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>