changeset 4:d3e88507ee64 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bwa_mem2 commit e953b3b7dac6cbe9509fdc673907a7c2c7183180
author iuc
date Wed, 19 Mar 2025 17:25:56 +0000
parents bfaa0d22c2e4
children
files bwa-mem2-idx.xml bwa-mem2.xml macros.xml test-data/bwa_mem2_index.loc test-data/test-cache/bwa-mem-mt-genome.fa.0123 test-data/test-cache/bwa-mem-mt-genome.fa.amb test-data/test-cache/bwa-mem-mt-genome.fa.ann test-data/test-cache/bwa-mem-mt-genome.fa.bwt.2bit.64 test-data/test-cache/bwa-mem-mt-genome.fa.pac test-data/test-cache/reference.0123 test-data/test-cache/reference.amb test-data/test-cache/reference.ann test-data/test-cache/reference.bwt.2bit.64 test-data/test-cache/reference.pac
diffstat 14 files changed, 71 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bwa-mem2-idx.xml	Wed Mar 19 17:25:56 2025 +0000
@@ -0,0 +1,36 @@
+<tool id="bwa_mem2_idx" name="BWA-MEM2 indexer"  version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE_VERSION@">
+    <description>Build BWA-MEM2 reference index</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command><![CDATA[
+mkdir '$index.extra_files_path' &&
+cd '$index.extra_files_path' &&
+bwa-mem2 index -p 'reference' '${reference}'
+    ]]></command>
+    <inputs>
+        <param name="reference" type="data" format="fasta,fasta.gz" label="Select a genome to index" help="Build an index for this FASTA sequence."/>
+    </inputs>
+    <outputs>
+        <data name="index" format="bwa_mem2_index"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="reference" ftype="fasta" value="bwa-mem-mt-genome.fa"/>
+            <output name="index" ftype="bwa_mem2_index">
+                <extra_files name="reference.0123" type="file" value="test-cache/reference.0123"></extra_files>
+            </output>
+        </test>
+    </tests>
+    <help><![CDATA[
+**What is does**
+BWA-MEM2 is the new version of the bwa-mem algorithm in bwa. It produces alignment identical to bwa and is ~1.3-3.1x faster depending on the use-case, dataset and the running machine.
+The algorithm is robust to sequencing errors and applicable to a wide range of sequence lengths from 70bp to a few megabases.
+
+This tools build a reference index for the bwa-mem2 galaxy tool.
+
+@info@
+    ]]></help>
+    <expand macro="citations" />
+</tool>
--- a/bwa-mem2.xml	Wed Jul 26 20:02:13 2023 +0000
+++ b/bwa-mem2.xml	Wed Mar 19 17:25:56 2025 +0000
@@ -1,4 +1,4 @@
-<tool id="bwa_mem2" name="BWA-MEM2"  version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01">
+<tool id="bwa_mem2" name="BWA-MEM2"  version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.2">
     <description>- map medium and long reads (&gt; 100 bp) against reference genome</description>
     <macros>
         <import>read_group_macros.xml</import>
@@ -283,12 +283,21 @@
     <tests>
         <test>
             <param name="reference_source_selector" value="history" />
+            <param name="ref_file" ftype="bwa_mem2_index" class="Directory" value="test-cache"/>
+            <param name="fastq_input_selector" value="paired"/>
+            <param name="fastq_input1" ftype="fastqsanger" value="bwa-mem-fastq1.fq"/>
+            <param name="fastq_input2" ftype="fastqsanger" value="bwa-mem-fastq2.fq"/>
+            <param name="analysis_type_selector" value="illumina"/>
+            <output name="bam_output" ftype="bam" file="bwa-mem-test1.bam" lines_diff="6" />
+        </test>
+        <test>
+            <param name="reference_source_selector" value="history" />
             <param name="ref_file" ftype="fasta" value="bwa-mem-mt-genome.fa"/>
             <param name="fastq_input_selector" value="paired"/>
             <param name="fastq_input1" ftype="fastqsanger" value="bwa-mem-fastq1.fq"/>
             <param name="fastq_input2" ftype="fastqsanger" value="bwa-mem-fastq2.fq"/>
             <param name="analysis_type_selector" value="illumina"/>
