view pbmm2.xml @ 3:e1d39a293b5a draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/pbmm2 commit e7eed8294ff51dbbd819ace7184b2a555677d770
author iuc
date Mon, 01 Jul 2024 18:29:00 +0000
parents 55b7b257e12f
children
line wrap: on
line source

<tool id="pbmm2" name="pbmm2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>map PacBio reads to a reference genome.</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="xrefs"/>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        ## set up files
        #set reads_fn = 'reads.' + $reads.ext
        ln -s '$reads' '$reads_fn' &&

        #if $reference_source.reference_source_selector == 'history':
            #set ref_fn = 'reference.fa'
            ln -f -s '$reference_source.ref_file' '$ref_fn' &&
        #else:
            #set ref_fn = $reference_source.ref_file.fields.path
        #end if

        ## run pbmm2
        pbmm2 align 
        -j \${GALAXY_SLOTS:-4}
        #if str($output_options.l):
            -l $output_options.l
        #end if
        #if str($output_options.N):
            -N $output_options.N
        #end if
        --preset $preset
        '$reads_fn' 
        '$ref_fn'
        out.aligned.bam
        --sort
    ]]></command>
    <inputs>
        <!-- from tools-iuc minimap2 wrapper -->
        <conditional name="reference_source">
            <param name="reference_source_selector" type="select" label="Will you select a reference genome from your history or use a built-in index?">
                <option value="cached">Use a built-in genome index</option>
                <option value="history">Use a genome from history and build index</option>
            </param>
            <when value="cached">
                <param name="ref_file" type="select" label="Using reference genome" help="Select genome from the list">
                    <options from_data_table="all_fasta">
                        <filter type="sort_by" column="2" />
                        <validator type="no_options" message="No reference genomes are available" />
                    </options>
                    <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
                </param>
            </when>
            <when value="history">
                <param name="ref_file" type="data" format="fasta" label="Use the following dataset as the reference sequence" help="You can upload a FASTA sequence to the history and use it as reference" />
            </when>
        </conditional>
        <param type="data" name="reads" format="fastq,fastq.gz,fasta,fasta.gz,bam" label="reads" help="PacBio reads in BAM or [gzipped] fasta or fastq format"/>
        <param argument="--preset" type="select"
                label="Set alignment mode">
                <option value="CCS">PacBio CCS or HiFi reads</option>
                <option value="SUBREAD">PacBio CLR or raw subreads</option>
                <option value="ISOSEQ">PacBio IsoSeq transcripts</option>
                <option value="UNROLLED">Align entire raw ZMW</option>
        </param>
        <section name="output_options" title="Output Options" help="Sets -l, -N, --strip,  --split-by-sample,  --unmapped, --short-sa-cigar" expanded="False">
            <param argument="-l" type="integer" min="0" label="Minimum mapped read length in basepairs" value="50" optional="true"/>
            <param argument="-N" type="integer" min="0" label="Output at maximum N alignments for each read, 0 means no maximum" value="0" optional="true"/>
        </section>
    </inputs>
    <outputs>
        <data name="bam" format="bam" from_work_dir="out.aligned.bam" label="${tool.name} on ${on_string} (BAM file)"/>
    </outputs>
    <tests>
        <!-- test1: basic test -->
        <test expect_num_outputs="1">
            <param name="reference_source_selector" value="history" />
            <param name="ref_file" ftype="fasta" value="bnd-ref.fasta"/>
            <param name="reads" value="bnd.bam"/>
            <output name="bam">
                <assert_contents>
                    <has_size value="2778" delta="200" />
                </assert_contents>
            </output>
        </test>
        <!-- test2: map some reads for use with pbgcpp -->
        <test expect_num_outputs="1">
            <param name="reference_source_selector" value="history" />
            <param name="ref_file" ftype="fasta" value="All4mer.V2.01_Insert.fa"/>
            <param name="reads" value="out.aligned_subreads.bam"/>
            <param name="preset" value="SUBREAD"/>
            <output name="bam">
                <assert_contents>
                    <has_size value="538329" delta="50000" />
                </assert_contents>
            </output>
        </test>
        <!-- test3: cached genome -->
        <test>
            <param name="reference_source_selector" value="cached" />
            <param name="ref_file" value="bnd-ref"/>
            <param name="reads" value="bnd.bam"/>
            <output name="bam">
                <assert_contents>
                    <has_size value="2778" delta="200" />
                </assert_contents>
            </output>
        </test>
    </tests>
        <help><![CDATA[
**What it does**

A minimap2 wrapper for PacBio data: native PacBio data in ⇨ native
PacBio BAM out.

--------------

pbmm2 is Pacific Biosciences’ wrapper for
`minimap2 <https://github.com/lh3/minimap2>`__\ ’s C API. It supports
native PacBio input. Output can be used directly for polishing using
`pbgcpp <root?tool_id=pbgcpp>`__.

**Input**: PacBio reads in bam or [gzipped] fasta or fastq format.
**NOTE**: to use the output of pbmm2 for pbgcpp (GenomicConsensus), you
have to provide PacBio CLR reads in bam format. You can use pbmm2 to
align other types of PacBio reads in [gzipped] fasta or fastq format,
but you can’t use the output for pbgcpp (GenomicConsensus).

**Output**: A **sorted** PacBio BAM file, suitable for use with
pbgcpp (previously known as GenomicConsensus).

        ]]></help>
        <citations>
            <citation type="bibtex">
@misc{githubpbmm2,
  author = {PacBio},
  year = {2023},
  title = {pbmm2},
  publisher = {GitHub},
  journal = {GitHub repository},
  url = {https://github.com/PacificBiosciences/pbmm2},
}</citation>
    </citations>
    <expand macro="creator"/>
</tool>