From f499d5be28877a0379bf22ef5ce3c478d012acdd Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 9 Mar 2025 14:15:36 +0100 Subject: [PATCH 1/3] Enable bwa_mem2_directory input datatype --- tools/bwa_mem2/bwa-mem2.xml | 23 ++++++++++++------ tools/bwa_mem2/macros.xml | 16 +++++++----- tools/bwa_mem2/test-data/bwa_mem2_index.loc | 2 +- ...a-mem-mt-genome.fa.0123 => reference.0123} | Bin ...bwa-mem-mt-genome.fa.amb => reference.amb} | 0 ...bwa-mem-mt-genome.fa.ann => reference.ann} | 0 ...e.fa.bwt.2bit.64 => reference.bwt.2bit.64} | Bin ...bwa-mem-mt-genome.fa.pac => reference.pac} | Bin 8 files changed, 27 insertions(+), 14 deletions(-) rename tools/bwa_mem2/test-data/test-cache/{bwa-mem-mt-genome.fa.0123 => reference.0123} (100%) rename tools/bwa_mem2/test-data/test-cache/{bwa-mem-mt-genome.fa.amb => reference.amb} (100%) rename tools/bwa_mem2/test-data/test-cache/{bwa-mem-mt-genome.fa.ann => reference.ann} (100%) rename tools/bwa_mem2/test-data/test-cache/{bwa-mem-mt-genome.fa.bwt.2bit.64 => reference.bwt.2bit.64} (100%) rename tools/bwa_mem2/test-data/test-cache/{bwa-mem-mt-genome.fa.pac => reference.pac} (100%) diff --git a/tools/bwa_mem2/bwa-mem2.xml b/tools/bwa_mem2/bwa-mem2.xml index 0e26f7956e7..b85402ce03e 100644 --- a/tools/bwa_mem2/bwa-mem2.xml +++ b/tools/bwa_mem2/bwa-mem2.xml @@ -281,6 +281,15 @@ bwa-mem2 mem + + + + + + + + + @@ -288,7 +297,7 @@ bwa-mem2 mem - + @@ -296,7 +305,7 @@ bwa-mem2 mem - + @@ -305,7 +314,7 @@ bwa-mem2 mem - + @@ -318,7 +327,7 @@ bwa-mem2 mem - + @@ -328,7 +337,7 @@ bwa-mem2 mem - + @@ -338,7 +347,7 @@ bwa-mem2 mem - + @@ -347,7 +356,7 @@ bwa-mem2 mem - + - + @@ -71,7 +75,7 @@ - + diff --git a/tools/bwa_mem2/test-data/bwa_mem2_index.loc b/tools/bwa_mem2/test-data/bwa_mem2_index.loc index db1680c37b1..9f1bc7e738f 100644 --- a/tools/bwa_mem2/test-data/bwa_mem2_index.loc +++ b/tools/bwa_mem2/test-data/bwa_mem2_index.loc @@ -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 diff --git a/tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.0123 b/tools/bwa_mem2/test-data/test-cache/reference.0123 similarity index 100% rename from tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.0123 rename to tools/bwa_mem2/test-data/test-cache/reference.0123 diff --git a/tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.amb b/tools/bwa_mem2/test-data/test-cache/reference.amb similarity index 100% rename from tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.amb rename to tools/bwa_mem2/test-data/test-cache/reference.amb diff --git a/tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.ann b/tools/bwa_mem2/test-data/test-cache/reference.ann similarity index 100% rename from tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.ann rename to tools/bwa_mem2/test-data/test-cache/reference.ann diff --git a/tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.bwt.2bit.64 b/tools/bwa_mem2/test-data/test-cache/reference.bwt.2bit.64 similarity index 100% rename from tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.bwt.2bit.64 rename to tools/bwa_mem2/test-data/test-cache/reference.bwt.2bit.64 diff --git a/tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.pac b/tools/bwa_mem2/test-data/test-cache/reference.pac similarity index 100% rename from tools/bwa_mem2/test-data/test-cache/bwa-mem-mt-genome.fa.pac rename to tools/bwa_mem2/test-data/test-cache/reference.pac From db0b76eefd02d97a591e963b9f554139f8724260 Mon Sep 17 00:00:00 2001 From: Jarvis Lab Date: Wed, 13 Nov 2024 09:53:10 -0500 Subject: [PATCH 2/3] Add bwa-mem2-idx --- tools/bwa_mem2/bwa-mem2-idx.xml | 72 +++++++++++++++++++++++++++++++++ tools/bwa_mem2/macros-index.xml | 13 ++++++ 2 files changed, 85 insertions(+) create mode 100644 tools/bwa_mem2/bwa-mem2-idx.xml create mode 100644 tools/bwa_mem2/macros-index.xml diff --git a/tools/bwa_mem2/bwa-mem2-idx.xml b/tools/bwa_mem2/bwa-mem2-idx.xml new file mode 100644 index 00000000000..6ed25585f66 --- /dev/null +++ b/tools/bwa_mem2/bwa-mem2-idx.xml @@ -0,0 +1,72 @@ + + - creates indexes + + macros-index.xml + + + '$output' && +mkdir '$output.files_path' && +cd '$output.files_path' && +bwa-mem2 index -p 'index' '${input_fasta}' + ]]> + + + + + + + + + + Support** link at the top of the interface and let us know that an index needs to be added + 2. Upload your genome of interest as a FASTA file to Galaxy history and selected **Use a genome from the history and build index** option. + +----- + +**Galaxy-specific option** + +Galaxy allows four levels of control over bwa-mem options provided by **Select analysis mode** menu option. These are: + + 1. *Simple Illumina mode*: The simplest possible bwa mem application in which it alignes single or paired-end data to reference using default parameters. It is equivalent to the following command: bwa mem [fastq dataset2] + 2. *PacBio mode*: The mode adjusted specifically for mapping of long PacBio subreads. Equivalent to the following command: bwa mem -k17 -W40 -r10 -A1 -B1 -O1 -E1 -L0 + 3. *Full list of options*: Allows access to all options through Galaxy interface. + +----- + +**Bam sorting mode** + +The generated bam files can be sorted according to three criteria: coordinates, names and input order. + +In coordinate sorted mode the reads are sorted by coordinates. It means that the reads from the beginning of the first chromosome are first in the file. + +When sorted by read name, the file is sorted by the reference ID (i.e., the QNAME field). + +Finally, the *No sorted (sorted as input)* option yield a BAM file in which the records are sorted in an order corresponding to the order of the reads in the original input file. This option requires using a single thread to perform the conversion from SAM to BAM format, so the runtime is extended. + + +@RG@ + +@info@ + ]]> + diff --git a/tools/bwa_mem2/macros-index.xml b/tools/bwa_mem2/macros-index.xml new file mode 100644 index 00000000000..2ac38cdbe25 --- /dev/null +++ b/tools/bwa_mem2/macros-index.xml @@ -0,0 +1,13 @@ + + + + bwa-mem2 + + + + + + 2.2.1 + 0 + 21.05 + From 012a51a6794cabebd5fb9d4b1348f4b2354c8d26 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 9 Mar 2025 14:55:28 +0100 Subject: [PATCH 3/3] Use bwa_mem2_index datatype in bwa mem2 indexer --- tools/bwa/bwa-mem.xml | 4 +- tools/bwa_mem2/bwa-mem2-idx.xml | 72 +++++++++------------------------ tools/bwa_mem2/bwa-mem2.xml | 2 +- tools/bwa_mem2/macros-index.xml | 13 ------ tools/bwa_mem2/macros.xml | 7 ++-- 5 files changed, 26 insertions(+), 72 deletions(-) delete mode 100644 tools/bwa_mem2/macros-index.xml diff --git a/tools/bwa/bwa-mem.xml b/tools/bwa/bwa-mem.xml index ed575484968..33b71efbda8 100644 --- a/tools/bwa/bwa-mem.xml +++ b/tools/bwa/bwa-mem.xml @@ -6,7 +6,9 @@ bwa_macros.xml - + + samtools + - - creates indexes + + Build BWA-MEM2 reference index - macros-index.xml + macros.xml '$output' && -mkdir '$output.files_path' && -cd '$output.files_path' && -bwa-mem2 index -p 'index' '${input_fasta}' +mkdir '$index.extra_files_path' && +cd '$index.extra_files_path' && +bwa-mem2 index -p 'reference' '${reference}' ]]> - - + - - + - + + + + + + + + Support** link at the top of the interface and let us know that an index needs to be added - 2. Upload your genome of interest as a FASTA file to Galaxy history and selected **Use a genome from the history and build index** option. - ------ - -**Galaxy-specific option** - -Galaxy allows four levels of control over bwa-mem options provided by **Select analysis mode** menu option. These are: - - 1. *Simple Illumina mode*: The simplest possible bwa mem application in which it alignes single or paired-end data to reference using default parameters. It is equivalent to the following command: bwa mem [fastq dataset2] - 2. *PacBio mode*: The mode adjusted specifically for mapping of long PacBio subreads. Equivalent to the following command: bwa mem -k17 -W40 -r10 -A1 -B1 -O1 -E1 -L0 - 3. *Full list of options*: Allows access to all options through Galaxy interface. - ------ - -**Bam sorting mode** - -The generated bam files can be sorted according to three criteria: coordinates, names and input order. - -In coordinate sorted mode the reads are sorted by coordinates. It means that the reads from the beginning of the first chromosome are first in the file. - -When sorted by read name, the file is sorted by the reference ID (i.e., the QNAME field). - -Finally, the *No sorted (sorted as input)* option yield a BAM file in which the records are sorted in an order corresponding to the order of the reads in the original input file. This option requires using a single thread to perform the conversion from SAM to BAM format, so the runtime is extended. - - -@RG@ +This tools build a reference index for the bwa-mem2 galaxy tool. @info@ ]]> + diff --git a/tools/bwa_mem2/bwa-mem2.xml b/tools/bwa_mem2/bwa-mem2.xml index b85402ce03e..808c1fcbed0 100644 --- a/tools/bwa_mem2/bwa-mem2.xml +++ b/tools/bwa_mem2/bwa-mem2.xml @@ -1,4 +1,4 @@ - + - map medium and long reads (> 100 bp) against reference genome read_group_macros.xml diff --git a/tools/bwa_mem2/macros-index.xml b/tools/bwa_mem2/macros-index.xml deleted file mode 100644 index 2ac38cdbe25..00000000000 --- a/tools/bwa_mem2/macros-index.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - bwa-mem2 - - - - - - 2.2.1 - 0 - 21.05 - diff --git a/tools/bwa_mem2/macros.xml b/tools/bwa_mem2/macros.xml index bc2d1482f4d..8b990ce0b71 100644 --- a/tools/bwa_mem2/macros.xml +++ b/tools/bwa_mem2/macros.xml @@ -3,6 +3,7 @@ 2.2.1 1 + 20.01 @@ -32,7 +33,7 @@ #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.fa" + #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}' && @@ -45,7 +46,7 @@ bwa-mem2 - samtools + @@ -75,7 +76,7 @@ - +