-            <output name="bam_output" ftype="bam" file="bwa-mem-test1.bam" lines_diff="4" />
+            <output name="bam_output" ftype="bam" file="bwa-mem-test1.bam" lines_diff="6" />
         </test>
         <test>
             <param name="reference_source_selector" value="history" />
@@ -296,7 +305,7 @@
             <param name="fastq_input_selector" value="single"/>
             <param name="fastq_input1" ftype="fastqsanger" value="bwa-mem-fasta1.fa"/>
             <param name="analysis_type_selector" value="illumina"/>
-            <output name="bam_output" ftype="bam" file="bwa-mem-test1-fasta.bam" lines_diff="4" />
+            <output name="bam_output" ftype="bam" file="bwa-mem-test1-fasta.bam" lines_diff="6" />
         </test>
         <test>
             <param name="reference_source_selector" value="history" />
@@ -305,7 +314,7 @@
             <param name="fastq_input1" ftype="fastqsanger.gz" value="bwa-mem-fastq1.fq.gz"/>
             <param name="fastq_input2" ftype="fastqsanger" value="bwa-mem-fastq2.fq"/>
             <param name="analysis_type_selector" value="illumina"/>
-            <output name="bam_output" ftype="bam" file="bwa-mem-test1.bam" lines_diff="4" />
+            <output name="bam_output" ftype="bam" file="bwa-mem-test1.bam" lines_diff="6" />
         </test>
         <test>
             <param name="reference_source_selector" value="history" />
@@ -318,7 +327,7 @@
             <param name="PL" value="CAPILLARY"/>
             <param name="LB" value="AARDVARK-1" />
             <param name="analysis_type_selector" value="illumina"/>
-            <output name="bam_output" ftype="bam" file="bwa-mem-test2.bam" lines_diff="4" />
+            <output name="bam_output" ftype="bam" file="bwa-mem-test2.bam" lines_diff="6" />
         </test>
         <test>
             <param name="reference_source_selector" value="history" />
@@ -328,7 +337,7 @@
             <param name="fastq_input2" ftype="fastqsanger" value="bwa-mem-fastq2.fq"/>
             <param name="analysis_type_selector" value="illumina"/>
             <param name="output_sort" value="unsorted"/>
-            <output name="bam_output" ftype="qname_input_sorted.bam" file="bwa-mem-test3.bam" lines_diff="4" />
+            <output name="bam_output" ftype="qname_input_sorted.bam" file="bwa-mem-test3.bam" lines_diff="6" />
         </test>
         <test>
             <param name="reference_source_selector" value="history" />
@@ -338,7 +347,7 @@
             <param name="fastq_input2" ftype="fastqsanger" value="bwa-mem-fastq2.fq"/>
             <param name="analysis_type_selector" value="illumina"/>
             <param name="output_sort" value="name"/>
-            <output name="bam_output" ftype="qname_sorted.bam" file="bwa-mem-test4.bam" lines_diff="4" />
+            <output name="bam_output" ftype="qname_sorted.bam" file="bwa-mem-test4.bam" lines_diff="6" />
         </test>
         <test>
             <param name="reference_source_selector" value="cached" />
@@ -347,7 +356,7 @@
             <param name="fastq_input1" ftype="fastqsanger" value="bwa-mem-fastq1.fq"/>
             <param name="fastq_input2" ftype="fastqsanger" value="bwa-mem-fastq2.fq"/>
             <param name="analysis_type_selector" value="illumina"/>
-            <output name="bam_output" ftype="bam" file="bwa-mem-test1.bam" lines_diff="4" />
+            <output name="bam_output" ftype="bam" file="bwa-mem-test1.bam" lines_diff="6" />
         </test>
     </tests>
     <help><![CDATA[
--- a/macros.xml	Wed Jul 26 20:02:13 2023 +0000
+++ b/macros.xml	Wed Mar 19 17:25:56 2025 +0000
@@ -3,6 +3,7 @@
 
     <token name="@TOOL_VERSION@">2.2.1</token>
     <token name="@VERSION_SUFFIX@">1</token>
+    <token name="@PROFILE_VERSION@">20.01</token>
 
     <xml name="xrefs">
         <xrefs>
@@ -29,10 +30,14 @@
 
     <token name="@set_reference_fasta_filename@"><![CDATA[
     #if str( $reference_source.reference_source_selector ) == "history":
-        #set $reference_fasta_filename = "localref.fa"
-        ln -s '${reference_source.ref_file}' '${reference_fasta_filename}' &&
-        bwa-mem2 index
-        '${reference_fasta_filename}' &&
+        #if $reference_source.ref_file.is_of_type("bwa_mem2_index"):
+            #set $reference_fasta_filename = $reference_source.ref_file.extra_files_path + "/reference"
+        #else
+            #set $reference_fasta_filename = "localref." + $reference_source.ref_file.extension
+            ln -s '${reference_source.ref_file}' '${reference_fasta_filename}' &&
+            bwa-mem2 index
+            '${reference_fasta_filename}' &&
+        #end if
     #else:
         #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
     #end if
@@ -41,7 +46,7 @@
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@TOOL_VERSION@">bwa-mem2</requirement>
-            <requirement type="package" version="1.13">samtools</requirement>
+            <yield></yield>
         </requirements>
     </xml>
 
@@ -59,7 +64,7 @@
         <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?" help="Built-ins were indexed using default options. See `Indexes` section of help below">
                 <option value="cached">Use a built-in genome index</option>
-                <option value="history">Use a genome from history and build index</option>
+                <option value="history">Use a reference from history and build index if necessary</option>
             </param>
             <when value="cached">
                 <param name="ref_file" type="select" label="Using reference genome" help="Select genome from the list">
@@ -71,7 +76,7 @@
                 </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" />
+                <param name="ref_file" type="data" format="fasta,fasta.gz,bwa_mem2_index" label="Use the following dataset as the reference" help="You can upload a FASTA sequence to the history and use it as reference. For better performance build a reference index separately." />
             </when>
         </conditional>
     </macro>
--- a/test-data/bwa_mem2_index.loc	Wed Jul 26 20:02:13 2023 +0000
+++ b/test-data/bwa_mem2_index.loc	Wed Mar 19 17:25:56 2025 +0000
@@ -1,1 +1,1 @@
-mtgenome	mtGenome	Mitochondiral genome	${__HERE__}/test-cache/bwa-mem-mt-genome.fa
\ No newline at end of file
+mtgenome	mtGenome	Mitochondiral genome	${__HERE__}/test-cache/reference
Binary file test-data/test-cache/bwa-mem-mt-genome.fa.0123 has changed
--- a/test-data/test-cache/bwa-mem-mt-genome.fa.amb	Wed Jul 26 20:02:13 2023 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-16569 1 1
-3106 1 N
--- a/test-data/test-cache/bwa-mem-mt-genome.fa.ann	Wed Jul 26 20:02:13 2023 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-16569 1 11
-0 gi|251831106|ref|NC_012920.1| (null)
-0 16569 1
Binary file test-data/test-cache/bwa-mem-mt-genome.fa.bwt.2bit.64 has changed
Binary file test-data/test-cache/bwa-mem-mt-genome.fa.pac has changed
Binary file test-data/test-cache/reference.0123 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test-cache/reference.amb	Wed Mar 19 17:25:56 2025 +0000
@@ -0,0 +1,2 @@
+16569 1 1
+3106 1 N
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test-cache/reference.ann	Wed Mar 19 17:25:56 2025 +0000
@@ -0,0 +1,3 @@
+16569 1 11
+0 gi|251831106|ref|NC_012920.1| (null)
+0 16569 1
Binary file test-data/test-cache/reference.bwt.2bit.64 has changed
Binary file test-data/test-cache/reference.pac has changed